diff --git a/configs/pepe/home-assistant.nix b/configs/pepe/home-assistant.nix index 412d325..c6d2e8c 100644 --- a/configs/pepe/home-assistant.nix +++ b/configs/pepe/home-assistant.nix @@ -108,44 +108,11 @@ in { platform = "state"; entity_id = "input_boolean.situation_toggle"; }; - condition = { - condition = "template"; - value_template = - ''{{ states.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 = "template"; - value_template = - ''{{ states.input_select.scene.state == "outside" }}''; - }; - action = [ - { - service = "input_select.select_option"; - data = { - entity_id = "input_select.scene_button"; - option = "default"; - }; - } - { - service = "input_select.select_option"; - data = { - entity_id = "input_select.scene"; - option = "default"; - }; - } - ]; - } { alias = "Button Scene -> Scene"; trigger = { @@ -160,6 +127,8 @@ in { }; }; } + + # outside and home { alias = "Set Scene To Outside when opening door"; trigger = [ @@ -187,6 +156,37 @@ in { }; } + { + alias = "Set default for motion inside"; + trigger = map (entity_id: { + platform = "state"; + entity_id = entity_id; + from = "off"; + to = "on"; + }) [ + "binary_sensor.motion_sensor_1" + "binary_sensor.motion_sensor_2" + "binary_sensor.motion_sensor_3" + "binary_sensor.motion_sensor_4" + "binary_sensor.motion_sensor_5" + "binary_sensor.motion_sensor_6" + "binary_sensor.motion_sensor_7" + "binary_sensor.motion_sensor_8" + ]; + condition = { + condition = "template"; + value_template = + ''{{ states.input_select.scene.state == "outside" }}''; + }; + action = { + service = "input_select.select_option"; + data = { + entity_id = "input_select.scene"; + option = "default"; + }; + }; + } + # window roles { alias = "windows state = down in the evening";