only refresh screen when lux higher than 5

This commit is contained in:
Michi 2025-05-11 17:04:06 +02:00
parent 055baedf38
commit 5f1553a265
2 changed files with 9 additions and 2 deletions

View file

@ -168,7 +168,9 @@ time:
then:
- if:
condition:
binary_sensor.is_on: presence_detected
all:
- binary_sensor.is_on: presence_detected
- lambda: 'return id(presence_lux).state > 5;'
then:
- logger.log: "Sensor data updated and activity in home detected: Refreshing display..."
- script.execute: update_screen
@ -208,6 +210,11 @@ sensor:
entity_category: "diagnostic"
update_interval: 60s
# LUX value used for deciding if display should be updated (only if it can be read)
- platform: homeassistant
entity_id: <YOUR-LUX-SENSOR>
id: presence_lux
- platform: homeassistant
entity_id: weather.<YOUR-WEATHER>
attribute: temperature