Skip to content

Commit c1aeb1a

Browse files
committed
Try trigger_on_initial_state
1 parent 7f8f95d commit c1aeb1a

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

include/scripts.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
script:
99
- id: on_boot_scripts
1010
then:
11-
- delay: 2s
1211
- script.execute: hide_unwanted_rooms
1312
- script.execute: hide_unwanted_tabs
1413
- script.execute: hide_unwanted_scenes

include/sensors_room_status.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ binary_sensor:
117117
- platform: homeassistant
118118
entity_id: ${ha_window_contact_sensor_id}
119119
id: sensor_contact_${room_id}
120+
trigger_on_initial_state: true
120121
on_state:
121122
- script.execute: sync_window_contact_ui_${room_id}
122123

include/time.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,11 @@ time:
2222
minutes: '*'
2323
then:
2424
- script.execute: time_update
25+
26+
# Keep window contact UI in sync twice per minute
27+
# The reason for this is that the ESPHome sensors created for the window contacts
28+
# may not trigger their "on_state" actions for a long time... i.e. until the window
29+
# is opened or closed. This can lead to the UI being out of sync with the actual state.
30+
# - seconds: /30
31+
# then:
32+
# - script.execute: sync_all_window_contact_ui

0 commit comments

Comments
 (0)