From 209caa0c4e772817aae17d9295e1929a37926c41 Mon Sep 17 00:00:00 2001 From: EverythingSmartHome Date: Wed, 26 Jul 2023 11:02:04 +0100 Subject: [PATCH] Add configurable offsets --- everything-presence-one.yaml | 65 +++++++++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/everything-presence-one.yaml b/everything-presence-one.yaml index 8d2f3fb..6c2e45a 100644 --- a/everything-presence-one.yaml +++ b/everything-presence-one.yaml @@ -2,7 +2,7 @@ substitutions: name: "everything-presence-one" friendly_name: "Everything Presence One" project_name: "Everything Smart Technology.Everything Presence One" - project_version: "1.1.5" + project_version: "1.1.6" temperature_offset: "-3" humidity_offset: "5" temperature_update_interval: "60s" @@ -43,7 +43,7 @@ esp32_improv: authorizer: none dashboard_import: - package_import_url: github://everythingsmarthome/presence-one/everything-presence-one.yaml@main + package_import_url: github://everythingsmarthome/everything-presence-one/everything-presence-one.yaml@main import_full_config: false light: @@ -85,20 +85,28 @@ i2c: sensor: - platform: shtcx + id: "shtc3_sensor" temperature: name: Temperature + id: temperature_sensor filters: - offset: ${temperature_offset} + - offset: ${temperature_offset} + - lambda: "return x + id(temperature_offset_ui).state;" humidity: name: Humidity + id: humidity_sensor filters: - offset: ${humidity_offset} + - offset: ${humidity_offset} + - lambda: "return x + id(humidity_offset_ui).state;" address: 0x70 update_interval: ${temperature_update_interval} - platform: bh1750 name: Illuminance + id: illuminance_sensor address: 0x23 update_interval: ${illuminance_update_interval} + filters: + - lambda: "return x + id(illuminance_offset_ui).state;" binary_sensor: - platform: gpio @@ -303,6 +311,55 @@ number: - delay: 1s - switch.turn_on: mmwave_sensor + - platform: template + name: "Temperature Offset" + id: temperature_offset_ui + unit_of_measurement: "°C" + min_value: -20 + max_value: 20 + step: 0.1 + mode: box + update_interval: never + optimistic: true + restore_value: true + initial_value: 0 + icon: "mdi:thermometer" + entity_category: config + on_value: + - lambda: 'id(shtc3_sensor).update();' + - platform: template + name: "Humidity Offset" + id: humidity_offset_ui + unit_of_measurement: "%" + min_value: -50 + max_value: 50 + step: 0.1 + mode: box + update_interval: never + optimistic: true + restore_value: true + initial_value: 0 + icon: "mdi:water-percent" + entity_category: config + on_value: + - lambda: 'id(shtc3_sensor).update();' + - platform: template + name: "Illuminance Offset" + id: illuminance_offset_ui + unit_of_measurement: "lx" + min_value: -50 + max_value: 50 + step: 1 + mode: box + update_interval: never + optimistic: true + restore_value: true + initial_value: 0 + icon: "mdi:brightness-5" + entity_category: config + on_value: + - lambda: 'id(illuminance_sensor).update();' + button: - platform: restart id: restart_internal