From 5f1553a26515f7fb7d1204a72e3b2d4d9f007920 Mon Sep 17 00:00:00 2001 From: michivonah Date: Sun, 11 May 2025 17:04:06 +0200 Subject: [PATCH] only refresh screen when lux higher than 5 --- README.md | 2 +- weatherman.yaml | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9c5e4f4..f464a8c 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ In the center of the screen the current playing media of one or more speakers ca At the bottom you find some stats of your Home Assistant instance that you can adjust. ## Intelligent Screen Refreshing -To reduce the frequency of screen refreshes and to prolong the life of the e-ink screen, the screen will now only refresh when presence is detected. +To reduce the frequency of screen refreshes and to prolong the life of the e-ink screen, the screen will now only refresh when presence is detected and the lux in the current room is over 5 to avoid refreshing when the display's content can't be read in terms of brightness (like during night). ## Last Refreshed Timestamp The last update timestamp can be displayed on the screen itself. No more wondering when the screen was last refreshed! diff --git a/weatherman.yaml b/weatherman.yaml index 5a1e327..f174957 100644 --- a/weatherman.yaml +++ b/weatherman.yaml @@ -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: + id: presence_lux + - platform: homeassistant entity_id: weather. attribute: temperature