diff --git a/configs/pepe/home-assistant.nix b/configs/pepe/home-assistant.nix index 84124d7..626604d 100644 --- a/configs/pepe/home-assistant.nix +++ b/configs/pepe/home-assistant.nix @@ -50,7 +50,7 @@ in { # all scenes input_select.scene = { icon = "mdi:brightness-auto"; - options = [ "default" "night" "outside" ]; + options = [ "default" "night" "outside" "cooking" ]; }; # scenes controlled by buttons input_select.scene_button = { @@ -62,9 +62,7 @@ in { automation = [ { - # This automation script runs when the thermostat mode selector is changed. - # It publishes its value to the same MQTT topic it is also subscribed to. - alias = "Mqtt publish Scene"; + alias = "set light-control scene"; trigger = { platform = "state"; entity_id = "input_select.scene"; @@ -73,7 +71,6 @@ in { service = "mqtt.publish"; data_template = { topic = "control/lights/set"; - #retain = true; payload_template = ''{"scene":"{{ states('input_select.scene')}}"}''; }; @@ -82,16 +79,45 @@ in { # control situation with buttons { - alias = "Toggle Button (controlled) Scene"; + alias = "Button -> Change Scene"; trigger = { platform = "state"; entity_id = "input_boolean.situation_toggle"; }; + condition = { + condition = "not"; + conditions = [{ + condition = { + condition = "state"; + entity_id = "input_select.scene"; + state = "outside"; + }; + }]; + }; action = { service = "input_select.select_next"; data.entity_id = "input_select.scene_button"; }; } + { + alias = "Button -> Default Scene"; + trigger = { + platform = "state"; + entity_id = "input_boolean.situation_toggle"; + }; + condition = { + condition = "state"; + entity_id = "input_select.scene"; + state = "outside"; + }; + action = { + service = "input_select.select_option"; + data = { + entity_id = "input_select.scene_button"; + option = "default"; + }; + }; + } { alias = "Button Scene -> Scene"; trigger = { @@ -106,6 +132,7 @@ in { }; }; } + { alias = "Set Scene To Outside when opening door"; trigger = [ diff --git a/configs/pepe/home-assistant/light-control.nix b/configs/pepe/home-assistant/light-control.nix index 4d9c3e7..240257a 100644 --- a/configs/pepe/home-assistant/light-control.nix +++ b/configs/pepe/home-assistant/light-control.nix @@ -14,6 +14,10 @@ name = "outside"; room_tracking_enabled = false; } + { + name = "cooking"; + enabled_switches = [ "stat/PAL07/RESULT" "stat/PAL08/RESULT" ]; + } { name = "night"; room_tracking_enabled = false;