From 7a309cd69d99417b58781a8692e1fa2228f26612 Mon Sep 17 00:00:00 2001 From: Joe Mou Date: Wed, 26 Feb 2025 07:34:11 -0500 Subject: Panel light reinitialize HA automation Untested but ported from old HA config in commit 25f26a29a6255c5fe3ccf0ffa11f630bd63c60df --- hostnix/elmo/home-assistant.nix | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) 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; } + ]; + }; + } + ]; + } ]; }; }; -- cgit v1.3.1