diff --git a/.gitignore b/.gitignore
index a6387e7..b39209a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+.serenata/
 *.backup
 .cache/
 app/
diff --git a/build b/build
index c3e07ec..3471a37 100755
--- a/build
+++ b/build
@@ -28,7 +28,7 @@ cache_dir="./.cache";
 build_output_folder="./app";
 
 # Database settings for ssh port forwarding task
-database_host="db.connectedhumber.org";
+database_host="aq.connectedhumber.org";
 database_name="aq_db";
 database_user="www-data";
 
@@ -37,7 +37,7 @@ min_npm_version_major="6";
 
 # Deployment settings
 deploy_ssh_user="ci";
-deploy_ssh_host="aq.connectedhumber.org";
+deploy_ssh_host="sensors.connectedhumber.org";
 deploy_ssh_port="22";
 
 deploy_root_dir="Air-Quality-Web";
diff --git a/logic/Actions/ListReadingTypes.php b/logic/Actions/ListReadingTypes.php
index 6b00cf3..99086d9 100644
--- a/logic/Actions/ListReadingTypes.php
+++ b/logic/Actions/ListReadingTypes.php
@@ -37,6 +37,7 @@ class ListReadingTypes implements IAction {
 		
 		// 1: Parse & validate parameters
 		$device_id = !empty($_GET["device-id"]) ? intval($_GET["device-id"]) : null;
+		$days_to_analyse = intval($_GET["days"] ?? "1") - 1;
 		
 		$format = $_GET["format"] ?? "json";
 		if(!in_array($format, ["json", "csv"])) {
@@ -53,7 +54,7 @@ class ListReadingTypes implements IAction {
 		if(!is_int($device_id))
 			$data = $this->types_repo->get_all_types();
 		else
-			$data = $this->types_repo->get_types_by_device($device_id);
+			$data = $this->types_repo->get_types_by_device($device_id. $days_to_analyse);
 		$this->perfcounter->end("sql");
 		
 		// 1.5: Validate data from database
diff --git a/logic/Repositories/IMeasurementTypeRepository.php b/logic/Repositories/IMeasurementTypeRepository.php
index 76fb38b..f1f07e0 100644
--- a/logic/Repositories/IMeasurementTypeRepository.php
+++ b/logic/Repositories/IMeasurementTypeRepository.php
@@ -32,7 +32,9 @@ interface IMeasurementTypeRepository {
 	
 	/**
 	 * Gets the all the measurement types ever reported by a given device id.
+	 * @param	int			$device_id		The id of the device to get the reading types for.
+	 * @param	int			$day_to_analyse	The number of days worth fo data to analyse. Defaults to -1, which is everything. Set to 0 for readings recorded in the last 24 hours, which is much faster.
 	 * @return	string[]	A list of device ids.
 	 */
-	public function get_types_by_device(int $device_id);
+	public function get_types_by_device(int $device_id, int $days_to_analyse);
 }
diff --git a/logic/Repositories/MariaDBMeasurementTypeRepository.php b/logic/Repositories/MariaDBMeasurementTypeRepository.php
index bdc4e77..46db5ee 100644
--- a/logic/Repositories/MariaDBMeasurementTypeRepository.php
+++ b/logic/Repositories/MariaDBMeasurementTypeRepository.php
@@ -81,7 +81,7 @@ class MariaDBMeasurementTypeRepository implements IMeasurementTypeRepository {
 		)->fetchAll();
 	}
 	
-	public function get_types_by_device($device_id) {
+	public function get_types_by_device($device_id, $days_to_analyse = -1) {
 		$s = $this->get_static;
 		$o = $this->get_static_extra;
 		return $this->database->query(
@@ -93,7 +93,9 @@ class MariaDBMeasurementTypeRepository implements IMeasurementTypeRepository {
 				{$o(MariaDBMeasurementDataRepository::class, "table_name_metadata")}.{$o(MariaDBMeasurementDataRepository::class, "column_metadata_id")} = {$o(MariaDBMeasurementDataRepository::class, "table_name_values")}.{$o(MariaDBMeasurementDataRepository::class, "column_values_reading_id")}
 			JOIN {$s("table_name")} ON
 				{$s("table_name")}.{$s("column_id")} = {$o(MariaDBMeasurementDataRepository::class, "table_name_values")}.{$o(MariaDBMeasurementDataRepository::class, "column_values_reading_type")}
-			WHERE {$o(MariaDBMeasurementDataRepository::class, "table_name_metadata")}.{$o(MariaDBMeasurementDataRepository::class, "column_metadata_device_id")} = :device_id
+			WHERE
+				{$o(MariaDBMeasurementDataRepository::class, "table_name_metadata")}.{$o(MariaDBMeasurementDataRepository::class, "column_metadata_device_id")} = :device_id
+				" . ($days_to_analyse >= 0 ? "AND and DATEDIFF(NOW(),s_or_r) = 0" : "") . "
 			GROUP BY {$s("table_name")}.{$s("column_id")};", [
 				"device_id" => $device_id
 			]
