diff options
| author | Joe Mou <dev@mou.fo> | 2025-02-26 07:34:11 -0500 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2025-02-26 07:40:09 -0500 |
| commit | 7a309cd69d99417b58781a8692e1fa2228f26612 (patch) | |
| tree | 0eef7f15f51b1e742a4f22a380c506c3e69c9021 /hostnix | |
| parent | 9184dc8a1d12d17c0fce8557e0b3162d76d44665 (diff) | |
Panel light reinitialize HA automation
Untested but ported from old HA config in
commit 25f26a29a6255c5fe3ccf0ffa11f630bd63c60df
Diffstat (limited to 'hostnix')
| -rw-r--r-- | hostnix/elmo/home-assistant.nix | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/hostnix/elmo/home-assistant.nix b/hostnix/elmo/home-assistant.nix index a62fcd5..de04db2 100644 --- a/hostnix/elmo/home-assistant.nix +++ b/hostnix/elmo/home-assistant.nix @@ -590,6 +590,37 @@ ]) (button "binary_sensor.bedroom_button_2" (ha.action.toggle "switch.wakko")) + + # The panel light can become unresponsive and need to be reboot. + { + alias = "Panel light reinitialize"; + trigger = [ + { + platform = "state"; + entity_id = [ "light.panel_light" ]; + to = "unavailable"; + } + ]; + action = [ + { + repeat = { + while = [ + { + condition = "state"; + entity_id = "light.panel_light"; + state = "unavailable"; + } + ]; + sequence = [ + (ha.action.off "switch.dot") + { delay = 10; } + (ha.action.on "switch.dot") + { delay = 30; } + ]; + }; + } + ]; + } ]; }; }; |
