{ "version": 1, "minor_version": 1, "key": "trace.saved_traces", "data": { "automation.1754461823733": [ { "extended_dict": { "last_step": "action/0/default/13", "run_id": "2bc298a4a003f7912f03e54e37be1de5", "state": "stopped", "script_execution": "cancelled", "timestamp": { "start": "2026-01-13T14:14:42.136621+00:00", "finish": "2026-01-13T14:20:35.506006+00:00" }, "domain": "automation", "item_id": "1754461823733", "trigger": "numeric state of sensor.badkamer_luchtvochtigheid", "trace": { "trigger/3": [ { "path": "trigger/3", "timestamp": "2026-01-13T14:14:42.136879+00:00", "changed_variables": { "this": { "entity_id": "automation.ventilator_badkamer_bp", "state": "on", "attributes": { "id": "1754461823733", "last_triggered": "2026-01-13T12:10:30.307773+00:00", "mode": "restart", "current": 0, "friendly_name": "Ventilator badkamer [BP]" }, "last_changed": "2026-01-13T12:10:27.678160+00:00", "last_reported": "2026-01-13T12:40:30.631431+00:00", "last_updated": "2026-01-13T12:40:30.631431+00:00", "context": { "id": "01KEVNYF57837VBQ526D1AS4FA", "parent_id": null, "user_id": null } }, "trigger": { "id": "t3", "idx": "3", "alias": null, "platform": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": 100.0, "above": 1.0, "from_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "0.61", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:14:37.085186+00:00", "last_reported": "2026-01-13T14:14:37.085186+00:00", "last_updated": "2026-01-13T14:14:37.085186+00:00", "context": { "id": "01KEVVAS8XJ781612SY56V3139", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "1.01", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:14:42.133040+00:00", "last_reported": "2026-01-13T14:14:42.133040+00:00", "last_updated": "2026-01-13T14:14:42.133040+00:00", "context": { "id": "01KEVVAY6NJAA73YNYESNQVF8K", "parent_id": null, "user_id": null } }, "for": null, "description": "numeric state of sensor.badkamer_luchtvochtigheid" }, "bathroom_humidity_sensor": [], "include_manual_trigger": "disable_manual_trigger", "manual_trigger": [], "manual_trigger_default_time_delay": 15, "manual_trigger_winter_time_delay": 15, "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "fan_speed_low": [], "fan_speed_off": [], "rising_humidity": 1, "falling_humidity": -1, "time_delay": 10, "time_out": 20, "include_max_humidity": "maximum_humidity_enabled", "max_humidity": 100, "include_fan_speed": "fan_speed_disabled", "time_delay_low_speed": 5, "include_winter_mode": "winter_mode_disabled", "month_winter_mode": [], "winter_rising_humidity": 1, "winter_falling_humidity": -1, "winter_time_delay": 10, "winter_time_out": 20, "winter_include_max_humidity": "maximum_humidity_disabled", "winter_max_humidity": 100, "winter_include_fan_speed": "fan_speed_disabled", "winter_time_delay_low_speed": 5, "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "light_time_delay": 10, "include_light_control": [], "light_brightness": 100, "brightness_value": false, "light_colour_temperature": 5000, "temperature_value": [], "light_transition_on": 1, "light_transition_off": 1, "transition_on_value": false, "transition_off_value": false, "include_manual_fan_switch": "disable_manual_fan_switch", "manual_fan_switch": [], "manual_fan_switch_time_delay": 10, "include_automation_link": "disable_automation_link", "automation_link": [], "automation_link_time_delay": 10, "include_bypass": "bypass_disabled", "by_pass": [], "bypass_options": [], "include_bypass_auto_off": "bypass_auto_off_disabled", "bypass_auto_off_delay": 60, "light_entities": [] } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-13T14:14:42.136896+00:00", "result": { "result": true } } ], "condition/0/conditions/0": [ { "path": "condition/0/conditions/0", "timestamp": "2026-01-13T14:14:42.136911+00:00", "result": { "result": false } } ], "condition/0/conditions/0/conditions/0": [ { "path": "condition/0/conditions/0/conditions/0", "timestamp": "2026-01-13T14:14:42.136923+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/1": [ { "path": "condition/0/conditions/1", "timestamp": "2026-01-13T14:14:42.136979+00:00", "result": { "result": false } } ], "condition/0/conditions/1/conditions/0": [ { "path": "condition/0/conditions/1/conditions/0", "timestamp": "2026-01-13T14:14:42.136990+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/2": [ { "path": "condition/0/conditions/2", "timestamp": "2026-01-13T14:14:42.137040+00:00", "result": { "result": false } } ], "condition/0/conditions/2/conditions/0": [ { "path": "condition/0/conditions/2/conditions/0", "timestamp": "2026-01-13T14:14:42.137051+00:00", "error": "In 'template' condition: UndefinedError: 'dict object' has no attribute 'entity_id'" } ], "condition/0/conditions/2/conditions/1": [ { "path": "condition/0/conditions/2/conditions/1", "timestamp": "2026-01-13T14:14:42.137204+00:00", "result": { "result": false } } ], "condition/0/conditions/3": [ { "path": "condition/0/conditions/3", "timestamp": "2026-01-13T14:14:42.137225+00:00", "result": { "result": false } } ], "condition/0/conditions/3/conditions/0": [ { "path": "condition/0/conditions/3/conditions/0", "timestamp": "2026-01-13T14:14:42.137235+00:00", "result": { "result": false } } ], "condition/0/conditions/4": [ { "path": "condition/0/conditions/4", "timestamp": "2026-01-13T14:14:42.137251+00:00", "result": { "result": false } } ], "condition/0/conditions/4/conditions/0": [ { "path": "condition/0/conditions/4/conditions/0", "timestamp": "2026-01-13T14:14:42.137260+00:00", "result": { "result": false } } ], "condition/0/conditions/5": [ { "path": "condition/0/conditions/5", "timestamp": "2026-01-13T14:14:42.137273+00:00", "result": { "result": false } } ], "condition/0/conditions/5/conditions/0": [ { "path": "condition/0/conditions/5/conditions/0", "timestamp": "2026-01-13T14:14:42.137283+00:00", "result": { "result": false } } ], "condition/0/conditions/6": [ { "path": "condition/0/conditions/6", "timestamp": "2026-01-13T14:14:42.137296+00:00", "result": { "result": false } } ], "condition/0/conditions/6/conditions/0": [ { "path": "condition/0/conditions/6/conditions/0", "timestamp": "2026-01-13T14:14:42.137305+00:00", "result": { "result": false } } ], "condition/0/conditions/7": [ { "path": "condition/0/conditions/7", "timestamp": "2026-01-13T14:14:42.137318+00:00", "result": { "result": false } } ], "condition/0/conditions/7/conditions/0": [ { "path": "condition/0/conditions/7/conditions/0", "timestamp": "2026-01-13T14:14:42.137327+00:00", "result": { "result": false } } ], "condition/0/conditions/8": [ { "path": "condition/0/conditions/8", "timestamp": "2026-01-13T14:14:42.137341+00:00", "result": { "result": false } } ], "condition/0/conditions/8/conditions/0": [ { "path": "condition/0/conditions/8/conditions/0", "timestamp": "2026-01-13T14:14:42.137350+00:00", "result": { "result": false } } ], "condition/0/conditions/9": [ { "path": "condition/0/conditions/9", "timestamp": "2026-01-13T14:14:42.137363+00:00", "result": { "result": true } } ], "condition/0/conditions/9/conditions/0": [ { "path": "condition/0/conditions/9/conditions/0", "timestamp": "2026-01-13T14:14:42.137372+00:00", "result": { "result": true, "entities": [] } } ], "condition/0/conditions/9/conditions/1": [ { "path": "condition/0/conditions/9/conditions/1", "timestamp": "2026-01-13T14:14:42.137429+00:00", "result": { "result": true } } ], "condition/1": [ { "path": "condition/1", "timestamp": "2026-01-13T14:14:42.137447+00:00", "result": { "result": true } } ], "condition/1/conditions/0": [ { "path": "condition/1/conditions/0", "timestamp": "2026-01-13T14:14:42.137457+00:00", "result": { "result": true, "entities": [] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-13T14:14:42.137682+00:00", "changed_variables": { "context": { "id": "01KEVVAY6RRRW27K03A92SHRN2", "parent_id": "01KEVVAY6NJAA73YNYESNQVF8K", "user_id": null }, "wait": { "remaining": 1200.0, "completed": false, "trigger": null } }, "result": { "choice": "default" } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-13T14:14:42.137752+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-13T14:14:42.137847+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0/conditions/0", "timestamp": "2026-01-13T14:14:42.137926+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0/conditions/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0/conditions/0/conditions/0", "timestamp": "2026-01-13T14:14:42.138000+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0/conditions/1": [ { "path": "action/0/choose/0/conditions/0/conditions/1", "timestamp": "2026-01-13T14:14:42.139182+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0/conditions/1/conditions/0": [ { "path": "action/0/choose/0/conditions/0/conditions/1/conditions/0", "timestamp": "2026-01-13T14:14:42.139417+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/0": [ { "path": "action/0/default/0", "timestamp": "2026-01-13T14:14:42.139916+00:00", "result": { "result": true } } ], "action/0/default/1": [ { "path": "action/0/default/1", "timestamp": "2026-01-13T14:14:42.140117+00:00" } ], "action/0/default/1/choose/0": [ { "path": "action/0/default/1/choose/0", "timestamp": "2026-01-13T14:14:42.140228+00:00", "result": { "result": false } } ], "action/0/default/1/choose/0/conditions/0": [ { "path": "action/0/default/1/choose/0/conditions/0", "timestamp": "2026-01-13T14:14:42.140432+00:00", "result": { "result": false } } ], "action/0/default/1/choose/1": [ { "path": "action/0/default/1/choose/1", "timestamp": "2026-01-13T14:14:42.140652+00:00", "result": { "result": false } } ], "action/0/default/1/choose/1/conditions/0": [ { "path": "action/0/default/1/choose/1/conditions/0", "timestamp": "2026-01-13T14:14:42.140862+00:00", "result": { "result": false } } ], "action/0/default/2": [ { "path": "action/0/default/2", "timestamp": "2026-01-13T14:14:42.141003+00:00" } ], "action/0/default/2/choose/0": [ { "path": "action/0/default/2/choose/0", "timestamp": "2026-01-13T14:14:42.141049+00:00", "result": { "result": false } } ], "action/0/default/2/choose/0/conditions/0": [ { "path": "action/0/default/2/choose/0/conditions/0", "timestamp": "2026-01-13T14:14:42.141128+00:00", "result": { "result": false } } ], "action/0/default/3": [ { "path": "action/0/default/3", "timestamp": "2026-01-13T14:14:42.141260+00:00" } ], "action/0/default/3/choose/0": [ { "path": "action/0/default/3/choose/0", "timestamp": "2026-01-13T14:14:42.141305+00:00", "result": { "result": false } } ], "action/0/default/3/choose/0/conditions/0": [ { "path": "action/0/default/3/choose/0/conditions/0", "timestamp": "2026-01-13T14:14:42.141383+00:00", "result": { "result": false } } ], "action/0/default/3/choose/1": [ { "path": "action/0/default/3/choose/1", "timestamp": "2026-01-13T14:14:42.141470+00:00", "result": { "result": false } } ], "action/0/default/3/choose/1/conditions/0": [ { "path": "action/0/default/3/choose/1/conditions/0", "timestamp": "2026-01-13T14:14:42.141547+00:00", "result": { "result": false } } ], "action/0/default/4": [ { "path": "action/0/default/4", "timestamp": "2026-01-13T14:14:42.141665+00:00" } ], "action/0/default/4/choose/0": [ { "path": "action/0/default/4/choose/0", "timestamp": "2026-01-13T14:14:42.141707+00:00", "result": { "result": false } } ], "action/0/default/4/choose/0/conditions/0": [ { "path": "action/0/default/4/choose/0/conditions/0", "timestamp": "2026-01-13T14:14:42.141785+00:00", "result": { "result": false } } ], "action/0/default/5": [ { "path": "action/0/default/5", "timestamp": "2026-01-13T14:14:42.141983+00:00" } ], "action/0/default/5/choose/0": [ { "path": "action/0/default/5/choose/0", "timestamp": "2026-01-13T14:14:42.142030+00:00", "result": { "result": false } } ], "action/0/default/5/choose/0/conditions/0": [ { "path": "action/0/default/5/choose/0/conditions/0", "timestamp": "2026-01-13T14:14:42.142109+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/6": [ { "path": "action/0/default/6", "timestamp": "2026-01-13T14:14:42.142328+00:00" } ], "action/0/default/6/choose/0": [ { "path": "action/0/default/6/choose/0", "timestamp": "2026-01-13T14:14:42.142374+00:00", "result": { "result": false } } ], "action/0/default/6/choose/0/conditions/0": [ { "path": "action/0/default/6/choose/0/conditions/0", "timestamp": "2026-01-13T14:14:42.142454+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/7": [ { "path": "action/0/default/7", "timestamp": "2026-01-13T14:14:42.142649+00:00" } ], "action/0/default/7/choose/0": [ { "path": "action/0/default/7/choose/0", "timestamp": "2026-01-13T14:14:42.142694+00:00", "result": { "result": false } } ], "action/0/default/7/choose/0/conditions/0": [ { "path": "action/0/default/7/choose/0/conditions/0", "timestamp": "2026-01-13T14:14:42.142773+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/8": [ { "path": "action/0/default/8", "timestamp": "2026-01-13T14:14:42.143014+00:00" } ], "action/0/default/8/choose/0": [ { "path": "action/0/default/8/choose/0", "timestamp": "2026-01-13T14:14:42.143060+00:00", "result": { "result": false } } ], "action/0/default/8/choose/0/conditions/0": [ { "path": "action/0/default/8/choose/0/conditions/0", "timestamp": "2026-01-13T14:14:42.143139+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/9": [ { "path": "action/0/default/9", "timestamp": "2026-01-13T14:14:42.143345+00:00", "result": { "params": { "domain": "homeassistant", "service": "turn_on", "service_data": {}, "target": { "device_id": [ "6e29c3c314df87528f187dbe4eb847d4" ] } }, "running_script": false } } ], "action/0/default/10": [ { "path": "action/0/default/10", "timestamp": "2026-01-13T14:14:42.212437+00:00" } ], "action/0/default/10/choose/0": [ { "path": "action/0/default/10/choose/0", "timestamp": "2026-01-13T14:14:42.212511+00:00", "result": { "result": false } } ], "action/0/default/10/choose/0/conditions/0": [ { "path": "action/0/default/10/choose/0/conditions/0", "timestamp": "2026-01-13T14:14:42.212601+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/11": [ { "path": "action/0/default/11", "timestamp": "2026-01-13T14:14:42.212890+00:00" } ], "action/0/default/11/choose/0": [ { "path": "action/0/default/11/choose/0", "timestamp": "2026-01-13T14:14:42.212941+00:00", "result": { "result": false } } ], "action/0/default/11/choose/0/conditions/0": [ { "path": "action/0/default/11/choose/0/conditions/0", "timestamp": "2026-01-13T14:14:42.213022+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/12": [ { "path": "action/0/default/12", "timestamp": "2026-01-13T14:14:42.213267+00:00" } ], "action/0/default/12/choose/0": [ { "path": "action/0/default/12/choose/0", "timestamp": "2026-01-13T14:14:42.213314+00:00", "result": { "result": false } } ], "action/0/default/12/choose/0/conditions/0": [ { "path": "action/0/default/12/choose/0/conditions/0", "timestamp": "2026-01-13T14:14:42.213411+00:00", "result": { "result": false } } ], "action/0/default/13": [ { "path": "action/0/default/13", "timestamp": "2026-01-13T14:14:42.213625+00:00", "changed_variables": { "wait": { "remaining": 1200.0, "completed": false, "trigger": null } }, "result": { "result": false, "state": 1.01, "wanted_state_below": -1.0 } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "trigger": "sensor.badkamer_luchtvochtigheid", "bathroom_humidity_sensor": [], "include_manual_trigger": "disable_manual_trigger", "manual_trigger": [], "manual_trigger_default_time_delay": 15, "manual_trigger_winter_time_delay": 15, "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "fan_speed_low": [], "fan_speed_off": [], "rising_humidity": 1, "falling_humidity": -1, "time_delay": 10, "time_out": 20, "include_max_humidity": "maximum_humidity_enabled", "max_humidity": 100, "include_fan_speed": "fan_speed_disabled", "time_delay_low_speed": 5, "include_winter_mode": "winter_mode_disabled", "month_winter_mode": [], "winter_rising_humidity": 1, "winter_falling_humidity": -1, "winter_time_delay": 10, "winter_time_out": 20, "winter_include_max_humidity": "maximum_humidity_disabled", "winter_max_humidity": 100, "winter_include_fan_speed": "fan_speed_disabled", "winter_time_delay_low_speed": 5, "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "light_time_delay": 10, "include_light_control": [], "light_brightness": 100, "brightness_value": "{{ iif ('use_brightness' in include_light_control , light_brightness, ) }}", "light_colour_temperature": 5000, "temperature_value": "{{ iif ('use_colour_temperature' in include_light_control , light_colour_temperature, [] ) }}", "light_transition_on": 1, "light_transition_off": 1, "transition_on_value": "{{ iif ('use_transition' in include_light_control, light_transition_on, ) }}", "transition_off_value": "{{ iif ('use_transition' in include_light_control, light_transition_off, ) }}", "include_manual_fan_switch": "disable_manual_fan_switch", "manual_fan_switch": [], "manual_fan_switch_time_delay": 10, "include_automation_link": "disable_automation_link", "automation_link": [], "automation_link_time_delay": 10, "include_bypass": "bypass_disabled", "by_pass": [], "bypass_options": [], "include_bypass_auto_off": "bypass_auto_off_disabled", "bypass_auto_off_delay": 60, "light_entities": "{% set a = light_switch and light_switch.entity_id %} {% if a %}\n {{ expand(a) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}" }, "triggers": [ { "trigger": "numeric_state", "id": "t0", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" }, { "trigger": "numeric_state", "id": "t1", "entity_id": [], "above": 100, "below": "100" }, { "trigger": "homeassistant", "id": "t2", "event": "start" }, { "trigger": "numeric_state", "id": "t3", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" }, { "trigger": "numeric_state", "id": "t4", "entity_id": [], "above": 100, "below": "100" }, { "trigger": "state", "id": "t5", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t6", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "state", "id": "t7", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t8", "entity_id": [], "from": "off", "to": "on" } ], "actions": [ { "choose": [ { "alias": "For winter mode when enabled and within the set winter months", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t0", "t1" ] } ] }, { "condition": "and", "conditions": [ "{{ include_winter_mode == 'winter_mode_enabled' }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "trigger", "id": [ "t2", "t5", "t6", "t7", "t8" ] } ] } ] } ], "sequence": [ { "choose": [ { "alias": "By-pass is turned on & check by-pass option - turn fan off", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned on & check by-pass option - keep the current fan state", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_stop' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & preform the correct action", "conditions": [ { "condition": "trigger", "id": "t6" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check by-pass options - turn fan off is enabled", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is below falling humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is below falling", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is above winter rising humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is above rising", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'off') | list | count > 0)) }}", { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "We need something here to continue", "delay": { "milliseconds": 10 } } ] } ], "default": [ { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Preform the manual fan switch option", "conditions": [ { "condition": "trigger", "id": "t7" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] }, { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the run on timer is switch is on", "conditions": [ "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Preform the manual trigger option", "conditions": [ { "condition": "trigger", "id": "t8" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check manual trigger with safeguard is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Wait until the time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait until the low speed time delay passes", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled and the lights are ON", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the light time delay has passes", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the automation link time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] }, { "choose": [ { "alias": "Safeguard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t2" } ], "sequence": [ { "choose": [ { "alias": "Check manual trigger with safeguard is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "choose": [ { "alias": "Check manual fan switch is enabled and manual switch is ON", "conditions": [ { "alias": "Check if the humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "template", "value_template": "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' or include_manual_fan_switch == 'enable_manual_fan_switch' }}" }, "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "choose": [ { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] }, { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the run on timer is switch is on", "conditions": [ "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the winter humidity derivative sensor is below falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the winter humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) }}", "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or (include_lights == 'lights_disabled') }}", "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) or (include_automation_link == 'disable_automation_link') }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - turn fan on", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_turn_on' }}" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] } ] } ], "default": [ { "alias": "Check if the triggers", "condition": "trigger", "id": [ "t2", "t3", "t4", "t5", "t6", "t7", "t8" ] }, { "choose": [ { "alias": "By-pass is turned on & check by-pass option - turn fan off", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned on & check by-pass option - keep the current fan state", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_stop' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & check if the sensor is below falling humidity", "conditions": [ { "condition": "trigger", "id": "t6" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check by-pass options - turn fan off is enabled", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is below falling humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is below falling", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is above rising humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is above rising", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'off') | list | count > 0)) }}", { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "We need something here to continue", "delay": { "milliseconds": 10 } } ] } ], "default": [ { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Preform the manual fan switch option", "conditions": [ { "condition": "trigger", "id": "t7" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] }, { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Preform the manual trigger option", "conditions": [ { "condition": "trigger", "id": "t8" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check manual trigger with safeguard is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Wait until the time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait until the low speed time delay passes", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled and the lights are ON", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the light time delay has passes", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the automation link time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] }, { "choose": [ { "alias": "Safeguard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t2" } ], "sequence": [ { "choose": [ { "alias": "Check manual trigger with safeguard is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "choose": [ { "alias": "Check manual fan switch is enabled and manual switch is ON", "conditions": [ { "alias": "Check if the humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "template", "value_template": "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' or include_manual_fan_switch == 'enable_manual_fan_switch' }}" }, "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "choose": [ { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] }, { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the humidity derivative sensor is below falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) }}", "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or (include_lights == 'lights_disabled') }}", "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) or (include_automation_link == 'disable_automation_link') }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - turn fan on", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_turn_on' }}" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] } ] } ], "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ include_winter_mode == 'winter_mode_enabled' }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "trigger", "id": "t0" } ] }, { "condition": "and", "conditions": [ "{{ (include_winter_mode == 'winter_mode_enabled') and (winter_include_max_humidity == 'maximum_humidity_enabled') }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "trigger", "id": "t1" } ] }, { "condition": "and", "conditions": [ "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "trigger", "id": "t2" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_disabled' in include_winter_mode }}", { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", { "condition": "template", "value_template": "{{ (now().month | string not in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_disabled' in include_winter_mode }}", "{{ 'maximum_humidity_enabled' in include_max_humidity }}", { "condition": "numeric_state", "entity_id": [], "above": 100, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ 'maximum_humidity_enabled' in include_max_humidity }}", { "condition": "template", "value_template": "{{ (now().month | string not in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": [], "above": 100, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ 'maximum_humidity_enabled' in winter_include_max_humidity }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": [], "above": 100, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ (include_winter_mode == 'winter_mode_disabled') or ((include_winter_mode == 'winter_mode_enabled') and not (now().month | string in month_winter_mode )) }}" }, { "condition": "trigger", "id": "t3" } ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ ((include_winter_mode == 'winter_mode_disabled') and (include_max_humidity == 'maximum_humidity_enabled')) or ((include_winter_mode == 'winter_mode_enabled') and (include_max_humidity == 'maximum_humidity_enabled') and not (now().month | string in month_winter_mode )) }}" }, { "condition": "trigger", "id": "t4" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t5" }, "{{ (include_bypass == 'bypass_enabled_turn_on') or (include_bypass == 'bypass_enabled') or (include_bypass == 'bypass_enabled_stop') }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t6" }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ (include_bypass == 'bypass_enabled') or (include_bypass == 'bypass_enabled_stop') or (include_bypass == 'bypass_enabled_turn_on') }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0 ) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') and (expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0)) }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t6" ] }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ 'winter_mode_disabled' in include_winter_mode }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0))}}", { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t6" ] }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "template", "value_template": "{{ (now().month | string not in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t6" ] }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "trigger", "id": [ "t7" ] }, "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}" ] }, { "condition": "and", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "trigger", "id": [ "t8" ] }, "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}" ] } ] }, { "condition": "or", "conditions": [ "{{ include_bypass == 'bypass_disabled' }}", "{{ by_pass == [] }}", "{{ (include_bypass == 'bypass_enabled_turn_on') and (states[by_pass].state == 'off') }}", "{{ (include_bypass == 'bypass_enabled') and (states[by_pass].state == 'off') }}", "{{ (include_bypass == 'bypass_enabled_stop') and (states[by_pass].state == 'off') }}", "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'off') }}", "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') and (trigger.id == 't2') }}", { "condition": "trigger", "id": "t5" } ] } ], "id": "1754461823733", "alias": "Ventilator badkamer [BP]", "description": "" }, "blueprint_inputs": { "id": "1754461823733", "alias": "Ventilator badkamer [BP]", "description": "", "use_blueprint": { "path": "Blackshome/bathroom-humidity-exhaust-fan.yaml", "input": { "trigger": "sensor.badkamer_luchtvochtigheid", "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "include_max_humidity": "maximum_humidity_enabled", "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "include_manual_fan_switch": "disable_manual_fan_switch" } } }, "context": { "id": "01KEVVAY6RRRW27K03A92SHRN2", "parent_id": "01KEVVAY6NJAA73YNYESNQVF8K", "user_id": null } }, "short_dict": { "last_step": "action/0/default/13", "run_id": "2bc298a4a003f7912f03e54e37be1de5", "state": "stopped", "script_execution": "cancelled", "timestamp": { "start": "2026-01-13T14:14:42.136621+00:00", "finish": "2026-01-13T14:20:35.506006+00:00" }, "domain": "automation", "item_id": "1754461823733", "trigger": "numeric state of sensor.badkamer_luchtvochtigheid" } }, { "extended_dict": { "last_step": "condition/0/conditions/17/conditions/0", "run_id": "933c035f6bbc7d09b9b32bfc019e7b73", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-13T14:20:35.501844+00:00", "finish": "2026-01-13T14:20:35.503087+00:00" }, "domain": "automation", "item_id": "1754461823733", "trigger": "numeric state of sensor.badkamer_luchtvochtigheid", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-13T14:20:35.502194+00:00", "changed_variables": { "this": { "entity_id": "automation.ventilator_badkamer_bp", "state": "on", "attributes": { "id": "1754461823733", "last_triggered": "2026-01-13T14:14:42.137553+00:00", "mode": "restart", "current": 1, "friendly_name": "Ventilator badkamer [BP]" }, "last_changed": "2026-01-13T12:10:27.678160+00:00", "last_reported": "2026-01-13T14:14:42.137568+00:00", "last_updated": "2026-01-13T14:14:42.137568+00:00", "context": { "id": "01KEVVAY6RRRW27K03A92SHRN2", "parent_id": "01KEVVAY6NJAA73YNYESNQVF8K", "user_id": null } }, "trigger": { "id": "t0", "idx": "0", "alias": null, "platform": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": 100.0, "above": 1.0, "from_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "-0.00", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:20:30.421976+00:00", "last_reported": "2026-01-13T14:20:30.421976+00:00", "last_updated": "2026-01-13T14:20:30.421976+00:00", "context": { "id": "01KEVVNJANK67VCC7M07DQ3H7D", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "1.17", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:20:35.498646+00:00", "last_reported": "2026-01-13T14:20:35.498646+00:00", "last_updated": "2026-01-13T14:20:35.498646+00:00", "context": { "id": "01KEVVNQ9AEMFC1EY3PBDM6RA0", "parent_id": null, "user_id": null } }, "for": null, "description": "numeric state of sensor.badkamer_luchtvochtigheid" }, "bathroom_humidity_sensor": [], "include_manual_trigger": "disable_manual_trigger", "manual_trigger": [], "manual_trigger_default_time_delay": 15, "manual_trigger_winter_time_delay": 15, "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "fan_speed_low": [], "fan_speed_off": [], "rising_humidity": 1, "falling_humidity": -1, "time_delay": 10, "time_out": 20, "include_max_humidity": "maximum_humidity_enabled", "max_humidity": 100, "include_fan_speed": "fan_speed_disabled", "time_delay_low_speed": 5, "include_winter_mode": "winter_mode_disabled", "month_winter_mode": [], "winter_rising_humidity": 1, "winter_falling_humidity": -1, "winter_time_delay": 10, "winter_time_out": 20, "winter_include_max_humidity": "maximum_humidity_disabled", "winter_max_humidity": 100, "winter_include_fan_speed": "fan_speed_disabled", "winter_time_delay_low_speed": 5, "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "light_time_delay": 10, "include_light_control": [], "light_brightness": 100, "brightness_value": false, "light_colour_temperature": 5000, "temperature_value": [], "light_transition_on": 1, "light_transition_off": 1, "transition_on_value": false, "transition_off_value": false, "include_manual_fan_switch": "disable_manual_fan_switch", "manual_fan_switch": [], "manual_fan_switch_time_delay": 10, "include_automation_link": "disable_automation_link", "automation_link": [], "automation_link_time_delay": 10, "include_bypass": "bypass_disabled", "by_pass": [], "bypass_options": [], "include_bypass_auto_off": "bypass_auto_off_disabled", "bypass_auto_off_delay": 60, "light_entities": [] } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-13T14:20:35.502217+00:00", "result": { "result": false } } ], "condition/0/conditions/0": [ { "path": "condition/0/conditions/0", "timestamp": "2026-01-13T14:20:35.502234+00:00", "result": { "result": false } } ], "condition/0/conditions/0/conditions/0": [ { "path": "condition/0/conditions/0/conditions/0", "timestamp": "2026-01-13T14:20:35.502247+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/1": [ { "path": "condition/0/conditions/1", "timestamp": "2026-01-13T14:20:35.502311+00:00", "result": { "result": false } } ], "condition/0/conditions/1/conditions/0": [ { "path": "condition/0/conditions/1/conditions/0", "timestamp": "2026-01-13T14:20:35.502323+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/2": [ { "path": "condition/0/conditions/2", "timestamp": "2026-01-13T14:20:35.502376+00:00", "result": { "result": false } } ], "condition/0/conditions/2/conditions/0": [ { "path": "condition/0/conditions/2/conditions/0", "timestamp": "2026-01-13T14:20:35.502388+00:00", "error": "In 'template' condition: UndefinedError: 'dict object' has no attribute 'entity_id'" } ], "condition/0/conditions/2/conditions/1": [ { "path": "condition/0/conditions/2/conditions/1", "timestamp": "2026-01-13T14:20:35.502575+00:00", "result": { "result": false } } ], "condition/0/conditions/3": [ { "path": "condition/0/conditions/3", "timestamp": "2026-01-13T14:20:35.502598+00:00", "result": { "result": false } } ], "condition/0/conditions/3/conditions/0": [ { "path": "condition/0/conditions/3/conditions/0", "timestamp": "2026-01-13T14:20:35.502609+00:00", "result": { "result": false } } ], "condition/0/conditions/4": [ { "path": "condition/0/conditions/4", "timestamp": "2026-01-13T14:20:35.502625+00:00", "result": { "result": false } } ], "condition/0/conditions/4/conditions/0": [ { "path": "condition/0/conditions/4/conditions/0", "timestamp": "2026-01-13T14:20:35.502635+00:00", "result": { "result": false } } ], "condition/0/conditions/5": [ { "path": "condition/0/conditions/5", "timestamp": "2026-01-13T14:20:35.502651+00:00", "result": { "result": false } } ], "condition/0/conditions/5/conditions/0": [ { "path": "condition/0/conditions/5/conditions/0", "timestamp": "2026-01-13T14:20:35.502660+00:00", "result": { "result": false } } ], "condition/0/conditions/6": [ { "path": "condition/0/conditions/6", "timestamp": "2026-01-13T14:20:35.502675+00:00", "result": { "result": false } } ], "condition/0/conditions/6/conditions/0": [ { "path": "condition/0/conditions/6/conditions/0", "timestamp": "2026-01-13T14:20:35.502684+00:00", "result": { "result": false } } ], "condition/0/conditions/7": [ { "path": "condition/0/conditions/7", "timestamp": "2026-01-13T14:20:35.502698+00:00", "result": { "result": false } } ], "condition/0/conditions/7/conditions/0": [ { "path": "condition/0/conditions/7/conditions/0", "timestamp": "2026-01-13T14:20:35.502708+00:00", "result": { "result": false } } ], "condition/0/conditions/8": [ { "path": "condition/0/conditions/8", "timestamp": "2026-01-13T14:20:35.502722+00:00", "result": { "result": false } } ], "condition/0/conditions/8/conditions/0": [ { "path": "condition/0/conditions/8/conditions/0", "timestamp": "2026-01-13T14:20:35.502731+00:00", "result": { "result": false } } ], "condition/0/conditions/9": [ { "path": "condition/0/conditions/9", "timestamp": "2026-01-13T14:20:35.502745+00:00", "result": { "result": false } } ], "condition/0/conditions/9/conditions/0": [ { "path": "condition/0/conditions/9/conditions/0", "timestamp": "2026-01-13T14:20:35.502755+00:00", "result": { "result": true, "entities": [] } } ], "condition/0/conditions/9/conditions/1": [ { "path": "condition/0/conditions/9/conditions/1", "timestamp": "2026-01-13T14:20:35.502813+00:00", "result": { "result": false } } ], "condition/0/conditions/10": [ { "path": "condition/0/conditions/10", "timestamp": "2026-01-13T14:20:35.502829+00:00", "result": { "result": false } } ], "condition/0/conditions/10/conditions/0": [ { "path": "condition/0/conditions/10/conditions/0", "timestamp": "2026-01-13T14:20:35.502839+00:00", "result": { "result": true, "entities": [] } } ], "condition/0/conditions/10/conditions/1": [ { "path": "condition/0/conditions/10/conditions/1", "timestamp": "2026-01-13T14:20:35.502901+00:00", "result": { "result": false } } ], "condition/0/conditions/11": [ { "path": "condition/0/conditions/11", "timestamp": "2026-01-13T14:20:35.502918+00:00", "result": { "result": false } } ], "condition/0/conditions/11/conditions/0": [ { "path": "condition/0/conditions/11/conditions/0", "timestamp": "2026-01-13T14:20:35.502928+00:00", "result": { "result": false } } ], "condition/0/conditions/12": [ { "path": "condition/0/conditions/12", "timestamp": "2026-01-13T14:20:35.502942+00:00", "result": { "result": false } } ], "condition/0/conditions/12/conditions/0": [ { "path": "condition/0/conditions/12/conditions/0", "timestamp": "2026-01-13T14:20:35.502951+00:00", "result": { "result": false } } ], "condition/0/conditions/13": [ { "path": "condition/0/conditions/13", "timestamp": "2026-01-13T14:20:35.502965+00:00", "result": { "result": false } } ], "condition/0/conditions/13/conditions/0": [ { "path": "condition/0/conditions/13/conditions/0", "timestamp": "2026-01-13T14:20:35.502975+00:00", "result": { "result": false } } ], "condition/0/conditions/14": [ { "path": "condition/0/conditions/14", "timestamp": "2026-01-13T14:20:35.502989+00:00", "result": { "result": false } } ], "condition/0/conditions/14/conditions/0": [ { "path": "condition/0/conditions/14/conditions/0", "timestamp": "2026-01-13T14:20:35.502999+00:00", "result": { "result": false } } ], "condition/0/conditions/15": [ { "path": "condition/0/conditions/15", "timestamp": "2026-01-13T14:20:35.503014+00:00", "result": { "result": false } } ], "condition/0/conditions/15/conditions/0": [ { "path": "condition/0/conditions/15/conditions/0", "timestamp": "2026-01-13T14:20:35.503023+00:00", "result": { "result": false } } ], "condition/0/conditions/16": [ { "path": "condition/0/conditions/16", "timestamp": "2026-01-13T14:20:35.503036+00:00", "result": { "result": false } } ], "condition/0/conditions/16/conditions/0": [ { "path": "condition/0/conditions/16/conditions/0", "timestamp": "2026-01-13T14:20:35.503045+00:00", "result": { "result": false } } ], "condition/0/conditions/17": [ { "path": "condition/0/conditions/17", "timestamp": "2026-01-13T14:20:35.503060+00:00", "result": { "result": false } } ], "condition/0/conditions/17/conditions/0": [ { "path": "condition/0/conditions/17/conditions/0", "timestamp": "2026-01-13T14:20:35.503069+00:00", "result": { "result": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "trigger": "sensor.badkamer_luchtvochtigheid", "bathroom_humidity_sensor": [], "include_manual_trigger": "disable_manual_trigger", "manual_trigger": [], "manual_trigger_default_time_delay": 15, "manual_trigger_winter_time_delay": 15, "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "fan_speed_low": [], "fan_speed_off": [], "rising_humidity": 1, "falling_humidity": -1, "time_delay": 10, "time_out": 20, "include_max_humidity": "maximum_humidity_enabled", "max_humidity": 100, "include_fan_speed": "fan_speed_disabled", "time_delay_low_speed": 5, "include_winter_mode": "winter_mode_disabled", "month_winter_mode": [], "winter_rising_humidity": 1, "winter_falling_humidity": -1, "winter_time_delay": 10, "winter_time_out": 20, "winter_include_max_humidity": "maximum_humidity_disabled", "winter_max_humidity": 100, "winter_include_fan_speed": "fan_speed_disabled", "winter_time_delay_low_speed": 5, "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "light_time_delay": 10, "include_light_control": [], "light_brightness": 100, "brightness_value": "{{ iif ('use_brightness' in include_light_control , light_brightness, ) }}", "light_colour_temperature": 5000, "temperature_value": "{{ iif ('use_colour_temperature' in include_light_control , light_colour_temperature, [] ) }}", "light_transition_on": 1, "light_transition_off": 1, "transition_on_value": "{{ iif ('use_transition' in include_light_control, light_transition_on, ) }}", "transition_off_value": "{{ iif ('use_transition' in include_light_control, light_transition_off, ) }}", "include_manual_fan_switch": "disable_manual_fan_switch", "manual_fan_switch": [], "manual_fan_switch_time_delay": 10, "include_automation_link": "disable_automation_link", "automation_link": [], "automation_link_time_delay": 10, "include_bypass": "bypass_disabled", "by_pass": [], "bypass_options": [], "include_bypass_auto_off": "bypass_auto_off_disabled", "bypass_auto_off_delay": 60, "light_entities": "{% set a = light_switch and light_switch.entity_id %} {% if a %}\n {{ expand(a) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}" }, "triggers": [ { "trigger": "numeric_state", "id": "t0", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" }, { "trigger": "numeric_state", "id": "t1", "entity_id": [], "above": 100, "below": "100" }, { "trigger": "homeassistant", "id": "t2", "event": "start" }, { "trigger": "numeric_state", "id": "t3", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" }, { "trigger": "numeric_state", "id": "t4", "entity_id": [], "above": 100, "below": "100" }, { "trigger": "state", "id": "t5", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t6", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "state", "id": "t7", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t8", "entity_id": [], "from": "off", "to": "on" } ], "actions": [ { "choose": [ { "alias": "For winter mode when enabled and within the set winter months", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t0", "t1" ] } ] }, { "condition": "and", "conditions": [ "{{ include_winter_mode == 'winter_mode_enabled' }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "trigger", "id": [ "t2", "t5", "t6", "t7", "t8" ] } ] } ] } ], "sequence": [ { "choose": [ { "alias": "By-pass is turned on & check by-pass option - turn fan off", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned on & check by-pass option - keep the current fan state", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_stop' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & preform the correct action", "conditions": [ { "condition": "trigger", "id": "t6" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check by-pass options - turn fan off is enabled", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is below falling humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is below falling", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is above winter rising humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is above rising", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'off') | list | count > 0)) }}", { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "We need something here to continue", "delay": { "milliseconds": 10 } } ] } ], "default": [ { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Preform the manual fan switch option", "conditions": [ { "condition": "trigger", "id": "t7" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] }, { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the run on timer is switch is on", "conditions": [ "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Preform the manual trigger option", "conditions": [ { "condition": "trigger", "id": "t8" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check manual trigger with safeguard is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Wait until the time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait until the low speed time delay passes", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled and the lights are ON", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the light time delay has passes", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the automation link time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] }, { "choose": [ { "alias": "Safeguard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t2" } ], "sequence": [ { "choose": [ { "alias": "Check manual trigger with safeguard is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "choose": [ { "alias": "Check manual fan switch is enabled and manual switch is ON", "conditions": [ { "alias": "Check if the humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "template", "value_template": "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' or include_manual_fan_switch == 'enable_manual_fan_switch' }}" }, "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "choose": [ { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] }, { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the run on timer is switch is on", "conditions": [ "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the winter humidity derivative sensor is below falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the winter humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) }}", "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or (include_lights == 'lights_disabled') }}", "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) or (include_automation_link == 'disable_automation_link') }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - turn fan on", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_turn_on' }}" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] } ] } ], "default": [ { "alias": "Check if the triggers", "condition": "trigger", "id": [ "t2", "t3", "t4", "t5", "t6", "t7", "t8" ] }, { "choose": [ { "alias": "By-pass is turned on & check by-pass option - turn fan off", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned on & check by-pass option - keep the current fan state", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_stop' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & check if the sensor is below falling humidity", "conditions": [ { "condition": "trigger", "id": "t6" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check by-pass options - turn fan off is enabled", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is below falling humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is below falling", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is above rising humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is above rising", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'off') | list | count > 0)) }}", { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "We need something here to continue", "delay": { "milliseconds": 10 } } ] } ], "default": [ { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Preform the manual fan switch option", "conditions": [ { "condition": "trigger", "id": "t7" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] }, { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Preform the manual trigger option", "conditions": [ { "condition": "trigger", "id": "t8" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check manual trigger with safeguard is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Wait until the time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait until the low speed time delay passes", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled and the lights are ON", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the light time delay has passes", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the automation link time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] }, { "choose": [ { "alias": "Safeguard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t2" } ], "sequence": [ { "choose": [ { "alias": "Check manual trigger with safeguard is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "choose": [ { "alias": "Check manual fan switch is enabled and manual switch is ON", "conditions": [ { "alias": "Check if the humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "template", "value_template": "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' or include_manual_fan_switch == 'enable_manual_fan_switch' }}" }, "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "choose": [ { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] }, { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the humidity derivative sensor is below falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) }}", "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or (include_lights == 'lights_disabled') }}", "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) or (include_automation_link == 'disable_automation_link') }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - turn fan on", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_turn_on' }}" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] } ] } ], "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ include_winter_mode == 'winter_mode_enabled' }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "trigger", "id": "t0" } ] }, { "condition": "and", "conditions": [ "{{ (include_winter_mode == 'winter_mode_enabled') and (winter_include_max_humidity == 'maximum_humidity_enabled') }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "trigger", "id": "t1" } ] }, { "condition": "and", "conditions": [ "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "trigger", "id": "t2" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_disabled' in include_winter_mode }}", { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", { "condition": "template", "value_template": "{{ (now().month | string not in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_disabled' in include_winter_mode }}", "{{ 'maximum_humidity_enabled' in include_max_humidity }}", { "condition": "numeric_state", "entity_id": [], "above": 100, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ 'maximum_humidity_enabled' in include_max_humidity }}", { "condition": "template", "value_template": "{{ (now().month | string not in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": [], "above": 100, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ 'maximum_humidity_enabled' in winter_include_max_humidity }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": [], "above": 100, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ (include_winter_mode == 'winter_mode_disabled') or ((include_winter_mode == 'winter_mode_enabled') and not (now().month | string in month_winter_mode )) }}" }, { "condition": "trigger", "id": "t3" } ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ ((include_winter_mode == 'winter_mode_disabled') and (include_max_humidity == 'maximum_humidity_enabled')) or ((include_winter_mode == 'winter_mode_enabled') and (include_max_humidity == 'maximum_humidity_enabled') and not (now().month | string in month_winter_mode )) }}" }, { "condition": "trigger", "id": "t4" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t5" }, "{{ (include_bypass == 'bypass_enabled_turn_on') or (include_bypass == 'bypass_enabled') or (include_bypass == 'bypass_enabled_stop') }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t6" }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ (include_bypass == 'bypass_enabled') or (include_bypass == 'bypass_enabled_stop') or (include_bypass == 'bypass_enabled_turn_on') }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0 ) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') and (expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0)) }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t6" ] }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ 'winter_mode_disabled' in include_winter_mode }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0))}}", { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t6" ] }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "template", "value_template": "{{ (now().month | string not in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t6" ] }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "trigger", "id": [ "t7" ] }, "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}" ] }, { "condition": "and", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "trigger", "id": [ "t8" ] }, "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}" ] } ] }, { "condition": "or", "conditions": [ "{{ include_bypass == 'bypass_disabled' }}", "{{ by_pass == [] }}", "{{ (include_bypass == 'bypass_enabled_turn_on') and (states[by_pass].state == 'off') }}", "{{ (include_bypass == 'bypass_enabled') and (states[by_pass].state == 'off') }}", "{{ (include_bypass == 'bypass_enabled_stop') and (states[by_pass].state == 'off') }}", "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'off') }}", "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') and (trigger.id == 't2') }}", { "condition": "trigger", "id": "t5" } ] } ], "id": "1754461823733", "alias": "Ventilator badkamer [BP]", "description": "" }, "blueprint_inputs": { "id": "1754461823733", "alias": "Ventilator badkamer [BP]", "description": "", "use_blueprint": { "path": "Blackshome/bathroom-humidity-exhaust-fan.yaml", "input": { "trigger": "sensor.badkamer_luchtvochtigheid", "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "include_max_humidity": "maximum_humidity_enabled", "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "include_manual_fan_switch": "disable_manual_fan_switch" } } }, "context": { "id": "01KEVVNQ9D5WY922BWR0QXXMZK", "parent_id": "01KEVVNQ9AEMFC1EY3PBDM6RA0", "user_id": null } }, "short_dict": { "last_step": "condition/0/conditions/17/conditions/0", "run_id": "933c035f6bbc7d09b9b32bfc019e7b73", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-13T14:20:35.501844+00:00", "finish": "2026-01-13T14:20:35.503087+00:00" }, "domain": "automation", "item_id": "1754461823733", "trigger": "numeric state of sensor.badkamer_luchtvochtigheid" } }, { "extended_dict": { "last_step": "action/0/default/14/parallel/0/sequence/2/choose/1/conditions/0", "run_id": "f0d8accf888fbf559678e784dec55eb4", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T14:20:35.503122+00:00", "finish": "2026-01-13T14:33:42.272619+00:00" }, "domain": "automation", "item_id": "1754461823733", "trigger": "numeric state of sensor.badkamer_luchtvochtigheid", "trace": { "trigger/3": [ { "path": "trigger/3", "timestamp": "2026-01-13T14:20:35.503428+00:00", "changed_variables": { "this": { "entity_id": "automation.ventilator_badkamer_bp", "state": "on", "attributes": { "id": "1754461823733", "last_triggered": "2026-01-13T14:14:42.137553+00:00", "mode": "restart", "current": 1, "friendly_name": "Ventilator badkamer [BP]" }, "last_changed": "2026-01-13T12:10:27.678160+00:00", "last_reported": "2026-01-13T14:14:42.137568+00:00", "last_updated": "2026-01-13T14:14:42.137568+00:00", "context": { "id": "01KEVVAY6RRRW27K03A92SHRN2", "parent_id": "01KEVVAY6NJAA73YNYESNQVF8K", "user_id": null } }, "trigger": { "id": "t3", "idx": "3", "alias": null, "platform": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": 100.0, "above": 1.0, "from_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "-0.00", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:20:30.421976+00:00", "last_reported": "2026-01-13T14:20:30.421976+00:00", "last_updated": "2026-01-13T14:20:30.421976+00:00", "context": { "id": "01KEVVNJANK67VCC7M07DQ3H7D", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "1.17", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:20:35.498646+00:00", "last_reported": "2026-01-13T14:20:35.498646+00:00", "last_updated": "2026-01-13T14:20:35.498646+00:00", "context": { "id": "01KEVVNQ9AEMFC1EY3PBDM6RA0", "parent_id": null, "user_id": null } }, "for": null, "description": "numeric state of sensor.badkamer_luchtvochtigheid" }, "bathroom_humidity_sensor": [], "include_manual_trigger": "disable_manual_trigger", "manual_trigger": [], "manual_trigger_default_time_delay": 15, "manual_trigger_winter_time_delay": 15, "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "fan_speed_low": [], "fan_speed_off": [], "rising_humidity": 1, "falling_humidity": -1, "time_delay": 10, "time_out": 20, "include_max_humidity": "maximum_humidity_enabled", "max_humidity": 100, "include_fan_speed": "fan_speed_disabled", "time_delay_low_speed": 5, "include_winter_mode": "winter_mode_disabled", "month_winter_mode": [], "winter_rising_humidity": 1, "winter_falling_humidity": -1, "winter_time_delay": 10, "winter_time_out": 20, "winter_include_max_humidity": "maximum_humidity_disabled", "winter_max_humidity": 100, "winter_include_fan_speed": "fan_speed_disabled", "winter_time_delay_low_speed": 5, "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "light_time_delay": 10, "include_light_control": [], "light_brightness": 100, "brightness_value": false, "light_colour_temperature": 5000, "temperature_value": [], "light_transition_on": 1, "light_transition_off": 1, "transition_on_value": false, "transition_off_value": false, "include_manual_fan_switch": "disable_manual_fan_switch", "manual_fan_switch": [], "manual_fan_switch_time_delay": 10, "include_automation_link": "disable_automation_link", "automation_link": [], "automation_link_time_delay": 10, "include_bypass": "bypass_disabled", "by_pass": [], "bypass_options": [], "include_bypass_auto_off": "bypass_auto_off_disabled", "bypass_auto_off_delay": 60, "light_entities": [] } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-13T14:20:35.503445+00:00", "result": { "result": true } } ], "condition/0/conditions/0": [ { "path": "condition/0/conditions/0", "timestamp": "2026-01-13T14:20:35.503460+00:00", "result": { "result": false } } ], "condition/0/conditions/0/conditions/0": [ { "path": "condition/0/conditions/0/conditions/0", "timestamp": "2026-01-13T14:20:35.503472+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/1": [ { "path": "condition/0/conditions/1", "timestamp": "2026-01-13T14:20:35.503528+00:00", "result": { "result": false } } ], "condition/0/conditions/1/conditions/0": [ { "path": "condition/0/conditions/1/conditions/0", "timestamp": "2026-01-13T14:20:35.503539+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/2": [ { "path": "condition/0/conditions/2", "timestamp": "2026-01-13T14:20:35.503588+00:00", "result": { "result": false } } ], "condition/0/conditions/2/conditions/0": [ { "path": "condition/0/conditions/2/conditions/0", "timestamp": "2026-01-13T14:20:35.503599+00:00", "error": "In 'template' condition: UndefinedError: 'dict object' has no attribute 'entity_id'" } ], "condition/0/conditions/2/conditions/1": [ { "path": "condition/0/conditions/2/conditions/1", "timestamp": "2026-01-13T14:20:35.503747+00:00", "result": { "result": false } } ], "condition/0/conditions/3": [ { "path": "condition/0/conditions/3", "timestamp": "2026-01-13T14:20:35.503769+00:00", "result": { "result": false } } ], "condition/0/conditions/3/conditions/0": [ { "path": "condition/0/conditions/3/conditions/0", "timestamp": "2026-01-13T14:20:35.503780+00:00", "result": { "result": false } } ], "condition/0/conditions/4": [ { "path": "condition/0/conditions/4", "timestamp": "2026-01-13T14:20:35.503796+00:00", "result": { "result": false } } ], "condition/0/conditions/4/conditions/0": [ { "path": "condition/0/conditions/4/conditions/0", "timestamp": "2026-01-13T14:20:35.503806+00:00", "result": { "result": false } } ], "condition/0/conditions/5": [ { "path": "condition/0/conditions/5", "timestamp": "2026-01-13T14:20:35.503821+00:00", "result": { "result": false } } ], "condition/0/conditions/5/conditions/0": [ { "path": "condition/0/conditions/5/conditions/0", "timestamp": "2026-01-13T14:20:35.503830+00:00", "result": { "result": false } } ], "condition/0/conditions/6": [ { "path": "condition/0/conditions/6", "timestamp": "2026-01-13T14:20:35.503845+00:00", "result": { "result": false } } ], "condition/0/conditions/6/conditions/0": [ { "path": "condition/0/conditions/6/conditions/0", "timestamp": "2026-01-13T14:20:35.503854+00:00", "result": { "result": false } } ], "condition/0/conditions/7": [ { "path": "condition/0/conditions/7", "timestamp": "2026-01-13T14:20:35.503868+00:00", "result": { "result": false } } ], "condition/0/conditions/7/conditions/0": [ { "path": "condition/0/conditions/7/conditions/0", "timestamp": "2026-01-13T14:20:35.503878+00:00", "result": { "result": false } } ], "condition/0/conditions/8": [ { "path": "condition/0/conditions/8", "timestamp": "2026-01-13T14:20:35.503901+00:00", "result": { "result": false } } ], "condition/0/conditions/8/conditions/0": [ { "path": "condition/0/conditions/8/conditions/0", "timestamp": "2026-01-13T14:20:35.503910+00:00", "result": { "result": false } } ], "condition/0/conditions/9": [ { "path": "condition/0/conditions/9", "timestamp": "2026-01-13T14:20:35.503925+00:00", "result": { "result": true } } ], "condition/0/conditions/9/conditions/0": [ { "path": "condition/0/conditions/9/conditions/0", "timestamp": "2026-01-13T14:20:35.503934+00:00", "result": { "result": true, "entities": [] } } ], "condition/0/conditions/9/conditions/1": [ { "path": "condition/0/conditions/9/conditions/1", "timestamp": "2026-01-13T14:20:35.503992+00:00", "result": { "result": true } } ], "condition/1": [ { "path": "condition/1", "timestamp": "2026-01-13T14:20:35.504011+00:00", "result": { "result": true } } ], "condition/1/conditions/0": [ { "path": "condition/1/conditions/0", "timestamp": "2026-01-13T14:20:35.504021+00:00", "result": { "result": true, "entities": [] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-13T14:20:35.506306+00:00", "changed_variables": { "context": { "id": "01KEVVNQ9FT0EMN4M5YWDFD0E3", "parent_id": "01KEVVNQ9AEMFC1EY3PBDM6RA0", "user_id": null }, "wait": { "remaining": 1013.333077672869, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1.0, "above": null, "from_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "1.41", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:22:41.662629+00:00", "last_reported": "2026-01-13T14:22:41.662629+00:00", "last_updated": "2026-01-13T14:22:41.662629+00:00", "context": { "id": "01KEVVSJFYRS5CDC03APRN3TRS", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "-1.09", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:23:42.208402+00:00", "last_reported": "2026-01-13T14:23:42.208402+00:00", "last_updated": "2026-01-13T14:23:42.208402+00:00", "context": { "id": "01KEVVVDM0RG9MF39NG7P9T01X", "parent_id": null, "user_id": null } }, "for": null, "description": "numeric state of sensor.badkamer_luchtvochtigheid" } } }, "result": { "choice": "default" } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-13T14:20:35.506411+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-13T14:20:35.506569+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0/conditions/0", "timestamp": "2026-01-13T14:20:35.506754+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0/conditions/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0/conditions/0/conditions/0", "timestamp": "2026-01-13T14:20:35.506937+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0/conditions/1": [ { "path": "action/0/choose/0/conditions/0/conditions/1", "timestamp": "2026-01-13T14:20:35.507102+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0/conditions/1/conditions/0": [ { "path": "action/0/choose/0/conditions/0/conditions/1/conditions/0", "timestamp": "2026-01-13T14:20:35.507267+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/0": [ { "path": "action/0/default/0", "timestamp": "2026-01-13T14:20:35.507666+00:00", "result": { "result": true } } ], "action/0/default/1": [ { "path": "action/0/default/1", "timestamp": "2026-01-13T14:20:35.507844+00:00" } ], "action/0/default/1/choose/0": [ { "path": "action/0/default/1/choose/0", "timestamp": "2026-01-13T14:20:35.507935+00:00", "result": { "result": false } } ], "action/0/default/1/choose/0/conditions/0": [ { "path": "action/0/default/1/choose/0/conditions/0", "timestamp": "2026-01-13T14:20:35.508097+00:00", "result": { "result": false } } ], "action/0/default/1/choose/1": [ { "path": "action/0/default/1/choose/1", "timestamp": "2026-01-13T14:20:35.508284+00:00", "result": { "result": false } } ], "action/0/default/1/choose/1/conditions/0": [ { "path": "action/0/default/1/choose/1/conditions/0", "timestamp": "2026-01-13T14:20:35.508497+00:00", "result": { "result": false } } ], "action/0/default/2": [ { "path": "action/0/default/2", "timestamp": "2026-01-13T14:20:35.508732+00:00" } ], "action/0/default/2/choose/0": [ { "path": "action/0/default/2/choose/0", "timestamp": "2026-01-13T14:20:35.508816+00:00", "result": { "result": false } } ], "action/0/default/2/choose/0/conditions/0": [ { "path": "action/0/default/2/choose/0/conditions/0", "timestamp": "2026-01-13T14:20:35.508977+00:00", "result": { "result": false } } ], "action/0/default/3": [ { "path": "action/0/default/3", "timestamp": "2026-01-13T14:20:35.509232+00:00" } ], "action/0/default/3/choose/0": [ { "path": "action/0/default/3/choose/0", "timestamp": "2026-01-13T14:20:35.509318+00:00", "result": { "result": false } } ], "action/0/default/3/choose/0/conditions/0": [ { "path": "action/0/default/3/choose/0/conditions/0", "timestamp": "2026-01-13T14:20:35.509471+00:00", "result": { "result": false } } ], "action/0/default/3/choose/1": [ { "path": "action/0/default/3/choose/1", "timestamp": "2026-01-13T14:20:35.509636+00:00", "result": { "result": false } } ], "action/0/default/3/choose/1/conditions/0": [ { "path": "action/0/default/3/choose/1/conditions/0", "timestamp": "2026-01-13T14:20:35.509780+00:00", "result": { "result": false } } ], "action/0/default/4": [ { "path": "action/0/default/4", "timestamp": "2026-01-13T14:20:35.510041+00:00" } ], "action/0/default/4/choose/0": [ { "path": "action/0/default/4/choose/0", "timestamp": "2026-01-13T14:20:35.510138+00:00", "result": { "result": false } } ], "action/0/default/4/choose/0/conditions/0": [ { "path": "action/0/default/4/choose/0/conditions/0", "timestamp": "2026-01-13T14:20:35.510363+00:00", "result": { "result": false } } ], "action/0/default/5": [ { "path": "action/0/default/5", "timestamp": "2026-01-13T14:20:35.510661+00:00" } ], "action/0/default/5/choose/0": [ { "path": "action/0/default/5/choose/0", "timestamp": "2026-01-13T14:20:35.510756+00:00", "result": { "result": false } } ], "action/0/default/5/choose/0/conditions/0": [ { "path": "action/0/default/5/choose/0/conditions/0", "timestamp": "2026-01-13T14:20:35.510970+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/6": [ { "path": "action/0/default/6", "timestamp": "2026-01-13T14:20:35.511792+00:00" } ], "action/0/default/6/choose/0": [ { "path": "action/0/default/6/choose/0", "timestamp": "2026-01-13T14:20:35.511901+00:00", "result": { "result": false } } ], "action/0/default/6/choose/0/conditions/0": [ { "path": "action/0/default/6/choose/0/conditions/0", "timestamp": "2026-01-13T14:20:35.512115+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/7": [ { "path": "action/0/default/7", "timestamp": "2026-01-13T14:20:35.512581+00:00" } ], "action/0/default/7/choose/0": [ { "path": "action/0/default/7/choose/0", "timestamp": "2026-01-13T14:20:35.512680+00:00", "result": { "result": false } } ], "action/0/default/7/choose/0/conditions/0": [ { "path": "action/0/default/7/choose/0/conditions/0", "timestamp": "2026-01-13T14:20:35.512894+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/8": [ { "path": "action/0/default/8", "timestamp": "2026-01-13T14:20:35.513104+00:00" } ], "action/0/default/8/choose/0": [ { "path": "action/0/default/8/choose/0", "timestamp": "2026-01-13T14:20:35.513152+00:00", "result": { "result": false } } ], "action/0/default/8/choose/0/conditions/0": [ { "path": "action/0/default/8/choose/0/conditions/0", "timestamp": "2026-01-13T14:20:35.513275+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/9": [ { "path": "action/0/default/9", "timestamp": "2026-01-13T14:20:35.515712+00:00", "result": { "params": { "domain": "homeassistant", "service": "turn_on", "service_data": {}, "target": { "device_id": [ "6e29c3c314df87528f187dbe4eb847d4" ] } }, "running_script": false } } ], "action/0/default/10": [ { "path": "action/0/default/10", "timestamp": "2026-01-13T14:20:35.541911+00:00" } ], "action/0/default/10/choose/0": [ { "path": "action/0/default/10/choose/0", "timestamp": "2026-01-13T14:20:35.541983+00:00", "result": { "result": false } } ], "action/0/default/10/choose/0/conditions/0": [ { "path": "action/0/default/10/choose/0/conditions/0", "timestamp": "2026-01-13T14:20:35.542075+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/11": [ { "path": "action/0/default/11", "timestamp": "2026-01-13T14:20:35.542335+00:00" } ], "action/0/default/11/choose/0": [ { "path": "action/0/default/11/choose/0", "timestamp": "2026-01-13T14:20:35.542387+00:00", "result": { "result": false } } ], "action/0/default/11/choose/0/conditions/0": [ { "path": "action/0/default/11/choose/0/conditions/0", "timestamp": "2026-01-13T14:20:35.542471+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/12": [ { "path": "action/0/default/12", "timestamp": "2026-01-13T14:20:35.542691+00:00" } ], "action/0/default/12/choose/0": [ { "path": "action/0/default/12/choose/0", "timestamp": "2026-01-13T14:20:35.542741+00:00", "result": { "result": false } } ], "action/0/default/12/choose/0/conditions/0": [ { "path": "action/0/default/12/choose/0/conditions/0", "timestamp": "2026-01-13T14:20:35.542824+00:00", "result": { "result": false } } ], "action/0/default/13": [ { "path": "action/0/default/13", "timestamp": "2026-01-13T14:20:35.542962+00:00", "changed_variables": { "wait": { "remaining": 1013.333077672869, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1.0, "above": null, "from_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "1.41", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:22:41.662629+00:00", "last_reported": "2026-01-13T14:22:41.662629+00:00", "last_updated": "2026-01-13T14:22:41.662629+00:00", "context": { "id": "01KEVVSJFYRS5CDC03APRN3TRS", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "-1.09", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:23:42.208402+00:00", "last_reported": "2026-01-13T14:23:42.208402+00:00", "last_updated": "2026-01-13T14:23:42.208402+00:00", "context": { "id": "01KEVVVDM0RG9MF39NG7P9T01X", "parent_id": null, "user_id": null } }, "for": null, "description": "numeric state of sensor.badkamer_luchtvochtigheid" } } }, "result": { "result": false, "state": 1.17, "wanted_state_below": -1.0 } } ], "action/0/default/14": [ { "path": "action/0/default/14", "timestamp": "2026-01-13T14:23:42.210652+00:00" } ], "action/0/default/14/parallel/0/sequence/0": [ { "path": "action/0/default/14/parallel/0/sequence/0", "timestamp": "2026-01-13T14:23:42.210861+00:00", "result": { "delay": 600.0, "done": true } } ], "action/0/default/14/parallel/1/sequence/0": [ { "path": "action/0/default/14/parallel/1/sequence/0", "timestamp": "2026-01-13T14:23:42.211218+00:00" } ], "action/0/default/14/parallel/1/sequence/0/choose/0": [ { "path": "action/0/default/14/parallel/1/sequence/0/choose/0", "timestamp": "2026-01-13T14:23:42.211268+00:00", "changed_variables": { "this": { "entity_id": "automation.ventilator_badkamer_bp", "state": "on", "attributes": { "id": "1754461823733", "last_triggered": "2026-01-13T14:14:42.137553+00:00", "mode": "restart", "current": 1, "friendly_name": "Ventilator badkamer [BP]" }, "last_changed": "2026-01-13T12:10:27.678160+00:00", "last_reported": "2026-01-13T14:14:42.137568+00:00", "last_updated": "2026-01-13T14:14:42.137568+00:00", "context": { "id": "01KEVVAY6RRRW27K03A92SHRN2", "parent_id": "01KEVVAY6NJAA73YNYESNQVF8K", "user_id": null } }, "trigger": { "id": "t3", "idx": "3", "alias": null, "platform": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": 100.0, "above": 1.0, "from_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "-0.00", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:20:30.421976+00:00", "last_reported": "2026-01-13T14:20:30.421976+00:00", "last_updated": "2026-01-13T14:20:30.421976+00:00", "context": { "id": "01KEVVNJANK67VCC7M07DQ3H7D", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "1.17", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:20:35.498646+00:00", "last_reported": "2026-01-13T14:20:35.498646+00:00", "last_updated": "2026-01-13T14:20:35.498646+00:00", "context": { "id": "01KEVVNQ9AEMFC1EY3PBDM6RA0", "parent_id": null, "user_id": null } }, "for": null, "description": "numeric state of sensor.badkamer_luchtvochtigheid" }, "bathroom_humidity_sensor": [], "include_manual_trigger": "disable_manual_trigger", "manual_trigger": [], "manual_trigger_default_time_delay": 15, "manual_trigger_winter_time_delay": 15, "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "fan_speed_low": [], "fan_speed_off": [], "rising_humidity": 1, "falling_humidity": -1, "time_delay": 10, "time_out": 20, "include_max_humidity": "maximum_humidity_enabled", "max_humidity": 100, "include_fan_speed": "fan_speed_disabled", "time_delay_low_speed": 5, "include_winter_mode": "winter_mode_disabled", "month_winter_mode": [], "winter_rising_humidity": 1, "winter_falling_humidity": -1, "winter_time_delay": 10, "winter_time_out": 20, "winter_include_max_humidity": "maximum_humidity_disabled", "winter_max_humidity": 100, "winter_include_fan_speed": "fan_speed_disabled", "winter_time_delay_low_speed": 5, "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "light_time_delay": 10, "include_light_control": [], "light_brightness": 100, "brightness_value": false, "light_colour_temperature": 5000, "temperature_value": [], "light_transition_on": 1, "light_transition_off": 1, "transition_on_value": false, "transition_off_value": false, "include_manual_fan_switch": "disable_manual_fan_switch", "manual_fan_switch": [], "manual_fan_switch_time_delay": 10, "include_automation_link": "disable_automation_link", "automation_link": [], "automation_link_time_delay": 10, "include_bypass": "bypass_disabled", "by_pass": [], "bypass_options": [], "include_bypass_auto_off": "bypass_auto_off_disabled", "bypass_auto_off_delay": 60, "light_entities": [], "context": { "id": "01KEVVNQ9FT0EMN4M5YWDFD0E3", "parent_id": "01KEVVNQ9AEMFC1EY3PBDM6RA0", "user_id": null }, "wait": { "remaining": 1013.333077672869, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1.0, "above": null, "from_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "1.41", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:22:41.662629+00:00", "last_reported": "2026-01-13T14:22:41.662629+00:00", "last_updated": "2026-01-13T14:22:41.662629+00:00", "context": { "id": "01KEVVSJFYRS5CDC03APRN3TRS", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "-1.09", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:23:42.208402+00:00", "last_reported": "2026-01-13T14:23:42.208402+00:00", "last_updated": "2026-01-13T14:23:42.208402+00:00", "context": { "id": "01KEVVVDM0RG9MF39NG7P9T01X", "parent_id": null, "user_id": null } }, "for": null, "description": "numeric state of sensor.badkamer_luchtvochtigheid" } } }, "result": { "result": false } } ], "action/0/default/14/parallel/1/sequence/0/choose/0/conditions/0": [ { "path": "action/0/default/14/parallel/1/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-13T14:23:42.211407+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/14/parallel/2/sequence/0": [ { "path": "action/0/default/14/parallel/2/sequence/0", "timestamp": "2026-01-13T14:23:42.211726+00:00" } ], "action/0/default/14/parallel/2/sequence/0/choose/0": [ { "path": "action/0/default/14/parallel/2/sequence/0/choose/0", "timestamp": "2026-01-13T14:23:42.211753+00:00", "changed_variables": { "this": { "entity_id": "automation.ventilator_badkamer_bp", "state": "on", "attributes": { "id": "1754461823733", "last_triggered": "2026-01-13T14:14:42.137553+00:00", "mode": "restart", "current": 1, "friendly_name": "Ventilator badkamer [BP]" }, "last_changed": "2026-01-13T12:10:27.678160+00:00", "last_reported": "2026-01-13T14:14:42.137568+00:00", "last_updated": "2026-01-13T14:14:42.137568+00:00", "context": { "id": "01KEVVAY6RRRW27K03A92SHRN2", "parent_id": "01KEVVAY6NJAA73YNYESNQVF8K", "user_id": null } }, "trigger": { "id": "t3", "idx": "3", "alias": null, "platform": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": 100.0, "above": 1.0, "from_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "-0.00", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:20:30.421976+00:00", "last_reported": "2026-01-13T14:20:30.421976+00:00", "last_updated": "2026-01-13T14:20:30.421976+00:00", "context": { "id": "01KEVVNJANK67VCC7M07DQ3H7D", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "1.17", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:20:35.498646+00:00", "last_reported": "2026-01-13T14:20:35.498646+00:00", "last_updated": "2026-01-13T14:20:35.498646+00:00", "context": { "id": "01KEVVNQ9AEMFC1EY3PBDM6RA0", "parent_id": null, "user_id": null } }, "for": null, "description": "numeric state of sensor.badkamer_luchtvochtigheid" }, "bathroom_humidity_sensor": [], "include_manual_trigger": "disable_manual_trigger", "manual_trigger": [], "manual_trigger_default_time_delay": 15, "manual_trigger_winter_time_delay": 15, "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "fan_speed_low": [], "fan_speed_off": [], "rising_humidity": 1, "falling_humidity": -1, "time_delay": 10, "time_out": 20, "include_max_humidity": "maximum_humidity_enabled", "max_humidity": 100, "include_fan_speed": "fan_speed_disabled", "time_delay_low_speed": 5, "include_winter_mode": "winter_mode_disabled", "month_winter_mode": [], "winter_rising_humidity": 1, "winter_falling_humidity": -1, "winter_time_delay": 10, "winter_time_out": 20, "winter_include_max_humidity": "maximum_humidity_disabled", "winter_max_humidity": 100, "winter_include_fan_speed": "fan_speed_disabled", "winter_time_delay_low_speed": 5, "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "light_time_delay": 10, "include_light_control": [], "light_brightness": 100, "brightness_value": false, "light_colour_temperature": 5000, "temperature_value": [], "light_transition_on": 1, "light_transition_off": 1, "transition_on_value": false, "transition_off_value": false, "include_manual_fan_switch": "disable_manual_fan_switch", "manual_fan_switch": [], "manual_fan_switch_time_delay": 10, "include_automation_link": "disable_automation_link", "automation_link": [], "automation_link_time_delay": 10, "include_bypass": "bypass_disabled", "by_pass": [], "bypass_options": [], "include_bypass_auto_off": "bypass_auto_off_disabled", "bypass_auto_off_delay": 60, "light_entities": [], "context": { "id": "01KEVVNQ9FT0EMN4M5YWDFD0E3", "parent_id": "01KEVVNQ9AEMFC1EY3PBDM6RA0", "user_id": null }, "wait": { "remaining": 1013.333077672869, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1.0, "above": null, "from_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "1.41", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:22:41.662629+00:00", "last_reported": "2026-01-13T14:22:41.662629+00:00", "last_updated": "2026-01-13T14:22:41.662629+00:00", "context": { "id": "01KEVVSJFYRS5CDC03APRN3TRS", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "-1.09", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:23:42.208402+00:00", "last_reported": "2026-01-13T14:23:42.208402+00:00", "last_updated": "2026-01-13T14:23:42.208402+00:00", "context": { "id": "01KEVVVDM0RG9MF39NG7P9T01X", "parent_id": null, "user_id": null } }, "for": null, "description": "numeric state of sensor.badkamer_luchtvochtigheid" } } }, "result": { "result": false } } ], "action/0/default/14/parallel/2/sequence/0/choose/0/conditions/0": [ { "path": "action/0/default/14/parallel/2/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-13T14:23:42.211869+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/14/parallel/0/sequence/1": [ { "path": "action/0/default/14/parallel/0/sequence/1", "timestamp": "2026-01-13T14:33:42.211509+00:00", "result": { "params": { "domain": "homeassistant", "service": "turn_off", "service_data": {}, "target": { "device_id": [ "6e29c3c314df87528f187dbe4eb847d4" ] } }, "running_script": false } } ], "action/0/default/14/parallel/0/sequence/2": [ { "path": "action/0/default/14/parallel/0/sequence/2", "timestamp": "2026-01-13T14:33:42.270142+00:00" } ], "action/0/default/14/parallel/0/sequence/2/choose/0": [ { "path": "action/0/default/14/parallel/0/sequence/2/choose/0", "timestamp": "2026-01-13T14:33:42.270211+00:00", "changed_variables": { "this": { "entity_id": "automation.ventilator_badkamer_bp", "state": "on", "attributes": { "id": "1754461823733", "last_triggered": "2026-01-13T14:14:42.137553+00:00", "mode": "restart", "current": 1, "friendly_name": "Ventilator badkamer [BP]" }, "last_changed": "2026-01-13T12:10:27.678160+00:00", "last_reported": "2026-01-13T14:14:42.137568+00:00", "last_updated": "2026-01-13T14:14:42.137568+00:00", "context": { "id": "01KEVVAY6RRRW27K03A92SHRN2", "parent_id": "01KEVVAY6NJAA73YNYESNQVF8K", "user_id": null } }, "trigger": { "id": "t3", "idx": "3", "alias": null, "platform": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": 100.0, "above": 1.0, "from_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "-0.00", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:20:30.421976+00:00", "last_reported": "2026-01-13T14:20:30.421976+00:00", "last_updated": "2026-01-13T14:20:30.421976+00:00", "context": { "id": "01KEVVNJANK67VCC7M07DQ3H7D", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "1.17", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:20:35.498646+00:00", "last_reported": "2026-01-13T14:20:35.498646+00:00", "last_updated": "2026-01-13T14:20:35.498646+00:00", "context": { "id": "01KEVVNQ9AEMFC1EY3PBDM6RA0", "parent_id": null, "user_id": null } }, "for": null, "description": "numeric state of sensor.badkamer_luchtvochtigheid" }, "bathroom_humidity_sensor": [], "include_manual_trigger": "disable_manual_trigger", "manual_trigger": [], "manual_trigger_default_time_delay": 15, "manual_trigger_winter_time_delay": 15, "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "fan_speed_low": [], "fan_speed_off": [], "rising_humidity": 1, "falling_humidity": -1, "time_delay": 10, "time_out": 20, "include_max_humidity": "maximum_humidity_enabled", "max_humidity": 100, "include_fan_speed": "fan_speed_disabled", "time_delay_low_speed": 5, "include_winter_mode": "winter_mode_disabled", "month_winter_mode": [], "winter_rising_humidity": 1, "winter_falling_humidity": -1, "winter_time_delay": 10, "winter_time_out": 20, "winter_include_max_humidity": "maximum_humidity_disabled", "winter_max_humidity": 100, "winter_include_fan_speed": "fan_speed_disabled", "winter_time_delay_low_speed": 5, "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "light_time_delay": 10, "include_light_control": [], "light_brightness": 100, "brightness_value": false, "light_colour_temperature": 5000, "temperature_value": [], "light_transition_on": 1, "light_transition_off": 1, "transition_on_value": false, "transition_off_value": false, "include_manual_fan_switch": "disable_manual_fan_switch", "manual_fan_switch": [], "manual_fan_switch_time_delay": 10, "include_automation_link": "disable_automation_link", "automation_link": [], "automation_link_time_delay": 10, "include_bypass": "bypass_disabled", "by_pass": [], "bypass_options": [], "include_bypass_auto_off": "bypass_auto_off_disabled", "bypass_auto_off_delay": 60, "light_entities": [], "context": { "id": "01KEVVNQ9FT0EMN4M5YWDFD0E3", "parent_id": "01KEVVNQ9AEMFC1EY3PBDM6RA0", "user_id": null }, "wait": { "remaining": 1013.333077672869, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1.0, "above": null, "from_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "1.41", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:22:41.662629+00:00", "last_reported": "2026-01-13T14:22:41.662629+00:00", "last_updated": "2026-01-13T14:22:41.662629+00:00", "context": { "id": "01KEVVSJFYRS5CDC03APRN3TRS", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.badkamer_luchtvochtigheid", "state": "-1.09", "attributes": { "source": "sensor.sonoff_snzb_02d_luchtvochtigheid_2", "unit_of_measurement": "%/min", "friendly_name": "badkamer luchtvochtigheid " }, "last_changed": "2026-01-13T14:23:42.208402+00:00", "last_reported": "2026-01-13T14:23:42.208402+00:00", "last_updated": "2026-01-13T14:23:42.208402+00:00", "context": { "id": "01KEVVVDM0RG9MF39NG7P9T01X", "parent_id": null, "user_id": null } }, "for": null, "description": "numeric state of sensor.badkamer_luchtvochtigheid" } } }, "result": { "result": false } } ], "action/0/default/14/parallel/0/sequence/2/choose/0/conditions/0": [ { "path": "action/0/default/14/parallel/0/sequence/2/choose/0/conditions/0", "timestamp": "2026-01-13T14:33:42.270354+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/14/parallel/0/sequence/2/choose/1": [ { "path": "action/0/default/14/parallel/0/sequence/2/choose/1", "timestamp": "2026-01-13T14:33:42.270623+00:00", "result": { "result": false } } ], "action/0/default/14/parallel/0/sequence/2/choose/1/conditions/0": [ { "path": "action/0/default/14/parallel/0/sequence/2/choose/1/conditions/0", "timestamp": "2026-01-13T14:33:42.270883+00:00", "result": { "result": false, "entities": [] } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "trigger": "sensor.badkamer_luchtvochtigheid", "bathroom_humidity_sensor": [], "include_manual_trigger": "disable_manual_trigger", "manual_trigger": [], "manual_trigger_default_time_delay": 15, "manual_trigger_winter_time_delay": 15, "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "fan_speed_low": [], "fan_speed_off": [], "rising_humidity": 1, "falling_humidity": -1, "time_delay": 10, "time_out": 20, "include_max_humidity": "maximum_humidity_enabled", "max_humidity": 100, "include_fan_speed": "fan_speed_disabled", "time_delay_low_speed": 5, "include_winter_mode": "winter_mode_disabled", "month_winter_mode": [], "winter_rising_humidity": 1, "winter_falling_humidity": -1, "winter_time_delay": 10, "winter_time_out": 20, "winter_include_max_humidity": "maximum_humidity_disabled", "winter_max_humidity": 100, "winter_include_fan_speed": "fan_speed_disabled", "winter_time_delay_low_speed": 5, "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "light_time_delay": 10, "include_light_control": [], "light_brightness": 100, "brightness_value": "{{ iif ('use_brightness' in include_light_control , light_brightness, ) }}", "light_colour_temperature": 5000, "temperature_value": "{{ iif ('use_colour_temperature' in include_light_control , light_colour_temperature, [] ) }}", "light_transition_on": 1, "light_transition_off": 1, "transition_on_value": "{{ iif ('use_transition' in include_light_control, light_transition_on, ) }}", "transition_off_value": "{{ iif ('use_transition' in include_light_control, light_transition_off, ) }}", "include_manual_fan_switch": "disable_manual_fan_switch", "manual_fan_switch": [], "manual_fan_switch_time_delay": 10, "include_automation_link": "disable_automation_link", "automation_link": [], "automation_link_time_delay": 10, "include_bypass": "bypass_disabled", "by_pass": [], "bypass_options": [], "include_bypass_auto_off": "bypass_auto_off_disabled", "bypass_auto_off_delay": 60, "light_entities": "{% set a = light_switch and light_switch.entity_id %} {% if a %}\n {{ expand(a) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}" }, "triggers": [ { "trigger": "numeric_state", "id": "t0", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" }, { "trigger": "numeric_state", "id": "t1", "entity_id": [], "above": 100, "below": "100" }, { "trigger": "homeassistant", "id": "t2", "event": "start" }, { "trigger": "numeric_state", "id": "t3", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" }, { "trigger": "numeric_state", "id": "t4", "entity_id": [], "above": 100, "below": "100" }, { "trigger": "state", "id": "t5", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t6", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "state", "id": "t7", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t8", "entity_id": [], "from": "off", "to": "on" } ], "actions": [ { "choose": [ { "alias": "For winter mode when enabled and within the set winter months", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t0", "t1" ] } ] }, { "condition": "and", "conditions": [ "{{ include_winter_mode == 'winter_mode_enabled' }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "trigger", "id": [ "t2", "t5", "t6", "t7", "t8" ] } ] } ] } ], "sequence": [ { "choose": [ { "alias": "By-pass is turned on & check by-pass option - turn fan off", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned on & check by-pass option - keep the current fan state", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_stop' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & preform the correct action", "conditions": [ { "condition": "trigger", "id": "t6" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check by-pass options - turn fan off is enabled", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is below falling humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is below falling", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is above winter rising humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is above rising", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'off') | list | count > 0)) }}", { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "We need something here to continue", "delay": { "milliseconds": 10 } } ] } ], "default": [ { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Preform the manual fan switch option", "conditions": [ { "condition": "trigger", "id": "t7" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] }, { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the run on timer is switch is on", "conditions": [ "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Preform the manual trigger option", "conditions": [ { "condition": "trigger", "id": "t8" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check manual trigger with safeguard is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Wait until the time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait until the low speed time delay passes", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled and the lights are ON", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the light time delay has passes", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the automation link time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] }, { "choose": [ { "alias": "Safeguard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t2" } ], "sequence": [ { "choose": [ { "alias": "Check manual trigger with safeguard is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "choose": [ { "alias": "Check manual fan switch is enabled and manual switch is ON", "conditions": [ { "alias": "Check if the humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "template", "value_template": "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' or include_manual_fan_switch == 'enable_manual_fan_switch' }}" }, "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "choose": [ { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] }, { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the run on timer is switch is on", "conditions": [ "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the winter humidity derivative sensor is below falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the winter humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) }}", "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or (include_lights == 'lights_disabled') }}", "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) or (include_automation_link == 'disable_automation_link') }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - turn fan on", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_turn_on' }}" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] } ] } ], "default": [ { "alias": "Check if the triggers", "condition": "trigger", "id": [ "t2", "t3", "t4", "t5", "t6", "t7", "t8" ] }, { "choose": [ { "alias": "By-pass is turned on & check by-pass option - turn fan off", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned on & check by-pass option - keep the current fan state", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_stop' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & check if the sensor is below falling humidity", "conditions": [ { "condition": "trigger", "id": "t6" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check by-pass options - turn fan off is enabled", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is below falling humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is below falling", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is above rising humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is above rising", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'off') | list | count > 0)) }}", { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "We need something here to continue", "delay": { "milliseconds": 10 } } ] } ], "default": [ { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Preform the manual fan switch option", "conditions": [ { "condition": "trigger", "id": "t7" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] }, { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Preform the manual trigger option", "conditions": [ { "condition": "trigger", "id": "t8" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check manual trigger with safeguard is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Wait until the time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait until the low speed time delay passes", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled and the lights are ON", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the light time delay has passes", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the automation link time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] }, { "choose": [ { "alias": "Safeguard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t2" } ], "sequence": [ { "choose": [ { "alias": "Check manual trigger with safeguard is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "choose": [ { "alias": "Check manual fan switch is enabled and manual switch is ON", "conditions": [ { "alias": "Check if the humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "template", "value_template": "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' or include_manual_fan_switch == 'enable_manual_fan_switch' }}" }, "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "choose": [ { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] }, { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the humidity derivative sensor is below falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) }}", "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or (include_lights == 'lights_disabled') }}", "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) or (include_automation_link == 'disable_automation_link') }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - turn fan on", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_turn_on' }}" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] } ] } ], "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ include_winter_mode == 'winter_mode_enabled' }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "trigger", "id": "t0" } ] }, { "condition": "and", "conditions": [ "{{ (include_winter_mode == 'winter_mode_enabled') and (winter_include_max_humidity == 'maximum_humidity_enabled') }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "trigger", "id": "t1" } ] }, { "condition": "and", "conditions": [ "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "trigger", "id": "t2" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_disabled' in include_winter_mode }}", { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", { "condition": "template", "value_template": "{{ (now().month | string not in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_disabled' in include_winter_mode }}", "{{ 'maximum_humidity_enabled' in include_max_humidity }}", { "condition": "numeric_state", "entity_id": [], "above": 100, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ 'maximum_humidity_enabled' in include_max_humidity }}", { "condition": "template", "value_template": "{{ (now().month | string not in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": [], "above": 100, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ 'maximum_humidity_enabled' in winter_include_max_humidity }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": [], "above": 100, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ (include_winter_mode == 'winter_mode_disabled') or ((include_winter_mode == 'winter_mode_enabled') and not (now().month | string in month_winter_mode )) }}" }, { "condition": "trigger", "id": "t3" } ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ ((include_winter_mode == 'winter_mode_disabled') and (include_max_humidity == 'maximum_humidity_enabled')) or ((include_winter_mode == 'winter_mode_enabled') and (include_max_humidity == 'maximum_humidity_enabled') and not (now().month | string in month_winter_mode )) }}" }, { "condition": "trigger", "id": "t4" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t5" }, "{{ (include_bypass == 'bypass_enabled_turn_on') or (include_bypass == 'bypass_enabled') or (include_bypass == 'bypass_enabled_stop') }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t6" }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ (include_bypass == 'bypass_enabled') or (include_bypass == 'bypass_enabled_stop') or (include_bypass == 'bypass_enabled_turn_on') }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0 ) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') and (expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0)) }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t6" ] }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ 'winter_mode_disabled' in include_winter_mode }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0))}}", { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t6" ] }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "template", "value_template": "{{ (now().month | string not in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t6" ] }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "trigger", "id": [ "t7" ] }, "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}" ] }, { "condition": "and", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "trigger", "id": [ "t8" ] }, "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}" ] } ] }, { "condition": "or", "conditions": [ "{{ include_bypass == 'bypass_disabled' }}", "{{ by_pass == [] }}", "{{ (include_bypass == 'bypass_enabled_turn_on') and (states[by_pass].state == 'off') }}", "{{ (include_bypass == 'bypass_enabled') and (states[by_pass].state == 'off') }}", "{{ (include_bypass == 'bypass_enabled_stop') and (states[by_pass].state == 'off') }}", "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'off') }}", "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') and (trigger.id == 't2') }}", { "condition": "trigger", "id": "t5" } ] } ], "id": "1754461823733", "alias": "Ventilator badkamer [BP]", "description": "" }, "blueprint_inputs": { "id": "1754461823733", "alias": "Ventilator badkamer [BP]", "description": "", "use_blueprint": { "path": "Blackshome/bathroom-humidity-exhaust-fan.yaml", "input": { "trigger": "sensor.badkamer_luchtvochtigheid", "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "include_max_humidity": "maximum_humidity_enabled", "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "include_manual_fan_switch": "disable_manual_fan_switch" } } }, "context": { "id": "01KEVVNQ9FT0EMN4M5YWDFD0E3", "parent_id": "01KEVVNQ9AEMFC1EY3PBDM6RA0", "user_id": null } }, "short_dict": { "last_step": "action/0/default/14/parallel/0/sequence/2/choose/1/conditions/0", "run_id": "f0d8accf888fbf559678e784dec55eb4", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T14:20:35.503122+00:00", "finish": "2026-01-13T14:33:42.272619+00:00" }, "domain": "automation", "item_id": "1754461823733", "trigger": "numeric state of sensor.badkamer_luchtvochtigheid" } }, { "extended_dict": { "last_step": "action/0/default/14/parallel/0/sequence/2/choose/1/conditions/0", "run_id": "c28b21db4fa0072b256af93a89217fa3", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T15:49:11.432781+00:00", "finish": "2026-01-14T16:19:11.650254+00:00" }, "domain": "automation", "item_id": "1754461823733", "trigger": "Home Assistant starting", "trace": { "trigger/2": [ { "path": "trigger/2", "timestamp": "2026-01-14T15:49:11.434462+00:00", "changed_variables": { "this": { "entity_id": "automation.ventilator_badkamer_bp", "state": "on", "attributes": { "id": "1754461823733", "last_triggered": "2026-01-13T14:20:35.506075+00:00", "mode": "restart", "current": 0, "friendly_name": "Ventilator badkamer [BP]" }, "last_changed": "2026-01-14T15:48:56.985992+00:00", "last_reported": "2026-01-14T15:48:56.985992+00:00", "last_updated": "2026-01-14T15:48:56.985992+00:00", "context": { "id": "01KEYK47GSXCG0P0NN4SQ9B0RE", "parent_id": null, "user_id": null } }, "trigger": { "id": "t2", "idx": "2", "alias": null, "platform": "homeassistant", "event": "start", "description": "Home Assistant starting" }, "bathroom_humidity_sensor": [], "include_manual_trigger": "disable_manual_trigger", "manual_trigger": [], "manual_trigger_default_time_delay": 15, "manual_trigger_winter_time_delay": 15, "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "fan_speed_low": [], "fan_speed_off": [], "rising_humidity": 1, "falling_humidity": -1, "time_delay": 10, "time_out": 20, "include_max_humidity": "maximum_humidity_enabled", "max_humidity": 100, "include_fan_speed": "fan_speed_disabled", "time_delay_low_speed": 5, "include_winter_mode": "winter_mode_disabled", "month_winter_mode": [], "winter_rising_humidity": 1, "winter_falling_humidity": -1, "winter_time_delay": 10, "winter_time_out": 20, "winter_include_max_humidity": "maximum_humidity_disabled", "winter_max_humidity": 100, "winter_include_fan_speed": "fan_speed_disabled", "winter_time_delay_low_speed": 5, "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "light_time_delay": 10, "include_light_control": [], "light_brightness": 100, "brightness_value": false, "light_colour_temperature": 5000, "temperature_value": [], "light_transition_on": 1, "light_transition_off": 1, "transition_on_value": false, "transition_off_value": false, "include_manual_fan_switch": "disable_manual_fan_switch", "manual_fan_switch": [], "manual_fan_switch_time_delay": 10, "include_automation_link": "disable_automation_link", "automation_link": [], "automation_link_time_delay": 10, "include_bypass": "bypass_disabled", "by_pass": [], "bypass_options": [], "include_bypass_auto_off": "bypass_auto_off_disabled", "bypass_auto_off_delay": 60, "light_entities": [] } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T15:49:11.434493+00:00", "result": { "result": true } } ], "condition/0/conditions/0": [ { "path": "condition/0/conditions/0", "timestamp": "2026-01-14T15:49:11.434512+00:00", "result": { "result": false } } ], "condition/0/conditions/0/conditions/0": [ { "path": "condition/0/conditions/0/conditions/0", "timestamp": "2026-01-14T15:49:11.434524+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/1": [ { "path": "condition/0/conditions/1", "timestamp": "2026-01-14T15:49:11.434602+00:00", "result": { "result": false } } ], "condition/0/conditions/1/conditions/0": [ { "path": "condition/0/conditions/1/conditions/0", "timestamp": "2026-01-14T15:49:11.434614+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/2": [ { "path": "condition/0/conditions/2", "timestamp": "2026-01-14T15:49:11.434673+00:00", "error": "In 'and' (item 1 of 2):\n In 'template' condition: UndefinedError: 'dict object' has no attribute 'entity_id'" } ], "condition/0/conditions/2/conditions/0": [ { "path": "condition/0/conditions/2/conditions/0", "timestamp": "2026-01-14T15:49:11.434684+00:00", "error": "In 'template' condition: UndefinedError: 'dict object' has no attribute 'entity_id'" } ], "condition/0/conditions/2/conditions/1": [ { "path": "condition/0/conditions/2/conditions/1", "timestamp": "2026-01-14T15:49:11.434871+00:00", "result": { "result": true } } ], "condition/0/conditions/3": [ { "path": "condition/0/conditions/3", "timestamp": "2026-01-14T15:49:11.434899+00:00", "result": { "result": false } } ], "condition/0/conditions/3/conditions/0": [ { "path": "condition/0/conditions/3/conditions/0", "timestamp": "2026-01-14T15:49:11.434910+00:00", "result": { "result": true } } ], "condition/0/conditions/3/conditions/1": [ { "path": "condition/0/conditions/3/conditions/1", "timestamp": "2026-01-14T15:49:11.434924+00:00", "result": { "result": true, "entities": [] } } ], "condition/0/conditions/3/conditions/2": [ { "path": "condition/0/conditions/3/conditions/2", "timestamp": "2026-01-14T15:49:11.434987+00:00", "result": { "result": false } } ], "condition/0/conditions/3/conditions/2/entity_id/0": [ { "path": "condition/0/conditions/3/conditions/2/entity_id/0", "timestamp": "2026-01-14T15:49:11.434998+00:00", "result": { "result": false, "state": 0.01, "wanted_state_above": 1.0 } } ], "condition/0/conditions/4": [ { "path": "condition/0/conditions/4", "timestamp": "2026-01-14T15:49:11.435020+00:00", "result": { "result": false } } ], "condition/0/conditions/4/conditions/0": [ { "path": "condition/0/conditions/4/conditions/0", "timestamp": "2026-01-14T15:49:11.435029+00:00", "result": { "result": true } } ], "condition/0/conditions/4/conditions/1": [ { "path": "condition/0/conditions/4/conditions/1", "timestamp": "2026-01-14T15:49:11.435041+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/5": [ { "path": "condition/0/conditions/5", "timestamp": "2026-01-14T15:49:11.435096+00:00", "result": { "result": false } } ], "condition/0/conditions/5/conditions/0": [ { "path": "condition/0/conditions/5/conditions/0", "timestamp": "2026-01-14T15:49:11.435107+00:00", "result": { "result": true } } ], "condition/0/conditions/5/conditions/1": [ { "path": "condition/0/conditions/5/conditions/1", "timestamp": "2026-01-14T15:49:11.435119+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/6": [ { "path": "condition/0/conditions/6", "timestamp": "2026-01-14T15:49:11.435234+00:00", "result": { "result": true } } ], "condition/0/conditions/6/conditions/0": [ { "path": "condition/0/conditions/6/conditions/0", "timestamp": "2026-01-14T15:49:11.435245+00:00", "result": { "result": true } } ], "condition/0/conditions/6/conditions/1": [ { "path": "condition/0/conditions/6/conditions/1", "timestamp": "2026-01-14T15:49:11.435258+00:00", "result": { "result": true, "entities": [] } } ], "condition/0/conditions/6/conditions/2": [ { "path": "condition/0/conditions/6/conditions/2", "timestamp": "2026-01-14T15:49:11.435307+00:00", "result": { "result": true, "entities": [] } } ], "condition/0/conditions/6/conditions/3": [ { "path": "condition/0/conditions/6/conditions/3", "timestamp": "2026-01-14T15:49:11.435355+00:00", "result": { "result": true } } ], "condition/1": [ { "path": "condition/1", "timestamp": "2026-01-14T15:49:11.435375+00:00", "result": { "result": true } } ], "condition/1/conditions/0": [ { "path": "condition/1/conditions/0", "timestamp": "2026-01-14T15:49:11.435384+00:00", "result": { "result": true, "entities": [] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T15:49:11.435666+00:00", "changed_variables": { "context": { "id": "01KEYK4NM87SN3RA08ZPHDTA2S", "parent_id": null, "user_id": null }, "wait": { "remaining": 0.0, "completed": false, "trigger": null } }, "result": { "choice": "default" } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T15:49:11.435832+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T15:49:11.435931+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0/conditions/0", "timestamp": "2026-01-14T15:49:11.436011+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0/conditions/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0/conditions/0/conditions/0", "timestamp": "2026-01-14T15:49:11.436087+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0/conditions/1": [ { "path": "action/0/choose/0/conditions/0/conditions/1", "timestamp": "2026-01-14T15:49:11.436266+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0/conditions/1/conditions/0": [ { "path": "action/0/choose/0/conditions/0/conditions/1/conditions/0", "timestamp": "2026-01-14T15:49:11.436347+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/0": [ { "path": "action/0/default/0", "timestamp": "2026-01-14T15:49:11.436596+00:00", "result": { "result": true } } ], "action/0/default/1": [ { "path": "action/0/default/1", "timestamp": "2026-01-14T15:49:11.436717+00:00" } ], "action/0/default/1/choose/0": [ { "path": "action/0/default/1/choose/0", "timestamp": "2026-01-14T15:49:11.436819+00:00", "result": { "result": false } } ], "action/0/default/1/choose/0/conditions/0": [ { "path": "action/0/default/1/choose/0/conditions/0", "timestamp": "2026-01-14T15:49:11.436902+00:00", "result": { "result": false } } ], "action/0/default/1/choose/1": [ { "path": "action/0/default/1/choose/1", "timestamp": "2026-01-14T15:49:11.436993+00:00", "result": { "result": false } } ], "action/0/default/1/choose/1/conditions/0": [ { "path": "action/0/default/1/choose/1/conditions/0", "timestamp": "2026-01-14T15:49:11.437069+00:00", "result": { "result": false } } ], "action/0/default/2": [ { "path": "action/0/default/2", "timestamp": "2026-01-14T15:49:11.437250+00:00" } ], "action/0/default/2/choose/0": [ { "path": "action/0/default/2/choose/0", "timestamp": "2026-01-14T15:49:11.437317+00:00", "result": { "result": false } } ], "action/0/default/2/choose/0/conditions/0": [ { "path": "action/0/default/2/choose/0/conditions/0", "timestamp": "2026-01-14T15:49:11.437396+00:00", "result": { "result": false } } ], "action/0/default/3": [ { "path": "action/0/default/3", "timestamp": "2026-01-14T15:49:11.437513+00:00" } ], "action/0/default/3/choose/0": [ { "path": "action/0/default/3/choose/0", "timestamp": "2026-01-14T15:49:11.437590+00:00", "result": { "result": false } } ], "action/0/default/3/choose/0/conditions/0": [ { "path": "action/0/default/3/choose/0/conditions/0", "timestamp": "2026-01-14T15:49:11.437668+00:00", "result": { "result": false } } ], "action/0/default/3/choose/1": [ { "path": "action/0/default/3/choose/1", "timestamp": "2026-01-14T15:49:11.437755+00:00", "result": { "result": false } } ], "action/0/default/3/choose/1/conditions/0": [ { "path": "action/0/default/3/choose/1/conditions/0", "timestamp": "2026-01-14T15:49:11.437832+00:00", "result": { "result": false } } ], "action/0/default/4": [ { "path": "action/0/default/4", "timestamp": "2026-01-14T15:49:11.437947+00:00", "result": { "choice": 0 } } ], "action/0/default/4/choose/0": [ { "path": "action/0/default/4/choose/0", "timestamp": "2026-01-14T15:49:11.438008+00:00", "result": { "result": true } } ], "action/0/default/4/choose/0/conditions/0": [ { "path": "action/0/default/4/choose/0/conditions/0", "timestamp": "2026-01-14T15:49:11.438087+00:00", "result": { "result": true } } ], "action/0/default/4/choose/0/sequence/0": [ { "path": "action/0/default/4/choose/0/sequence/0", "timestamp": "2026-01-14T15:49:11.438281+00:00" } ], "action/0/default/4/choose/0/sequence/0/choose/0": [ { "path": "action/0/default/4/choose/0/sequence/0/choose/0", "timestamp": "2026-01-14T15:49:11.438381+00:00", "result": { "result": false } } ], "action/0/default/4/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/default/4/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-14T15:49:11.438461+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/4/choose/0/sequence/0/choose/1": [ { "path": "action/0/default/4/choose/0/sequence/0/choose/1", "timestamp": "2026-01-14T15:49:11.438636+00:00", "result": { "result": false } } ], "action/0/default/4/choose/0/sequence/0/choose/1/conditions/0": [ { "path": "action/0/default/4/choose/0/sequence/0/choose/1/conditions/0", "timestamp": "2026-01-14T15:49:11.438751+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/4/choose/0/sequence/1": [ { "path": "action/0/default/4/choose/0/sequence/1", "timestamp": "2026-01-14T15:49:11.439091+00:00" } ], "action/0/default/4/choose/0/sequence/1/choose/0": [ { "path": "action/0/default/4/choose/0/sequence/1/choose/0", "timestamp": "2026-01-14T15:49:11.439505+00:00", "result": { "result": false } } ], "action/0/default/4/choose/0/sequence/1/choose/0/conditions/0": [ { "path": "action/0/default/4/choose/0/sequence/1/choose/0/conditions/0", "timestamp": "2026-01-14T15:49:11.439594+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/4/choose/0/sequence/1/choose/1": [ { "path": "action/0/default/4/choose/0/sequence/1/choose/1", "timestamp": "2026-01-14T15:49:11.439771+00:00", "result": { "result": false } } ], "action/0/default/4/choose/0/sequence/1/choose/1/conditions/0": [ { "path": "action/0/default/4/choose/0/sequence/1/choose/1/conditions/0", "timestamp": "2026-01-14T15:49:11.439850+00:00", "result": { "result": false } } ], "action/0/default/4/choose/0/sequence/1/choose/1/conditions/0/entity_id/0": [ { "path": "action/0/default/4/choose/0/sequence/1/choose/1/conditions/0/entity_id/0", "timestamp": "2026-01-14T15:49:11.439925+00:00", "result": { "result": false, "state": 0.01, "wanted_state_below": -1.0 } } ], "action/0/default/4/choose/0/sequence/1/choose/2": [ { "path": "action/0/default/4/choose/0/sequence/1/choose/2", "timestamp": "2026-01-14T15:49:11.440017+00:00", "result": { "result": false } } ], "action/0/default/4/choose/0/sequence/1/choose/2/conditions/0": [ { "path": "action/0/default/4/choose/0/sequence/1/choose/2/conditions/0", "timestamp": "2026-01-14T15:49:11.440091+00:00", "result": { "result": false } } ], "action/0/default/4/choose/0/sequence/1/choose/2/conditions/0/entity_id/0": [ { "path": "action/0/default/4/choose/0/sequence/1/choose/2/conditions/0/entity_id/0", "timestamp": "2026-01-14T15:49:11.440255+00:00", "result": { "result": false, "state": 0.01, "wanted_state_above": 1.0 } } ], "action/0/default/5": [ { "path": "action/0/default/5", "timestamp": "2026-01-14T15:49:11.440448+00:00" } ], "action/0/default/5/choose/0": [ { "path": "action/0/default/5/choose/0", "timestamp": "2026-01-14T15:49:11.440529+00:00", "result": { "result": false } } ], "action/0/default/5/choose/0/conditions/0": [ { "path": "action/0/default/5/choose/0/conditions/0", "timestamp": "2026-01-14T15:49:11.440610+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/6": [ { "path": "action/0/default/6", "timestamp": "2026-01-14T15:49:11.440819+00:00" } ], "action/0/default/6/choose/0": [ { "path": "action/0/default/6/choose/0", "timestamp": "2026-01-14T15:49:11.440898+00:00", "result": { "result": false } } ], "action/0/default/6/choose/0/conditions/0": [ { "path": "action/0/default/6/choose/0/conditions/0", "timestamp": "2026-01-14T15:49:11.440998+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/7": [ { "path": "action/0/default/7", "timestamp": "2026-01-14T15:49:11.441261+00:00" } ], "action/0/default/7/choose/0": [ { "path": "action/0/default/7/choose/0", "timestamp": "2026-01-14T15:49:11.441333+00:00", "result": { "result": false } } ], "action/0/default/7/choose/0/conditions/0": [ { "path": "action/0/default/7/choose/0/conditions/0", "timestamp": "2026-01-14T15:49:11.441413+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/8": [ { "path": "action/0/default/8", "timestamp": "2026-01-14T15:49:11.441613+00:00" } ], "action/0/default/8/choose/0": [ { "path": "action/0/default/8/choose/0", "timestamp": "2026-01-14T15:49:11.441680+00:00", "result": { "result": false } } ], "action/0/default/8/choose/0/conditions/0": [ { "path": "action/0/default/8/choose/0/conditions/0", "timestamp": "2026-01-14T15:49:11.441760+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/9": [ { "path": "action/0/default/9", "timestamp": "2026-01-14T15:49:11.441957+00:00", "result": { "params": { "domain": "homeassistant", "service": "turn_on", "service_data": {}, "target": { "device_id": [ "6e29c3c314df87528f187dbe4eb847d4" ] } }, "running_script": false } } ], "action/0/default/10": [ { "path": "action/0/default/10", "timestamp": "2026-01-14T15:49:11.554995+00:00" } ], "action/0/default/10/choose/0": [ { "path": "action/0/default/10/choose/0", "timestamp": "2026-01-14T15:49:11.555186+00:00", "result": { "result": false } } ], "action/0/default/10/choose/0/conditions/0": [ { "path": "action/0/default/10/choose/0/conditions/0", "timestamp": "2026-01-14T15:49:11.555403+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/11": [ { "path": "action/0/default/11", "timestamp": "2026-01-14T15:49:11.555900+00:00" } ], "action/0/default/11/choose/0": [ { "path": "action/0/default/11/choose/0", "timestamp": "2026-01-14T15:49:11.556030+00:00", "result": { "result": false } } ], "action/0/default/11/choose/0/conditions/0": [ { "path": "action/0/default/11/choose/0/conditions/0", "timestamp": "2026-01-14T15:49:11.556255+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/12": [ { "path": "action/0/default/12", "timestamp": "2026-01-14T15:49:11.556713+00:00" } ], "action/0/default/12/choose/0": [ { "path": "action/0/default/12/choose/0", "timestamp": "2026-01-14T15:49:11.556847+00:00", "result": { "result": false } } ], "action/0/default/12/choose/0/conditions/0": [ { "path": "action/0/default/12/choose/0/conditions/0", "timestamp": "2026-01-14T15:49:11.557053+00:00", "result": { "result": false } } ], "action/0/default/13": [ { "path": "action/0/default/13", "timestamp": "2026-01-14T15:49:11.557250+00:00", "changed_variables": { "wait": { "remaining": 0.0, "completed": false, "trigger": null } }, "result": { "result": false, "state": 0.01, "wanted_state_below": -1.0 } } ], "action/0/default/14": [ { "path": "action/0/default/14", "timestamp": "2026-01-14T16:09:11.558051+00:00" } ], "action/0/default/14/parallel/0/sequence/0": [ { "path": "action/0/default/14/parallel/0/sequence/0", "timestamp": "2026-01-14T16:09:11.558384+00:00", "result": { "delay": 600.0, "done": true } } ], "action/0/default/14/parallel/1/sequence/0": [ { "path": "action/0/default/14/parallel/1/sequence/0", "timestamp": "2026-01-14T16:09:11.558613+00:00" } ], "action/0/default/14/parallel/1/sequence/0/choose/0": [ { "path": "action/0/default/14/parallel/1/sequence/0/choose/0", "timestamp": "2026-01-14T16:09:11.558685+00:00", "changed_variables": { "this": { "entity_id": "automation.ventilator_badkamer_bp", "state": "on", "attributes": { "id": "1754461823733", "last_triggered": "2026-01-13T14:20:35.506075+00:00", "mode": "restart", "current": 0, "friendly_name": "Ventilator badkamer [BP]" }, "last_changed": "2026-01-14T15:48:56.985992+00:00", "last_reported": "2026-01-14T15:48:56.985992+00:00", "last_updated": "2026-01-14T15:48:56.985992+00:00", "context": { "id": "01KEYK47GSXCG0P0NN4SQ9B0RE", "parent_id": null, "user_id": null } }, "trigger": { "id": "t2", "idx": "2", "alias": null, "platform": "homeassistant", "event": "start", "description": "Home Assistant starting" }, "bathroom_humidity_sensor": [], "include_manual_trigger": "disable_manual_trigger", "manual_trigger": [], "manual_trigger_default_time_delay": 15, "manual_trigger_winter_time_delay": 15, "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "fan_speed_low": [], "fan_speed_off": [], "rising_humidity": 1, "falling_humidity": -1, "time_delay": 10, "time_out": 20, "include_max_humidity": "maximum_humidity_enabled", "max_humidity": 100, "include_fan_speed": "fan_speed_disabled", "time_delay_low_speed": 5, "include_winter_mode": "winter_mode_disabled", "month_winter_mode": [], "winter_rising_humidity": 1, "winter_falling_humidity": -1, "winter_time_delay": 10, "winter_time_out": 20, "winter_include_max_humidity": "maximum_humidity_disabled", "winter_max_humidity": 100, "winter_include_fan_speed": "fan_speed_disabled", "winter_time_delay_low_speed": 5, "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "light_time_delay": 10, "include_light_control": [], "light_brightness": 100, "brightness_value": false, "light_colour_temperature": 5000, "temperature_value": [], "light_transition_on": 1, "light_transition_off": 1, "transition_on_value": false, "transition_off_value": false, "include_manual_fan_switch": "disable_manual_fan_switch", "manual_fan_switch": [], "manual_fan_switch_time_delay": 10, "include_automation_link": "disable_automation_link", "automation_link": [], "automation_link_time_delay": 10, "include_bypass": "bypass_disabled", "by_pass": [], "bypass_options": [], "include_bypass_auto_off": "bypass_auto_off_disabled", "bypass_auto_off_delay": 60, "light_entities": [], "context": { "id": "01KEYK4NM87SN3RA08ZPHDTA2S", "parent_id": null, "user_id": null }, "wait": { "remaining": 0.0, "completed": false, "trigger": null } }, "result": { "result": false } } ], "action/0/default/14/parallel/1/sequence/0/choose/0/conditions/0": [ { "path": "action/0/default/14/parallel/1/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-14T16:09:11.558806+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/14/parallel/2/sequence/0": [ { "path": "action/0/default/14/parallel/2/sequence/0", "timestamp": "2026-01-14T16:09:11.559180+00:00" } ], "action/0/default/14/parallel/2/sequence/0/choose/0": [ { "path": "action/0/default/14/parallel/2/sequence/0/choose/0", "timestamp": "2026-01-14T16:09:11.559233+00:00", "changed_variables": { "this": { "entity_id": "automation.ventilator_badkamer_bp", "state": "on", "attributes": { "id": "1754461823733", "last_triggered": "2026-01-13T14:20:35.506075+00:00", "mode": "restart", "current": 0, "friendly_name": "Ventilator badkamer [BP]" }, "last_changed": "2026-01-14T15:48:56.985992+00:00", "last_reported": "2026-01-14T15:48:56.985992+00:00", "last_updated": "2026-01-14T15:48:56.985992+00:00", "context": { "id": "01KEYK47GSXCG0P0NN4SQ9B0RE", "parent_id": null, "user_id": null } }, "trigger": { "id": "t2", "idx": "2", "alias": null, "platform": "homeassistant", "event": "start", "description": "Home Assistant starting" }, "bathroom_humidity_sensor": [], "include_manual_trigger": "disable_manual_trigger", "manual_trigger": [], "manual_trigger_default_time_delay": 15, "manual_trigger_winter_time_delay": 15, "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "fan_speed_low": [], "fan_speed_off": [], "rising_humidity": 1, "falling_humidity": -1, "time_delay": 10, "time_out": 20, "include_max_humidity": "maximum_humidity_enabled", "max_humidity": 100, "include_fan_speed": "fan_speed_disabled", "time_delay_low_speed": 5, "include_winter_mode": "winter_mode_disabled", "month_winter_mode": [], "winter_rising_humidity": 1, "winter_falling_humidity": -1, "winter_time_delay": 10, "winter_time_out": 20, "winter_include_max_humidity": "maximum_humidity_disabled", "winter_max_humidity": 100, "winter_include_fan_speed": "fan_speed_disabled", "winter_time_delay_low_speed": 5, "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "light_time_delay": 10, "include_light_control": [], "light_brightness": 100, "brightness_value": false, "light_colour_temperature": 5000, "temperature_value": [], "light_transition_on": 1, "light_transition_off": 1, "transition_on_value": false, "transition_off_value": false, "include_manual_fan_switch": "disable_manual_fan_switch", "manual_fan_switch": [], "manual_fan_switch_time_delay": 10, "include_automation_link": "disable_automation_link", "automation_link": [], "automation_link_time_delay": 10, "include_bypass": "bypass_disabled", "by_pass": [], "bypass_options": [], "include_bypass_auto_off": "bypass_auto_off_disabled", "bypass_auto_off_delay": 60, "light_entities": [], "context": { "id": "01KEYK4NM87SN3RA08ZPHDTA2S", "parent_id": null, "user_id": null }, "wait": { "remaining": 0.0, "completed": false, "trigger": null } }, "result": { "result": false } } ], "action/0/default/14/parallel/2/sequence/0/choose/0/conditions/0": [ { "path": "action/0/default/14/parallel/2/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-14T16:09:11.559352+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/14/parallel/0/sequence/1": [ { "path": "action/0/default/14/parallel/0/sequence/1", "timestamp": "2026-01-14T16:19:11.559293+00:00", "result": { "params": { "domain": "homeassistant", "service": "turn_off", "service_data": {}, "target": { "device_id": [ "6e29c3c314df87528f187dbe4eb847d4" ] } }, "running_script": false } } ], "action/0/default/14/parallel/0/sequence/2": [ { "path": "action/0/default/14/parallel/0/sequence/2", "timestamp": "2026-01-14T16:19:11.647383+00:00" } ], "action/0/default/14/parallel/0/sequence/2/choose/0": [ { "path": "action/0/default/14/parallel/0/sequence/2/choose/0", "timestamp": "2026-01-14T16:19:11.647520+00:00", "changed_variables": { "this": { "entity_id": "automation.ventilator_badkamer_bp", "state": "on", "attributes": { "id": "1754461823733", "last_triggered": "2026-01-13T14:20:35.506075+00:00", "mode": "restart", "current": 0, "friendly_name": "Ventilator badkamer [BP]" }, "last_changed": "2026-01-14T15:48:56.985992+00:00", "last_reported": "2026-01-14T15:48:56.985992+00:00", "last_updated": "2026-01-14T15:48:56.985992+00:00", "context": { "id": "01KEYK47GSXCG0P0NN4SQ9B0RE", "parent_id": null, "user_id": null } }, "trigger": { "id": "t2", "idx": "2", "alias": null, "platform": "homeassistant", "event": "start", "description": "Home Assistant starting" }, "bathroom_humidity_sensor": [], "include_manual_trigger": "disable_manual_trigger", "manual_trigger": [], "manual_trigger_default_time_delay": 15, "manual_trigger_winter_time_delay": 15, "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "fan_speed_low": [], "fan_speed_off": [], "rising_humidity": 1, "falling_humidity": -1, "time_delay": 10, "time_out": 20, "include_max_humidity": "maximum_humidity_enabled", "max_humidity": 100, "include_fan_speed": "fan_speed_disabled", "time_delay_low_speed": 5, "include_winter_mode": "winter_mode_disabled", "month_winter_mode": [], "winter_rising_humidity": 1, "winter_falling_humidity": -1, "winter_time_delay": 10, "winter_time_out": 20, "winter_include_max_humidity": "maximum_humidity_disabled", "winter_max_humidity": 100, "winter_include_fan_speed": "fan_speed_disabled", "winter_time_delay_low_speed": 5, "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "light_time_delay": 10, "include_light_control": [], "light_brightness": 100, "brightness_value": false, "light_colour_temperature": 5000, "temperature_value": [], "light_transition_on": 1, "light_transition_off": 1, "transition_on_value": false, "transition_off_value": false, "include_manual_fan_switch": "disable_manual_fan_switch", "manual_fan_switch": [], "manual_fan_switch_time_delay": 10, "include_automation_link": "disable_automation_link", "automation_link": [], "automation_link_time_delay": 10, "include_bypass": "bypass_disabled", "by_pass": [], "bypass_options": [], "include_bypass_auto_off": "bypass_auto_off_disabled", "bypass_auto_off_delay": 60, "light_entities": [], "context": { "id": "01KEYK4NM87SN3RA08ZPHDTA2S", "parent_id": null, "user_id": null }, "wait": { "remaining": 0.0, "completed": false, "trigger": null } }, "result": { "result": false } } ], "action/0/default/14/parallel/0/sequence/2/choose/0/conditions/0": [ { "path": "action/0/default/14/parallel/0/sequence/2/choose/0/conditions/0", "timestamp": "2026-01-14T16:19:11.647830+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/14/parallel/0/sequence/2/choose/1": [ { "path": "action/0/default/14/parallel/0/sequence/2/choose/1", "timestamp": "2026-01-14T16:19:11.648336+00:00", "result": { "result": false } } ], "action/0/default/14/parallel/0/sequence/2/choose/1/conditions/0": [ { "path": "action/0/default/14/parallel/0/sequence/2/choose/1/conditions/0", "timestamp": "2026-01-14T16:19:11.648451+00:00", "result": { "result": false, "entities": [] } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "trigger": "sensor.badkamer_luchtvochtigheid", "bathroom_humidity_sensor": [], "include_manual_trigger": "disable_manual_trigger", "manual_trigger": [], "manual_trigger_default_time_delay": 15, "manual_trigger_winter_time_delay": 15, "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "fan_speed_low": [], "fan_speed_off": [], "rising_humidity": 1, "falling_humidity": -1, "time_delay": 10, "time_out": 20, "include_max_humidity": "maximum_humidity_enabled", "max_humidity": 100, "include_fan_speed": "fan_speed_disabled", "time_delay_low_speed": 5, "include_winter_mode": "winter_mode_disabled", "month_winter_mode": [], "winter_rising_humidity": 1, "winter_falling_humidity": -1, "winter_time_delay": 10, "winter_time_out": 20, "winter_include_max_humidity": "maximum_humidity_disabled", "winter_max_humidity": 100, "winter_include_fan_speed": "fan_speed_disabled", "winter_time_delay_low_speed": 5, "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "light_time_delay": 10, "include_light_control": [], "light_brightness": 100, "brightness_value": "{{ iif ('use_brightness' in include_light_control , light_brightness, ) }}", "light_colour_temperature": 5000, "temperature_value": "{{ iif ('use_colour_temperature' in include_light_control , light_colour_temperature, [] ) }}", "light_transition_on": 1, "light_transition_off": 1, "transition_on_value": "{{ iif ('use_transition' in include_light_control, light_transition_on, ) }}", "transition_off_value": "{{ iif ('use_transition' in include_light_control, light_transition_off, ) }}", "include_manual_fan_switch": "disable_manual_fan_switch", "manual_fan_switch": [], "manual_fan_switch_time_delay": 10, "include_automation_link": "disable_automation_link", "automation_link": [], "automation_link_time_delay": 10, "include_bypass": "bypass_disabled", "by_pass": [], "bypass_options": [], "include_bypass_auto_off": "bypass_auto_off_disabled", "bypass_auto_off_delay": 60, "light_entities": "{% set a = light_switch and light_switch.entity_id %} {% if a %}\n {{ expand(a) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}" }, "triggers": [ { "trigger": "numeric_state", "id": "t0", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" }, { "trigger": "numeric_state", "id": "t1", "entity_id": [], "above": 100, "below": "100" }, { "trigger": "homeassistant", "id": "t2", "event": "start" }, { "trigger": "numeric_state", "id": "t3", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" }, { "trigger": "numeric_state", "id": "t4", "entity_id": [], "above": 100, "below": "100" }, { "trigger": "state", "id": "t5", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t6", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "state", "id": "t7", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t8", "entity_id": [], "from": "off", "to": "on" } ], "actions": [ { "choose": [ { "alias": "For winter mode when enabled and within the set winter months", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t0", "t1" ] } ] }, { "condition": "and", "conditions": [ "{{ include_winter_mode == 'winter_mode_enabled' }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "trigger", "id": [ "t2", "t5", "t6", "t7", "t8" ] } ] } ] } ], "sequence": [ { "choose": [ { "alias": "By-pass is turned on & check by-pass option - turn fan off", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned on & check by-pass option - keep the current fan state", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_stop' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & preform the correct action", "conditions": [ { "condition": "trigger", "id": "t6" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check by-pass options - turn fan off is enabled", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is below falling humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is below falling", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is above winter rising humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is above rising", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'off') | list | count > 0)) }}", { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "We need something here to continue", "delay": { "milliseconds": 10 } } ] } ], "default": [ { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Preform the manual fan switch option", "conditions": [ { "condition": "trigger", "id": "t7" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] }, { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the run on timer is switch is on", "conditions": [ "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Preform the manual trigger option", "conditions": [ { "condition": "trigger", "id": "t8" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check manual trigger with safeguard is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Wait until the time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait until the low speed time delay passes", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled and the lights are ON", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the light time delay has passes", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the automation link time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] }, { "choose": [ { "alias": "Safeguard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t2" } ], "sequence": [ { "choose": [ { "alias": "Check manual trigger with safeguard is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "choose": [ { "alias": "Check manual fan switch is enabled and manual switch is ON", "conditions": [ { "alias": "Check if the humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "template", "value_template": "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' or include_manual_fan_switch == 'enable_manual_fan_switch' }}" }, "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "choose": [ { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] }, { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the run on timer is switch is on", "conditions": [ "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the winter humidity derivative sensor is below falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the winter humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) }}", "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or (include_lights == 'lights_disabled') }}", "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) or (include_automation_link == 'disable_automation_link') }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - turn fan on", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_turn_on' }}" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] } ] } ], "default": [ { "alias": "Check if the triggers", "condition": "trigger", "id": [ "t2", "t3", "t4", "t5", "t6", "t7", "t8" ] }, { "choose": [ { "alias": "By-pass is turned on & check by-pass option - turn fan off", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned on & check by-pass option - keep the current fan state", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_stop' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & check if the sensor is below falling humidity", "conditions": [ { "condition": "trigger", "id": "t6" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check by-pass options - turn fan off is enabled", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is below falling humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is below falling", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is above rising humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is above rising", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'off') | list | count > 0)) }}", { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "We need something here to continue", "delay": { "milliseconds": 10 } } ] } ], "default": [ { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Preform the manual fan switch option", "conditions": [ { "condition": "trigger", "id": "t7" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] }, { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Preform the manual trigger option", "conditions": [ { "condition": "trigger", "id": "t8" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check manual trigger with safeguard is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Wait until the time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait until the low speed time delay passes", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled and the lights are ON", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the light time delay has passes", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the automation link time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] }, { "choose": [ { "alias": "Safeguard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t2" } ], "sequence": [ { "choose": [ { "alias": "Check manual trigger with safeguard is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "choose": [ { "alias": "Check manual fan switch is enabled and manual switch is ON", "conditions": [ { "alias": "Check if the humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "template", "value_template": "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' or include_manual_fan_switch == 'enable_manual_fan_switch' }}" }, "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "choose": [ { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] }, { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the humidity derivative sensor is below falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) }}", "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or (include_lights == 'lights_disabled') }}", "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) or (include_automation_link == 'disable_automation_link') }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - turn fan on", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_turn_on' }}" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] } ] } ], "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ include_winter_mode == 'winter_mode_enabled' }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "trigger", "id": "t0" } ] }, { "condition": "and", "conditions": [ "{{ (include_winter_mode == 'winter_mode_enabled') and (winter_include_max_humidity == 'maximum_humidity_enabled') }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "trigger", "id": "t1" } ] }, { "condition": "and", "conditions": [ "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "trigger", "id": "t2" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_disabled' in include_winter_mode }}", { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", { "condition": "template", "value_template": "{{ (now().month | string not in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_disabled' in include_winter_mode }}", "{{ 'maximum_humidity_enabled' in include_max_humidity }}", { "condition": "numeric_state", "entity_id": [], "above": 100, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ 'maximum_humidity_enabled' in include_max_humidity }}", { "condition": "template", "value_template": "{{ (now().month | string not in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": [], "above": 100, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ 'maximum_humidity_enabled' in winter_include_max_humidity }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": [], "above": 100, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ (include_winter_mode == 'winter_mode_disabled') or ((include_winter_mode == 'winter_mode_enabled') and not (now().month | string in month_winter_mode )) }}" }, { "condition": "trigger", "id": "t3" } ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ ((include_winter_mode == 'winter_mode_disabled') and (include_max_humidity == 'maximum_humidity_enabled')) or ((include_winter_mode == 'winter_mode_enabled') and (include_max_humidity == 'maximum_humidity_enabled') and not (now().month | string in month_winter_mode )) }}" }, { "condition": "trigger", "id": "t4" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t5" }, "{{ (include_bypass == 'bypass_enabled_turn_on') or (include_bypass == 'bypass_enabled') or (include_bypass == 'bypass_enabled_stop') }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t6" }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ (include_bypass == 'bypass_enabled') or (include_bypass == 'bypass_enabled_stop') or (include_bypass == 'bypass_enabled_turn_on') }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0 ) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') and (expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0)) }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t6" ] }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ 'winter_mode_disabled' in include_winter_mode }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0))}}", { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t6" ] }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "template", "value_template": "{{ (now().month | string not in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t6" ] }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "trigger", "id": [ "t7" ] }, "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}" ] }, { "condition": "and", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "trigger", "id": [ "t8" ] }, "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}" ] } ] }, { "condition": "or", "conditions": [ "{{ include_bypass == 'bypass_disabled' }}", "{{ by_pass == [] }}", "{{ (include_bypass == 'bypass_enabled_turn_on') and (states[by_pass].state == 'off') }}", "{{ (include_bypass == 'bypass_enabled') and (states[by_pass].state == 'off') }}", "{{ (include_bypass == 'bypass_enabled_stop') and (states[by_pass].state == 'off') }}", "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'off') }}", "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') and (trigger.id == 't2') }}", { "condition": "trigger", "id": "t5" } ] } ], "id": "1754461823733", "alias": "Ventilator badkamer [BP]", "description": "" }, "blueprint_inputs": { "id": "1754461823733", "alias": "Ventilator badkamer [BP]", "description": "", "use_blueprint": { "path": "Blackshome/bathroom-humidity-exhaust-fan.yaml", "input": { "trigger": "sensor.badkamer_luchtvochtigheid", "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "include_max_humidity": "maximum_humidity_enabled", "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "include_manual_fan_switch": "disable_manual_fan_switch" } } }, "context": { "id": "01KEYK4NM87SN3RA08ZPHDTA2S", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "action/0/default/14/parallel/0/sequence/2/choose/1/conditions/0", "run_id": "c28b21db4fa0072b256af93a89217fa3", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T15:49:11.432781+00:00", "finish": "2026-01-14T16:19:11.650254+00:00" }, "domain": "automation", "item_id": "1754461823733", "trigger": "Home Assistant starting" } }, { "extended_dict": { "last_step": "action/0/default/14/parallel/0/sequence/2/choose/1/conditions/0", "run_id": "1453f4fd8da38bfa8ebc44c104d990a5", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-15T08:04:28.856074+00:00", "finish": "2026-01-15T08:34:29.167504+00:00" }, "domain": "automation", "item_id": "1754461823733", "trigger": "Home Assistant starting", "trace": { "trigger/2": [ { "path": "trigger/2", "timestamp": "2026-01-15T08:04:28.857513+00:00", "changed_variables": { "this": { "entity_id": "automation.ventilator_badkamer_bp", "state": "on", "attributes": { "id": "1754461823733", "last_triggered": "2026-01-14T15:49:11.435499+00:00", "mode": "restart", "current": 0, "friendly_name": "Ventilator badkamer [BP]" }, "last_changed": "2026-01-15T08:04:17.789422+00:00", "last_reported": "2026-01-15T08:04:17.789422+00:00", "last_updated": "2026-01-15T08:04:17.789422+00:00", "context": { "id": "01KF0AY4QXEV6WVCY87SD8STEM", "parent_id": null, "user_id": null } }, "trigger": { "id": "t2", "idx": "2", "alias": null, "platform": "homeassistant", "event": "start", "description": "Home Assistant starting" }, "bathroom_humidity_sensor": [], "include_manual_trigger": "disable_manual_trigger", "manual_trigger": [], "manual_trigger_default_time_delay": 15, "manual_trigger_winter_time_delay": 15, "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "fan_speed_low": [], "fan_speed_off": [], "rising_humidity": 1, "falling_humidity": -1, "time_delay": 10, "time_out": 20, "include_max_humidity": "maximum_humidity_enabled", "max_humidity": 100, "include_fan_speed": "fan_speed_disabled", "time_delay_low_speed": 5, "include_winter_mode": "winter_mode_disabled", "month_winter_mode": [], "winter_rising_humidity": 1, "winter_falling_humidity": -1, "winter_time_delay": 10, "winter_time_out": 20, "winter_include_max_humidity": "maximum_humidity_disabled", "winter_max_humidity": 100, "winter_include_fan_speed": "fan_speed_disabled", "winter_time_delay_low_speed": 5, "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "light_time_delay": 10, "include_light_control": [], "light_brightness": 100, "brightness_value": false, "light_colour_temperature": 5000, "temperature_value": [], "light_transition_on": 1, "light_transition_off": 1, "transition_on_value": false, "transition_off_value": false, "include_manual_fan_switch": "disable_manual_fan_switch", "manual_fan_switch": [], "manual_fan_switch_time_delay": 10, "include_automation_link": "disable_automation_link", "automation_link": [], "automation_link_time_delay": 10, "include_bypass": "bypass_disabled", "by_pass": [], "bypass_options": [], "include_bypass_auto_off": "bypass_auto_off_disabled", "bypass_auto_off_delay": 60, "light_entities": [] } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-15T08:04:28.857542+00:00", "result": { "result": true } } ], "condition/0/conditions/0": [ { "path": "condition/0/conditions/0", "timestamp": "2026-01-15T08:04:28.857561+00:00", "result": { "result": false } } ], "condition/0/conditions/0/conditions/0": [ { "path": "condition/0/conditions/0/conditions/0", "timestamp": "2026-01-15T08:04:28.857574+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/1": [ { "path": "condition/0/conditions/1", "timestamp": "2026-01-15T08:04:28.857650+00:00", "result": { "result": false } } ], "condition/0/conditions/1/conditions/0": [ { "path": "condition/0/conditions/1/conditions/0", "timestamp": "2026-01-15T08:04:28.857703+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/2": [ { "path": "condition/0/conditions/2", "timestamp": "2026-01-15T08:04:28.857811+00:00", "error": "In 'and' (item 1 of 2):\n In 'template' condition: UndefinedError: 'dict object' has no attribute 'entity_id'" } ], "condition/0/conditions/2/conditions/0": [ { "path": "condition/0/conditions/2/conditions/0", "timestamp": "2026-01-15T08:04:28.857834+00:00", "error": "In 'template' condition: UndefinedError: 'dict object' has no attribute 'entity_id'" } ], "condition/0/conditions/2/conditions/1": [ { "path": "condition/0/conditions/2/conditions/1", "timestamp": "2026-01-15T08:04:28.858084+00:00", "result": { "result": true } } ], "condition/0/conditions/3": [ { "path": "condition/0/conditions/3", "timestamp": "2026-01-15T08:04:28.859004+00:00", "result": { "result": false } } ], "condition/0/conditions/3/conditions/0": [ { "path": "condition/0/conditions/3/conditions/0", "timestamp": "2026-01-15T08:04:28.859035+00:00", "result": { "result": true } } ], "condition/0/conditions/3/conditions/1": [ { "path": "condition/0/conditions/3/conditions/1", "timestamp": "2026-01-15T08:04:28.859072+00:00", "result": { "result": true, "entities": [] } } ], "condition/0/conditions/3/conditions/2": [ { "path": "condition/0/conditions/3/conditions/2", "timestamp": "2026-01-15T08:04:28.859208+00:00", "result": { "result": false } } ], "condition/0/conditions/3/conditions/2/entity_id/0": [ { "path": "condition/0/conditions/3/conditions/2/entity_id/0", "timestamp": "2026-01-15T08:04:28.859223+00:00", "result": { "result": false, "state": 0.0, "wanted_state_above": 1.0 } } ], "condition/0/conditions/4": [ { "path": "condition/0/conditions/4", "timestamp": "2026-01-15T08:04:28.859247+00:00", "result": { "result": false } } ], "condition/0/conditions/4/conditions/0": [ { "path": "condition/0/conditions/4/conditions/0", "timestamp": "2026-01-15T08:04:28.859256+00:00", "result": { "result": true } } ], "condition/0/conditions/4/conditions/1": [ { "path": "condition/0/conditions/4/conditions/1", "timestamp": "2026-01-15T08:04:28.859268+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/5": [ { "path": "condition/0/conditions/5", "timestamp": "2026-01-15T08:04:28.859328+00:00", "result": { "result": false } } ], "condition/0/conditions/5/conditions/0": [ { "path": "condition/0/conditions/5/conditions/0", "timestamp": "2026-01-15T08:04:28.859338+00:00", "result": { "result": true } } ], "condition/0/conditions/5/conditions/1": [ { "path": "condition/0/conditions/5/conditions/1", "timestamp": "2026-01-15T08:04:28.859349+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/6": [ { "path": "condition/0/conditions/6", "timestamp": "2026-01-15T08:04:28.859403+00:00", "result": { "result": true } } ], "condition/0/conditions/6/conditions/0": [ { "path": "condition/0/conditions/6/conditions/0", "timestamp": "2026-01-15T08:04:28.859412+00:00", "result": { "result": true } } ], "condition/0/conditions/6/conditions/1": [ { "path": "condition/0/conditions/6/conditions/1", "timestamp": "2026-01-15T08:04:28.859424+00:00", "result": { "result": true, "entities": [] } } ], "condition/0/conditions/6/conditions/2": [ { "path": "condition/0/conditions/6/conditions/2", "timestamp": "2026-01-15T08:04:28.859474+00:00", "result": { "result": true, "entities": [] } } ], "condition/0/conditions/6/conditions/3": [ { "path": "condition/0/conditions/6/conditions/3", "timestamp": "2026-01-15T08:04:28.859521+00:00", "result": { "result": true } } ], "condition/1": [ { "path": "condition/1", "timestamp": "2026-01-15T08:04:28.859540+00:00", "result": { "result": true } } ], "condition/1/conditions/0": [ { "path": "condition/1/conditions/0", "timestamp": "2026-01-15T08:04:28.859550+00:00", "result": { "result": true, "entities": [] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-15T08:04:28.859892+00:00", "changed_variables": { "context": { "id": "01KF0AYFHRKF4AGATHJXPTWD9V", "parent_id": null, "user_id": null }, "wait": { "remaining": 0.0, "completed": false, "trigger": null } }, "result": { "choice": "default" } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-15T08:04:28.860055+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-15T08:04:28.860153+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0/conditions/0", "timestamp": "2026-01-15T08:04:28.860262+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0/conditions/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0/conditions/0/conditions/0", "timestamp": "2026-01-15T08:04:28.860339+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0/conditions/1": [ { "path": "action/0/choose/0/conditions/0/conditions/1", "timestamp": "2026-01-15T08:04:28.860480+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0/conditions/1/conditions/0": [ { "path": "action/0/choose/0/conditions/0/conditions/1/conditions/0", "timestamp": "2026-01-15T08:04:28.860715+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/0": [ { "path": "action/0/default/0", "timestamp": "2026-01-15T08:04:28.861071+00:00", "result": { "result": true } } ], "action/0/default/1": [ { "path": "action/0/default/1", "timestamp": "2026-01-15T08:04:28.861209+00:00" } ], "action/0/default/1/choose/0": [ { "path": "action/0/default/1/choose/0", "timestamp": "2026-01-15T08:04:28.861313+00:00", "result": { "result": false } } ], "action/0/default/1/choose/0/conditions/0": [ { "path": "action/0/default/1/choose/0/conditions/0", "timestamp": "2026-01-15T08:04:28.861397+00:00", "result": { "result": false } } ], "action/0/default/1/choose/1": [ { "path": "action/0/default/1/choose/1", "timestamp": "2026-01-15T08:04:28.861485+00:00", "result": { "result": false } } ], "action/0/default/1/choose/1/conditions/0": [ { "path": "action/0/default/1/choose/1/conditions/0", "timestamp": "2026-01-15T08:04:28.861562+00:00", "result": { "result": false } } ], "action/0/default/2": [ { "path": "action/0/default/2", "timestamp": "2026-01-15T08:04:28.861712+00:00" } ], "action/0/default/2/choose/0": [ { "path": "action/0/default/2/choose/0", "timestamp": "2026-01-15T08:04:28.861794+00:00", "result": { "result": false } } ], "action/0/default/2/choose/0/conditions/0": [ { "path": "action/0/default/2/choose/0/conditions/0", "timestamp": "2026-01-15T08:04:28.861873+00:00", "result": { "result": false } } ], "action/0/default/3": [ { "path": "action/0/default/3", "timestamp": "2026-01-15T08:04:28.861987+00:00" } ], "action/0/default/3/choose/0": [ { "path": "action/0/default/3/choose/0", "timestamp": "2026-01-15T08:04:28.862064+00:00", "result": { "result": false } } ], "action/0/default/3/choose/0/conditions/0": [ { "path": "action/0/default/3/choose/0/conditions/0", "timestamp": "2026-01-15T08:04:28.862142+00:00", "result": { "result": false } } ], "action/0/default/3/choose/1": [ { "path": "action/0/default/3/choose/1", "timestamp": "2026-01-15T08:04:28.862237+00:00", "result": { "result": false } } ], "action/0/default/3/choose/1/conditions/0": [ { "path": "action/0/default/3/choose/1/conditions/0", "timestamp": "2026-01-15T08:04:28.862312+00:00", "result": { "result": false } } ], "action/0/default/4": [ { "path": "action/0/default/4", "timestamp": "2026-01-15T08:04:28.862425+00:00", "result": { "choice": 0 } } ], "action/0/default/4/choose/0": [ { "path": "action/0/default/4/choose/0", "timestamp": "2026-01-15T08:04:28.862487+00:00", "result": { "result": true } } ], "action/0/default/4/choose/0/conditions/0": [ { "path": "action/0/default/4/choose/0/conditions/0", "timestamp": "2026-01-15T08:04:28.862565+00:00", "result": { "result": true } } ], "action/0/default/4/choose/0/sequence/0": [ { "path": "action/0/default/4/choose/0/sequence/0", "timestamp": "2026-01-15T08:04:28.862744+00:00" } ], "action/0/default/4/choose/0/sequence/0/choose/0": [ { "path": "action/0/default/4/choose/0/sequence/0/choose/0", "timestamp": "2026-01-15T08:04:28.863055+00:00", "result": { "result": false } } ], "action/0/default/4/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/default/4/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-15T08:04:28.863140+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/4/choose/0/sequence/0/choose/1": [ { "path": "action/0/default/4/choose/0/sequence/0/choose/1", "timestamp": "2026-01-15T08:04:28.863333+00:00", "result": { "result": false } } ], "action/0/default/4/choose/0/sequence/0/choose/1/conditions/0": [ { "path": "action/0/default/4/choose/0/sequence/0/choose/1/conditions/0", "timestamp": "2026-01-15T08:04:28.863413+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/4/choose/0/sequence/1": [ { "path": "action/0/default/4/choose/0/sequence/1", "timestamp": "2026-01-15T08:04:28.863613+00:00" } ], "action/0/default/4/choose/0/sequence/1/choose/0": [ { "path": "action/0/default/4/choose/0/sequence/1/choose/0", "timestamp": "2026-01-15T08:04:28.863809+00:00", "result": { "result": false } } ], "action/0/default/4/choose/0/sequence/1/choose/0/conditions/0": [ { "path": "action/0/default/4/choose/0/sequence/1/choose/0/conditions/0", "timestamp": "2026-01-15T08:04:28.863893+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/4/choose/0/sequence/1/choose/1": [ { "path": "action/0/default/4/choose/0/sequence/1/choose/1", "timestamp": "2026-01-15T08:04:28.864504+00:00", "result": { "result": false } } ], "action/0/default/4/choose/0/sequence/1/choose/1/conditions/0": [ { "path": "action/0/default/4/choose/0/sequence/1/choose/1/conditions/0", "timestamp": "2026-01-15T08:04:28.864592+00:00", "result": { "result": false } } ], "action/0/default/4/choose/0/sequence/1/choose/1/conditions/0/entity_id/0": [ { "path": "action/0/default/4/choose/0/sequence/1/choose/1/conditions/0/entity_id/0", "timestamp": "2026-01-15T08:04:28.864675+00:00", "result": { "result": false, "state": 0.0, "wanted_state_below": -1.0 } } ], "action/0/default/4/choose/0/sequence/1/choose/2": [ { "path": "action/0/default/4/choose/0/sequence/1/choose/2", "timestamp": "2026-01-15T08:04:28.864808+00:00", "result": { "result": false } } ], "action/0/default/4/choose/0/sequence/1/choose/2/conditions/0": [ { "path": "action/0/default/4/choose/0/sequence/1/choose/2/conditions/0", "timestamp": "2026-01-15T08:04:28.864885+00:00", "result": { "result": false } } ], "action/0/default/4/choose/0/sequence/1/choose/2/conditions/0/entity_id/0": [ { "path": "action/0/default/4/choose/0/sequence/1/choose/2/conditions/0/entity_id/0", "timestamp": "2026-01-15T08:04:28.864959+00:00", "result": { "result": false, "state": 0.0, "wanted_state_above": 1.0 } } ], "action/0/default/5": [ { "path": "action/0/default/5", "timestamp": "2026-01-15T08:04:28.865149+00:00" } ], "action/0/default/5/choose/0": [ { "path": "action/0/default/5/choose/0", "timestamp": "2026-01-15T08:04:28.865248+00:00", "result": { "result": false } } ], "action/0/default/5/choose/0/conditions/0": [ { "path": "action/0/default/5/choose/0/conditions/0", "timestamp": "2026-01-15T08:04:28.865329+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/6": [ { "path": "action/0/default/6", "timestamp": "2026-01-15T08:04:28.865536+00:00" } ], "action/0/default/6/choose/0": [ { "path": "action/0/default/6/choose/0", "timestamp": "2026-01-15T08:04:28.865614+00:00", "result": { "result": false } } ], "action/0/default/6/choose/0/conditions/0": [ { "path": "action/0/default/6/choose/0/conditions/0", "timestamp": "2026-01-15T08:04:28.865739+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/7": [ { "path": "action/0/default/7", "timestamp": "2026-01-15T08:04:28.865942+00:00" } ], "action/0/default/7/choose/0": [ { "path": "action/0/default/7/choose/0", "timestamp": "2026-01-15T08:04:28.866009+00:00", "result": { "result": false } } ], "action/0/default/7/choose/0/conditions/0": [ { "path": "action/0/default/7/choose/0/conditions/0", "timestamp": "2026-01-15T08:04:28.866087+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/8": [ { "path": "action/0/default/8", "timestamp": "2026-01-15T08:04:28.866296+00:00" } ], "action/0/default/8/choose/0": [ { "path": "action/0/default/8/choose/0", "timestamp": "2026-01-15T08:04:28.866363+00:00", "result": { "result": false } } ], "action/0/default/8/choose/0/conditions/0": [ { "path": "action/0/default/8/choose/0/conditions/0", "timestamp": "2026-01-15T08:04:28.866443+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/9": [ { "path": "action/0/default/9", "timestamp": "2026-01-15T08:04:28.866642+00:00", "result": { "params": { "domain": "homeassistant", "service": "turn_on", "service_data": {}, "target": { "device_id": [ "6e29c3c314df87528f187dbe4eb847d4" ] } }, "running_script": false } } ], "action/0/default/10": [ { "path": "action/0/default/10", "timestamp": "2026-01-15T08:04:29.131047+00:00" } ], "action/0/default/10/choose/0": [ { "path": "action/0/default/10/choose/0", "timestamp": "2026-01-15T08:04:29.131223+00:00", "result": { "result": false } } ], "action/0/default/10/choose/0/conditions/0": [ { "path": "action/0/default/10/choose/0/conditions/0", "timestamp": "2026-01-15T08:04:29.131425+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/11": [ { "path": "action/0/default/11", "timestamp": "2026-01-15T08:04:29.131694+00:00" } ], "action/0/default/11/choose/0": [ { "path": "action/0/default/11/choose/0", "timestamp": "2026-01-15T08:04:29.131787+00:00", "result": { "result": false } } ], "action/0/default/11/choose/0/conditions/0": [ { "path": "action/0/default/11/choose/0/conditions/0", "timestamp": "2026-01-15T08:04:29.131869+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/12": [ { "path": "action/0/default/12", "timestamp": "2026-01-15T08:04:29.132074+00:00" } ], "action/0/default/12/choose/0": [ { "path": "action/0/default/12/choose/0", "timestamp": "2026-01-15T08:04:29.132149+00:00", "result": { "result": false } } ], "action/0/default/12/choose/0/conditions/0": [ { "path": "action/0/default/12/choose/0/conditions/0", "timestamp": "2026-01-15T08:04:29.132248+00:00", "result": { "result": false } } ], "action/0/default/13": [ { "path": "action/0/default/13", "timestamp": "2026-01-15T08:04:29.132372+00:00", "changed_variables": { "wait": { "remaining": 0.0, "completed": false, "trigger": null } }, "result": { "result": false, "state": 0.0, "wanted_state_below": -1.0 } } ], "action/0/default/14": [ { "path": "action/0/default/14", "timestamp": "2026-01-15T08:24:29.133544+00:00" } ], "action/0/default/14/parallel/0/sequence/0": [ { "path": "action/0/default/14/parallel/0/sequence/0", "timestamp": "2026-01-15T08:24:29.133817+00:00", "result": { "delay": 600.0, "done": true } } ], "action/0/default/14/parallel/1/sequence/0": [ { "path": "action/0/default/14/parallel/1/sequence/0", "timestamp": "2026-01-15T08:24:29.134053+00:00" } ], "action/0/default/14/parallel/1/sequence/0/choose/0": [ { "path": "action/0/default/14/parallel/1/sequence/0/choose/0", "timestamp": "2026-01-15T08:24:29.134133+00:00", "changed_variables": { "this": { "entity_id": "automation.ventilator_badkamer_bp", "state": "on", "attributes": { "id": "1754461823733", "last_triggered": "2026-01-14T15:49:11.435499+00:00", "mode": "restart", "current": 0, "friendly_name": "Ventilator badkamer [BP]" }, "last_changed": "2026-01-15T08:04:17.789422+00:00", "last_reported": "2026-01-15T08:04:17.789422+00:00", "last_updated": "2026-01-15T08:04:17.789422+00:00", "context": { "id": "01KF0AY4QXEV6WVCY87SD8STEM", "parent_id": null, "user_id": null } }, "trigger": { "id": "t2", "idx": "2", "alias": null, "platform": "homeassistant", "event": "start", "description": "Home Assistant starting" }, "bathroom_humidity_sensor": [], "include_manual_trigger": "disable_manual_trigger", "manual_trigger": [], "manual_trigger_default_time_delay": 15, "manual_trigger_winter_time_delay": 15, "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "fan_speed_low": [], "fan_speed_off": [], "rising_humidity": 1, "falling_humidity": -1, "time_delay": 10, "time_out": 20, "include_max_humidity": "maximum_humidity_enabled", "max_humidity": 100, "include_fan_speed": "fan_speed_disabled", "time_delay_low_speed": 5, "include_winter_mode": "winter_mode_disabled", "month_winter_mode": [], "winter_rising_humidity": 1, "winter_falling_humidity": -1, "winter_time_delay": 10, "winter_time_out": 20, "winter_include_max_humidity": "maximum_humidity_disabled", "winter_max_humidity": 100, "winter_include_fan_speed": "fan_speed_disabled", "winter_time_delay_low_speed": 5, "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "light_time_delay": 10, "include_light_control": [], "light_brightness": 100, "brightness_value": false, "light_colour_temperature": 5000, "temperature_value": [], "light_transition_on": 1, "light_transition_off": 1, "transition_on_value": false, "transition_off_value": false, "include_manual_fan_switch": "disable_manual_fan_switch", "manual_fan_switch": [], "manual_fan_switch_time_delay": 10, "include_automation_link": "disable_automation_link", "automation_link": [], "automation_link_time_delay": 10, "include_bypass": "bypass_disabled", "by_pass": [], "bypass_options": [], "include_bypass_auto_off": "bypass_auto_off_disabled", "bypass_auto_off_delay": 60, "light_entities": [], "context": { "id": "01KF0AYFHRKF4AGATHJXPTWD9V", "parent_id": null, "user_id": null }, "wait": { "remaining": 0.0, "completed": false, "trigger": null } }, "result": { "result": false } } ], "action/0/default/14/parallel/1/sequence/0/choose/0/conditions/0": [ { "path": "action/0/default/14/parallel/1/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-15T08:24:29.134284+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/14/parallel/2/sequence/0": [ { "path": "action/0/default/14/parallel/2/sequence/0", "timestamp": "2026-01-15T08:24:29.134654+00:00" } ], "action/0/default/14/parallel/2/sequence/0/choose/0": [ { "path": "action/0/default/14/parallel/2/sequence/0/choose/0", "timestamp": "2026-01-15T08:24:29.134709+00:00", "changed_variables": { "this": { "entity_id": "automation.ventilator_badkamer_bp", "state": "on", "attributes": { "id": "1754461823733", "last_triggered": "2026-01-14T15:49:11.435499+00:00", "mode": "restart", "current": 0, "friendly_name": "Ventilator badkamer [BP]" }, "last_changed": "2026-01-15T08:04:17.789422+00:00", "last_reported": "2026-01-15T08:04:17.789422+00:00", "last_updated": "2026-01-15T08:04:17.789422+00:00", "context": { "id": "01KF0AY4QXEV6WVCY87SD8STEM", "parent_id": null, "user_id": null } }, "trigger": { "id": "t2", "idx": "2", "alias": null, "platform": "homeassistant", "event": "start", "description": "Home Assistant starting" }, "bathroom_humidity_sensor": [], "include_manual_trigger": "disable_manual_trigger", "manual_trigger": [], "manual_trigger_default_time_delay": 15, "manual_trigger_winter_time_delay": 15, "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "fan_speed_low": [], "fan_speed_off": [], "rising_humidity": 1, "falling_humidity": -1, "time_delay": 10, "time_out": 20, "include_max_humidity": "maximum_humidity_enabled", "max_humidity": 100, "include_fan_speed": "fan_speed_disabled", "time_delay_low_speed": 5, "include_winter_mode": "winter_mode_disabled", "month_winter_mode": [], "winter_rising_humidity": 1, "winter_falling_humidity": -1, "winter_time_delay": 10, "winter_time_out": 20, "winter_include_max_humidity": "maximum_humidity_disabled", "winter_max_humidity": 100, "winter_include_fan_speed": "fan_speed_disabled", "winter_time_delay_low_speed": 5, "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "light_time_delay": 10, "include_light_control": [], "light_brightness": 100, "brightness_value": false, "light_colour_temperature": 5000, "temperature_value": [], "light_transition_on": 1, "light_transition_off": 1, "transition_on_value": false, "transition_off_value": false, "include_manual_fan_switch": "disable_manual_fan_switch", "manual_fan_switch": [], "manual_fan_switch_time_delay": 10, "include_automation_link": "disable_automation_link", "automation_link": [], "automation_link_time_delay": 10, "include_bypass": "bypass_disabled", "by_pass": [], "bypass_options": [], "include_bypass_auto_off": "bypass_auto_off_disabled", "bypass_auto_off_delay": 60, "light_entities": [], "context": { "id": "01KF0AYFHRKF4AGATHJXPTWD9V", "parent_id": null, "user_id": null }, "wait": { "remaining": 0.0, "completed": false, "trigger": null } }, "result": { "result": false } } ], "action/0/default/14/parallel/2/sequence/0/choose/0/conditions/0": [ { "path": "action/0/default/14/parallel/2/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-15T08:24:29.134828+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/14/parallel/0/sequence/1": [ { "path": "action/0/default/14/parallel/0/sequence/1", "timestamp": "2026-01-15T08:34:29.134656+00:00", "result": { "params": { "domain": "homeassistant", "service": "turn_off", "service_data": {}, "target": { "device_id": [ "6e29c3c314df87528f187dbe4eb847d4" ] } }, "running_script": false } } ], "action/0/default/14/parallel/0/sequence/2": [ { "path": "action/0/default/14/parallel/0/sequence/2", "timestamp": "2026-01-15T08:34:29.165119+00:00" } ], "action/0/default/14/parallel/0/sequence/2/choose/0": [ { "path": "action/0/default/14/parallel/0/sequence/2/choose/0", "timestamp": "2026-01-15T08:34:29.165277+00:00", "changed_variables": { "this": { "entity_id": "automation.ventilator_badkamer_bp", "state": "on", "attributes": { "id": "1754461823733", "last_triggered": "2026-01-14T15:49:11.435499+00:00", "mode": "restart", "current": 0, "friendly_name": "Ventilator badkamer [BP]" }, "last_changed": "2026-01-15T08:04:17.789422+00:00", "last_reported": "2026-01-15T08:04:17.789422+00:00", "last_updated": "2026-01-15T08:04:17.789422+00:00", "context": { "id": "01KF0AY4QXEV6WVCY87SD8STEM", "parent_id": null, "user_id": null } }, "trigger": { "id": "t2", "idx": "2", "alias": null, "platform": "homeassistant", "event": "start", "description": "Home Assistant starting" }, "bathroom_humidity_sensor": [], "include_manual_trigger": "disable_manual_trigger", "manual_trigger": [], "manual_trigger_default_time_delay": 15, "manual_trigger_winter_time_delay": 15, "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "fan_speed_low": [], "fan_speed_off": [], "rising_humidity": 1, "falling_humidity": -1, "time_delay": 10, "time_out": 20, "include_max_humidity": "maximum_humidity_enabled", "max_humidity": 100, "include_fan_speed": "fan_speed_disabled", "time_delay_low_speed": 5, "include_winter_mode": "winter_mode_disabled", "month_winter_mode": [], "winter_rising_humidity": 1, "winter_falling_humidity": -1, "winter_time_delay": 10, "winter_time_out": 20, "winter_include_max_humidity": "maximum_humidity_disabled", "winter_max_humidity": 100, "winter_include_fan_speed": "fan_speed_disabled", "winter_time_delay_low_speed": 5, "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "light_time_delay": 10, "include_light_control": [], "light_brightness": 100, "brightness_value": false, "light_colour_temperature": 5000, "temperature_value": [], "light_transition_on": 1, "light_transition_off": 1, "transition_on_value": false, "transition_off_value": false, "include_manual_fan_switch": "disable_manual_fan_switch", "manual_fan_switch": [], "manual_fan_switch_time_delay": 10, "include_automation_link": "disable_automation_link", "automation_link": [], "automation_link_time_delay": 10, "include_bypass": "bypass_disabled", "by_pass": [], "bypass_options": [], "include_bypass_auto_off": "bypass_auto_off_disabled", "bypass_auto_off_delay": 60, "light_entities": [], "context": { "id": "01KF0AYFHRKF4AGATHJXPTWD9V", "parent_id": null, "user_id": null }, "wait": { "remaining": 0.0, "completed": false, "trigger": null } }, "result": { "result": false } } ], "action/0/default/14/parallel/0/sequence/2/choose/0/conditions/0": [ { "path": "action/0/default/14/parallel/0/sequence/2/choose/0/conditions/0", "timestamp": "2026-01-15T08:34:29.165411+00:00", "result": { "result": false, "entities": [] } } ], "action/0/default/14/parallel/0/sequence/2/choose/1": [ { "path": "action/0/default/14/parallel/0/sequence/2/choose/1", "timestamp": "2026-01-15T08:34:29.165687+00:00", "result": { "result": false } } ], "action/0/default/14/parallel/0/sequence/2/choose/1/conditions/0": [ { "path": "action/0/default/14/parallel/0/sequence/2/choose/1/conditions/0", "timestamp": "2026-01-15T08:34:29.165803+00:00", "result": { "result": false, "entities": [] } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "trigger": "sensor.badkamer_luchtvochtigheid", "bathroom_humidity_sensor": [], "include_manual_trigger": "disable_manual_trigger", "manual_trigger": [], "manual_trigger_default_time_delay": 15, "manual_trigger_winter_time_delay": 15, "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "fan_speed_low": [], "fan_speed_off": [], "rising_humidity": 1, "falling_humidity": -1, "time_delay": 10, "time_out": 20, "include_max_humidity": "maximum_humidity_enabled", "max_humidity": 100, "include_fan_speed": "fan_speed_disabled", "time_delay_low_speed": 5, "include_winter_mode": "winter_mode_disabled", "month_winter_mode": [], "winter_rising_humidity": 1, "winter_falling_humidity": -1, "winter_time_delay": 10, "winter_time_out": 20, "winter_include_max_humidity": "maximum_humidity_disabled", "winter_max_humidity": 100, "winter_include_fan_speed": "fan_speed_disabled", "winter_time_delay_low_speed": 5, "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "light_time_delay": 10, "include_light_control": [], "light_brightness": 100, "brightness_value": "{{ iif ('use_brightness' in include_light_control , light_brightness, ) }}", "light_colour_temperature": 5000, "temperature_value": "{{ iif ('use_colour_temperature' in include_light_control , light_colour_temperature, [] ) }}", "light_transition_on": 1, "light_transition_off": 1, "transition_on_value": "{{ iif ('use_transition' in include_light_control, light_transition_on, ) }}", "transition_off_value": "{{ iif ('use_transition' in include_light_control, light_transition_off, ) }}", "include_manual_fan_switch": "disable_manual_fan_switch", "manual_fan_switch": [], "manual_fan_switch_time_delay": 10, "include_automation_link": "disable_automation_link", "automation_link": [], "automation_link_time_delay": 10, "include_bypass": "bypass_disabled", "by_pass": [], "bypass_options": [], "include_bypass_auto_off": "bypass_auto_off_disabled", "bypass_auto_off_delay": 60, "light_entities": "{% set a = light_switch and light_switch.entity_id %} {% if a %}\n {{ expand(a) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}" }, "triggers": [ { "trigger": "numeric_state", "id": "t0", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" }, { "trigger": "numeric_state", "id": "t1", "entity_id": [], "above": 100, "below": "100" }, { "trigger": "homeassistant", "id": "t2", "event": "start" }, { "trigger": "numeric_state", "id": "t3", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" }, { "trigger": "numeric_state", "id": "t4", "entity_id": [], "above": 100, "below": "100" }, { "trigger": "state", "id": "t5", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t6", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "state", "id": "t7", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t8", "entity_id": [], "from": "off", "to": "on" } ], "actions": [ { "choose": [ { "alias": "For winter mode when enabled and within the set winter months", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t0", "t1" ] } ] }, { "condition": "and", "conditions": [ "{{ include_winter_mode == 'winter_mode_enabled' }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "trigger", "id": [ "t2", "t5", "t6", "t7", "t8" ] } ] } ] } ], "sequence": [ { "choose": [ { "alias": "By-pass is turned on & check by-pass option - turn fan off", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned on & check by-pass option - keep the current fan state", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_stop' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & preform the correct action", "conditions": [ { "condition": "trigger", "id": "t6" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check by-pass options - turn fan off is enabled", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is below falling humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is below falling", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is above winter rising humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is above rising", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'off') | list | count > 0)) }}", { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "We need something here to continue", "delay": { "milliseconds": 10 } } ] } ], "default": [ { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Preform the manual fan switch option", "conditions": [ { "condition": "trigger", "id": "t7" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] }, { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the run on timer is switch is on", "conditions": [ "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Preform the manual trigger option", "conditions": [ { "condition": "trigger", "id": "t8" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check manual trigger with safeguard is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Wait until the time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait until the low speed time delay passes", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled and the lights are ON", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the light time delay has passes", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the automation link time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] }, { "choose": [ { "alias": "Safeguard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t2" } ], "sequence": [ { "choose": [ { "alias": "Check manual trigger with safeguard is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "choose": [ { "alias": "Check manual fan switch is enabled and manual switch is ON", "conditions": [ { "alias": "Check if the humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "template", "value_template": "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' or include_manual_fan_switch == 'enable_manual_fan_switch' }}" }, "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "choose": [ { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] }, { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the run on timer is switch is on", "conditions": [ "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the winter humidity derivative sensor is below falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the winter humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) }}", "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or (include_lights == 'lights_disabled') }}", "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) or (include_automation_link == 'disable_automation_link') }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (winter_include_fan_speed == 'fan_low_speed_enabled') or (winter_include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the winter mode lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - turn fan on", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_turn_on' }}" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ winter_include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] } ] } ], "default": [ { "alias": "Check if the triggers", "condition": "trigger", "id": [ "t2", "t3", "t4", "t5", "t6", "t7", "t8" ] }, { "choose": [ { "alias": "By-pass is turned on & check by-pass option - turn fan off", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned on & check by-pass option - keep the current fan state", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_stop' }}" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & check if the sensor is below falling humidity", "conditions": [ { "condition": "trigger", "id": "t6" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check by-pass options - turn fan off is enabled", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is below falling humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is below falling", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check if the sensor is above rising humidity & by-pass options - turn fan off is disabled", "conditions": [ { "alias": "Check sensor is above rising", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'off') | list | count > 0)) }}", { "condition": "not", "conditions": [ { "condition": "template", "value_template": "{{ 'bypass_turn_fan_off' in bypass_options }}" } ] } ], "sequence": [ { "alias": "We need something here to continue", "delay": { "milliseconds": 10 } } ] } ], "default": [ { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Preform the manual fan switch option", "conditions": [ { "condition": "trigger", "id": "t7" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] }, { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Preform the manual trigger option", "conditions": [ { "condition": "trigger", "id": "t8" } ], "sequence": [ { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check manual trigger with safeguard is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is ON and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Wait until the time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait until the low speed time delay passes", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled and the lights are ON", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the light time delay has passes", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Wait until the automation link time delay has passes", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] }, { "choose": [ { "alias": "Safeguard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t2" } ], "sequence": [ { "choose": [ { "alias": "Check manual trigger with safeguard is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the safeguard has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 20 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "alias": "Check manual trigger with time delay is selected and manual trigger is ON", "conditions": [ "{{ include_manual_trigger == 'enable_manual_trigger_time_delay' }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Wait until manual trigger is turned off or the time delay has passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 15 } }, { "choose": [ { "alias": "Check if the manual trigger switch is on and turn it OFF", "conditions": [ "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF the manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "choose": [ { "alias": "Check manual fan switch is enabled and manual switch is ON", "conditions": [ { "alias": "Check if the humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "template", "value_template": "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' or include_manual_fan_switch == 'enable_manual_fan_switch' }}" }, "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "choose": [ { "alias": "Check if manual fan switch is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ] } ] }, { "alias": "Check if manual fan switch auto off is enabled", "conditions": [ "{{ include_manual_fan_switch == 'enable_manual_fan_switch_auto_off' }}" ], "sequence": [ { "alias": "Wait until manual fan switch is turned off or the time delay passes", "wait_for_trigger": [ { "trigger": "state", "entity_id": [], "from": "on", "to": "off" } ], "timeout": { "minutes": 10 } } ] } ] }, { "alias": "Parallel Actions for the fan, lights and automation link", "parallel": [ { "sequence": [ { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled') }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the humidity derivative sensor is below falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Check automation and preform the correct action", "conditions": [ { "alias": "Check if the humidity derivative sensor is above falling humidity set point and fan / lights are on", "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1 }, "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) }}", "{{ ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or (include_lights == 'lights_disabled') }}", "{{ ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) or (include_automation_link == 'disable_automation_link') }}" ], "sequence": [ { "choose": [ { "alias": "Check if the by-pass auto off is enabled and by-pass is ON", "conditions": [ { "condition": "template", "value_template": "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') }}" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the manual trigger option is enabled and switch is on", "conditions": [ "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}", "{{ expand(manual_trigger) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual trigger", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if the manual fan switch option is enabled and switch is on", "conditions": [ "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}", "{{ expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0 }}" ], "sequence": [ { "alias": "Turn OFF manual fan switch", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan Speed - Low Speed Switch - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "choose": [ { "alias": "Check if fan speeds are enabled", "conditions": [ "{{ (include_fan_speed == 'fan_low_speed_enabled') or (include_fan_speed == 'fan_speed_off_enabled')}}" ], "sequence": [ { "alias": "Fan Speed - Switch Off - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] }, { "alias": "Turn on the fan", "action": "homeassistant.turn_on", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "choose": [ { "alias": "Set the transition for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}" } } ] }, { "alias": "Set the transition and brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the transition and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the transition, brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_on_value }}", "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}" } } ] }, { "alias": "Set the colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the brightness and colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' in include_light_control) and ('use_colour_temperature' in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": { "brightness_pct": "{{ brightness_value }}", "color_temp_kelvin": "{{temperature_value}}" } } ] }, { "alias": "Set the default for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ ('use_transition' not in include_light_control) and ('use_brightness' not in include_light_control) and ('use_colour_temperature' not in include_light_control) }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Turn on the automation link", "action": "homeassistant.turn_on", "target": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - turn fan on", "conditions": [ { "condition": "trigger", "id": "t5" }, { "condition": "template", "value_template": "{{ include_bypass == 'bypass_enabled_turn_on' }}" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ include_bypass_auto_off == 'bypass_auto_off_enabled' }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Wait until Humidity Derivative Sensor drops or it times out", "wait_for_trigger": [ { "trigger": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "below": -1 } ], "timeout": { "minutes": 20 } }, { "alias": "Parallel Actions for the fan and lights", "parallel": [ { "sequence": [ { "alias": "Wait the number of minutes that has been set for the time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the fan", "action": "homeassistant.turn_off", "target": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" } }, { "choose": [ { "alias": "Check if the fan speed switch to low speed then off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_low_speed_enabled' }}" ], "sequence": [ { "alias": "Fan low speed ON", "action": "homeassistant.turn_on", "entity_id": [] }, { "alias": "Wait the number of minutes set in the low speed time delay", "delay": { "minutes": 5 } }, { "alias": "Fan low speed OFF - Safeguard", "action": "homeassistant.turn_off", "entity_id": [] }, { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] }, { "alias": "Check if the fan speed off option is enabled", "conditions": [ "{{ include_fan_speed == 'fan_speed_off_enabled' }}" ], "sequence": [ { "alias": "Fan off speed", "action": "homeassistant.turn_on", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the lights are enabled", "conditions": [ "{{ include_lights == 'lights_enabled' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the lights time delay", "delay": { "minutes": 10 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ transition_off_value }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } } ] } ] } ] } ] } ] }, { "sequence": [ { "choose": [ { "alias": "Check if the automation link is enabled", "conditions": [ "{{ include_automation_link == 'enable_automation_link' }}" ], "sequence": [ { "alias": "Wait the number of minutes set in the automation link time delay", "delay": { "minutes": 10 } }, { "alias": "Turn off the automation link", "action": "homeassistant.turn_off", "target": { "entity_id": [] } } ] } ] } ] } ] } ] } ], "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ include_winter_mode == 'winter_mode_enabled' }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "trigger", "id": "t0" } ] }, { "condition": "and", "conditions": [ "{{ (include_winter_mode == 'winter_mode_enabled') and (winter_include_max_humidity == 'maximum_humidity_enabled') }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "trigger", "id": "t1" } ] }, { "condition": "and", "conditions": [ "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "trigger", "id": "t2" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_disabled' in include_winter_mode }}", { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", { "condition": "template", "value_template": "{{ (now().month | string not in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_disabled' in include_winter_mode }}", "{{ 'maximum_humidity_enabled' in include_max_humidity }}", { "condition": "numeric_state", "entity_id": [], "above": 100, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ 'maximum_humidity_enabled' in include_max_humidity }}", { "condition": "template", "value_template": "{{ (now().month | string not in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": [], "above": 100, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t2" ] }, "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ 'maximum_humidity_enabled' in winter_include_max_humidity }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": [], "above": 100, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ (include_winter_mode == 'winter_mode_disabled') or ((include_winter_mode == 'winter_mode_enabled') and not (now().month | string in month_winter_mode )) }}" }, { "condition": "trigger", "id": "t3" } ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ ((include_winter_mode == 'winter_mode_disabled') and (include_max_humidity == 'maximum_humidity_enabled')) or ((include_winter_mode == 'winter_mode_enabled') and (include_max_humidity == 'maximum_humidity_enabled') and not (now().month | string in month_winter_mode )) }}" }, { "condition": "trigger", "id": "t4" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t5" }, "{{ (include_bypass == 'bypass_enabled_turn_on') or (include_bypass == 'bypass_enabled') or (include_bypass == 'bypass_enabled_stop') }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t6" }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ (include_bypass == 'bypass_enabled') or (include_bypass == 'bypass_enabled_stop') or (include_bypass == 'bypass_enabled_turn_on') }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0 ) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) or ((include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') and (expand(manual_fan_switch) | selectattr('state', '==', 'on') | list | count > 0)) }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t6" ] }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ 'winter_mode_disabled' in include_winter_mode }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0))}}", { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t6" ] }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "template", "value_template": "{{ (now().month | string not in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t6" ] }, "{{ (include_bypass != 'bypass_disabled') }}", "{{ 'winter_mode_enabled' in include_winter_mode }}", "{{ (expand(fan_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0 ) or ((winter_include_fan_speed == 'fan_low_speed_enabled') and (expand(fan_speed_low) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_lights == 'lights_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0)) or ((include_automation_link == 'enable_automation_link') and (expand(automation_link) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "template", "value_template": "{{ (now().month | string in month_winter_mode ) }}" }, { "condition": "numeric_state", "entity_id": "sensor.badkamer_luchtvochtigheid", "above": 1, "below": "100" } ] }, { "condition": "and", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "trigger", "id": [ "t7" ] }, "{{ (include_manual_fan_switch == 'enable_manual_fan_switch') or (include_manual_fan_switch == 'enable_manual_fan_switch_auto_off') }}" ] }, { "condition": "and", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "trigger", "id": [ "t8" ] }, "{{ (include_manual_trigger == 'enable_manual_trigger') or (include_manual_trigger == 'enable_manual_trigger_time_delay') }}" ] } ] }, { "condition": "or", "conditions": [ "{{ include_bypass == 'bypass_disabled' }}", "{{ by_pass == [] }}", "{{ (include_bypass == 'bypass_enabled_turn_on') and (states[by_pass].state == 'off') }}", "{{ (include_bypass == 'bypass_enabled') and (states[by_pass].state == 'off') }}", "{{ (include_bypass == 'bypass_enabled_stop') and (states[by_pass].state == 'off') }}", "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'off') }}", "{{ (include_bypass_auto_off == 'bypass_auto_off_enabled') and (states[by_pass].state == 'on') and (trigger.id == 't2') }}", { "condition": "trigger", "id": "t5" } ] } ], "id": "1754461823733", "alias": "Ventilator badkamer [BP]", "description": "" }, "blueprint_inputs": { "id": "1754461823733", "alias": "Ventilator badkamer [BP]", "description": "", "use_blueprint": { "path": "Blackshome/bathroom-humidity-exhaust-fan.yaml", "input": { "trigger": "sensor.badkamer_luchtvochtigheid", "fan_switch": { "device_id": "6e29c3c314df87528f187dbe4eb847d4" }, "include_max_humidity": "maximum_humidity_enabled", "include_lights": "lights_disabled", "light_switch": { "device_id": "fd928c6d0fd2752492d952a375f9409a" }, "include_manual_fan_switch": "disable_manual_fan_switch" } } }, "context": { "id": "01KF0AYFHRKF4AGATHJXPTWD9V", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "action/0/default/14/parallel/0/sequence/2/choose/1/conditions/0", "run_id": "1453f4fd8da38bfa8ebc44c104d990a5", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-15T08:04:28.856074+00:00", "finish": "2026-01-15T08:34:29.167504+00:00" }, "domain": "automation", "item_id": "1754461823733", "trigger": "Home Assistant starting" } } ], "automation.1758055141945": [ { "extended_dict": { "last_step": "condition/0/conditions/24/conditions/0", "run_id": "1348077135f5548d03ef416f6d316a7e", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T05:00:00.226834+00:00", "finish": "2026-01-16T05:00:00.231831+00:00" }, "domain": "automation", "item_id": "1758055141945", "trigger": "time", "trace": { "trigger/17": [ { "path": "trigger/17", "timestamp": "2026-01-16T05:00:00.229823+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_keuken", "state": "on", "attributes": { "id": "1758055141945", "last_triggered": "2026-01-14T07:15:42.494411+00:00", "mode": "restart", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Keuken [BP]" }, "last_changed": "2026-01-15T08:04:17.790058+00:00", "last_reported": "2026-01-15T08:04:17.790058+00:00", "last_updated": "2026-01-15T08:04:17.790058+00:00", "context": { "id": "01KF0AY4QYBE01ZPZ9TKTK0DH5", "parent_id": null, "user_id": null } }, "trigger": { "id": "t13", "idx": "17", "alias": null, "platform": "time", "now": "2026-01-16T06:00:00.226683+01:00", "description": "time", "entity_id": null }, "motion_trigger": [ "binary_sensor.beweging_keuken_bezetting" ], "light_switch": { "entity_id": "light.lamp_keuken_main" }, "boolean_scenes_scripts": [], "end_scenes": [], "time_delay": 5, "include_light_control": [ "use_brightness" ], "light_brightness": 80, "light_transition_on": 1, "light_transition_off": 1, "include_light_colour_control": "disable_colour_control", "light_colour_temperature": 5000, "light_rgb_colour": [ 255, 255, 255 ], "light_rgbw_colour": [ 255, 255, 255, 255 ], "light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_dynamic_lighting": "enable_sun_elevation_colour_brightness", "dynamic_lighting_lux_sensor": [], "dynamic_lighting_max_lux": 400, "dynamic_lighting_min_lux": 40, "dynamic_lighting_max_brightness": 80, "dynamic_lighting_min_brightness": 42, "dynamic_lighting_boolean": [], "dynamic_lighting_max_colour_temp": 4200, "dynamic_lighting_min_colour_temp": 2500, "dynamic_lighting_sun_elevation_start_rising": -1.5, "dynamic_lighting_sun_elevation_end_rising": 15, "dynamic_lighting_sun_elevation_start_falling": 15, "dynamic_lighting_sun_elevation_end_falling": -4.0, "dynamic_lighting_time_start_morning": "06:00:00", "dynamic_lighting_time_end_morning": "09:00:00", "dynamic_lighting_time_start_evening": "17:00:00", "dynamic_lighting_time_end_evening": "19:00:00", "dynamic_lighting_heartbeat": 1, "dynamic_lighting_step_value": 4, "dynamic_lighting_dead_zone": 7, "dynamic_lighting_state_control": "disable_state_control", "dynamic_lighting_state_control_activation_state": "on", "dynamic_lighting_state_control_entity": [], "include_bypass": [], "motion_bypass_lights_on": [], "motion_bypass_lights_off": [], "motion_bypass_lights_stop": [], "bypass_time_delay": 0, "include_bypass_auto_off": [], "bypass_auto_off_delay": 60, "include_sun": "sun_enabled", "sun_elevation": -1.5, "sun_elevation_rising": -4.0, "include_ambient": "ambient_disabled", "ambient_light_sensor": [], "ambient_light_options": "ambient_light_option_disabled", "ambient_light_value": 20, "ambient_light_high_value": 80, "include_time": "time_disabled", "after_time": "18:00:00", "before_time": "09:00:00", "weekday_options": [ "mon", "tue", "wed", "thu", "fri", "sat", "sun" ], "include_state_control": "state_control_disabled", "state_control_activation_state": "off", "state_control_entity": [], "include_device_tracker": "device_tracker_disabled", "zone": [], "people": [], "include_night_lights": "night_lights_enabled", "night_lights_conditions": [ "time_enabled" ], "night_lights_entity_state": [], "night_lights_after_time": "20:30:00", "night_lights_before_time": "06:00:00", "night_lights_sun_elevation": -1.5, "night_lights_sun_elevation_rising": -4.0, "night_lights": { "entity_id": "light.lamp_keuken_kleur" }, "night_boolean_scenes_scripts": [], "night_time_delay": 5, "include_night_light_control": [ "use_brightness", "use_transition" ], "night_light_brightness": 100, "night_light_transition_on": 0, "night_light_transition_off": 10, "include_night_light_colour_control": "use_colour_temperature", "night_light_colour_temperature": 2700, "night_light_rgb_colour": [ 255, 255, 255 ], "night_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_night_glow": "night_glow_disabled", "night_glow_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_glow_light_control": [ "use_brightness" ], "night_glow_light_brightness": 20, "night_glow_light_transition_on": 1, "night_glow_light_transition_off": 1, "include_night_glow_light_colour_control": "use_colour_temperature", "night_glow_light_colour_temperature": 2000, "night_glow_light_rgb_colour": [ 255, 255, 255 ], "night_glow_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_glow_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "light_entities_off": [ "light.lamp_keuken_main" ], "switch_entities_off": [], "light_data": { "brightness_pct": 80 }, "light_entities": [ "light.lamp_keuken_main" ], "switch_entities": [], "scene_entities": [], "script_entities": [], "boolean_scenes_scripts_helper": [], "end_scene_entities": [], "end_script_entities": [], "night_light_entities_off": [ "light.lamp_keuken_kleur" ], "night_switch_entities_off": [], "night_light_data": { "transition": 0, "brightness_pct": 100, "color_temp_kelvin": 2700 }, "night_light_entities": [ "light.lamp_keuken_kleur" ], "night_switch_entities": [], "night_scene_entities": [], "night_script_entities": [], "night_boolean_scenes_scripts_helper": [], "night_glow_light_data": { "brightness_pct": 20, "color_temp_kelvin": 2000 }, "night_glow_light_entities": [ "light.lamp_keuken_kleur" ], "night_glow_switch_entities": [], "night_glow_scene_entities": [], "night_glow_script_entities": [], "crossover_night_glow_to_night_lights_light": [], "crossover_night_glow_to_night_lights_switch": [], "crossover_night_lights_to_night_glow_light": [], "crossover_night_lights_to_night_glow_switch": [], "crossover_lights_to_night_glow_light": [ "light.lamp_keuken_main" ], "crossover_lights_to_night_glow_switch": [], "crossover_lights_light": [], "crossover_lights_switch": [], "crossover_night_lights_light_on": [], "crossover_night_lights_light": [], "crossover_night_lights_switch": [], "crossover_lights_light_on": [], "dynamic_lighting_state_control_activation_state_inv": "off" } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-16T05:00:00.229852+00:00", "result": { "result": false } } ], "condition/0/conditions/0": [ { "path": "condition/0/conditions/0", "timestamp": "2026-01-16T05:00:00.229877+00:00", "result": { "result": false } } ], "condition/0/conditions/0/conditions/0": [ { "path": "condition/0/conditions/0/conditions/0", "timestamp": "2026-01-16T05:00:00.229895+00:00", "result": { "result": false } } ], "condition/0/conditions/1": [ { "path": "condition/0/conditions/1", "timestamp": "2026-01-16T05:00:00.229922+00:00", "result": { "result": false } } ], "condition/0/conditions/1/conditions/0": [ { "path": "condition/0/conditions/1/conditions/0", "timestamp": "2026-01-16T05:00:00.229939+00:00", "result": { "result": false } } ], "condition/0/conditions/2": [ { "path": "condition/0/conditions/2", "timestamp": "2026-01-16T05:00:00.229960+00:00", "result": { "result": false } } ], "condition/0/conditions/2/conditions/0": [ { "path": "condition/0/conditions/2/conditions/0", "timestamp": "2026-01-16T05:00:00.229975+00:00", "result": { "result": false } } ], "condition/0/conditions/3": [ { "path": "condition/0/conditions/3", "timestamp": "2026-01-16T05:00:00.229996+00:00", "result": { "result": false } } ], "condition/0/conditions/3/conditions/0": [ { "path": "condition/0/conditions/3/conditions/0", "timestamp": "2026-01-16T05:00:00.230011+00:00", "result": { "result": false } } ], "condition/0/conditions/4": [ { "path": "condition/0/conditions/4", "timestamp": "2026-01-16T05:00:00.230030+00:00", "result": { "result": false } } ], "condition/0/conditions/4/conditions/0": [ { "path": "condition/0/conditions/4/conditions/0", "timestamp": "2026-01-16T05:00:00.230047+00:00", "result": { "result": false } } ], "condition/0/conditions/5": [ { "path": "condition/0/conditions/5", "timestamp": "2026-01-16T05:00:00.230067+00:00", "result": { "result": false } } ], "condition/0/conditions/5/conditions/0": [ { "path": "condition/0/conditions/5/conditions/0", "timestamp": "2026-01-16T05:00:00.230108+00:00", "result": { "result": false } } ], "condition/0/conditions/6": [ { "path": "condition/0/conditions/6", "timestamp": "2026-01-16T05:00:00.230176+00:00", "result": { "result": false } } ], "condition/0/conditions/6/conditions/0": [ { "path": "condition/0/conditions/6/conditions/0", "timestamp": "2026-01-16T05:00:00.230225+00:00", "result": { "result": false } } ], "condition/0/conditions/7": [ { "path": "condition/0/conditions/7", "timestamp": "2026-01-16T05:00:00.230249+00:00", "result": { "result": false } } ], "condition/0/conditions/7/conditions/0": [ { "path": "condition/0/conditions/7/conditions/0", "timestamp": "2026-01-16T05:00:00.230266+00:00", "result": { "result": false } } ], "condition/0/conditions/8": [ { "path": "condition/0/conditions/8", "timestamp": "2026-01-16T05:00:00.230286+00:00", "result": { "result": false } } ], "condition/0/conditions/8/conditions/0": [ { "path": "condition/0/conditions/8/conditions/0", "timestamp": "2026-01-16T05:00:00.230303+00:00", "result": { "result": false } } ], "condition/0/conditions/9": [ { "path": "condition/0/conditions/9", "timestamp": "2026-01-16T05:00:00.230350+00:00", "result": { "result": false } } ], "condition/0/conditions/9/conditions/0": [ { "path": "condition/0/conditions/9/conditions/0", "timestamp": "2026-01-16T05:00:00.230367+00:00", "result": { "result": false } } ], "condition/0/conditions/10": [ { "path": "condition/0/conditions/10", "timestamp": "2026-01-16T05:00:00.230388+00:00", "result": { "result": false } } ], "condition/0/conditions/10/conditions/0": [ { "path": "condition/0/conditions/10/conditions/0", "timestamp": "2026-01-16T05:00:00.230404+00:00", "result": { "result": false } } ], "condition/0/conditions/11": [ { "path": "condition/0/conditions/11", "timestamp": "2026-01-16T05:00:00.230446+00:00", "result": { "result": false } } ], "condition/0/conditions/11/conditions/0": [ { "path": "condition/0/conditions/11/conditions/0", "timestamp": "2026-01-16T05:00:00.230463+00:00", "result": { "result": false } } ], "condition/0/conditions/12": [ { "path": "condition/0/conditions/12", "timestamp": "2026-01-16T05:00:00.230484+00:00", "result": { "result": false } } ], "condition/0/conditions/12/conditions/0": [ { "path": "condition/0/conditions/12/conditions/0", "timestamp": "2026-01-16T05:00:00.230499+00:00", "result": { "result": false } } ], "condition/0/conditions/13": [ { "path": "condition/0/conditions/13", "timestamp": "2026-01-16T05:00:00.230520+00:00", "result": { "result": false } } ], "condition/0/conditions/13/conditions/0": [ { "path": "condition/0/conditions/13/conditions/0", "timestamp": "2026-01-16T05:00:00.230536+00:00", "result": { "result": false } } ], "condition/0/conditions/14": [ { "path": "condition/0/conditions/14", "timestamp": "2026-01-16T05:00:00.230556+00:00", "result": { "result": false } } ], "condition/0/conditions/14/conditions/0": [ { "path": "condition/0/conditions/14/conditions/0", "timestamp": "2026-01-16T05:00:00.230571+00:00", "result": { "result": false } } ], "condition/0/conditions/15": [ { "path": "condition/0/conditions/15", "timestamp": "2026-01-16T05:00:00.230593+00:00", "result": { "result": false } } ], "condition/0/conditions/15/conditions/0": [ { "path": "condition/0/conditions/15/conditions/0", "timestamp": "2026-01-16T05:00:00.230608+00:00", "result": { "result": false } } ], "condition/0/conditions/16": [ { "path": "condition/0/conditions/16", "timestamp": "2026-01-16T05:00:00.230629+00:00", "result": { "result": false } } ], "condition/0/conditions/16/conditions/0": [ { "path": "condition/0/conditions/16/conditions/0", "timestamp": "2026-01-16T05:00:00.230646+00:00", "result": { "result": false } } ], "condition/0/conditions/17": [ { "path": "condition/0/conditions/17", "timestamp": "2026-01-16T05:00:00.230666+00:00", "result": { "result": false } } ], "condition/0/conditions/17/conditions/0": [ { "path": "condition/0/conditions/17/conditions/0", "timestamp": "2026-01-16T05:00:00.230682+00:00", "result": { "result": true } } ], "condition/0/conditions/17/conditions/1": [ { "path": "condition/0/conditions/17/conditions/1", "timestamp": "2026-01-16T05:00:00.230700+00:00", "result": { "result": true, "entities": [] } } ], "condition/0/conditions/17/conditions/2": [ { "path": "condition/0/conditions/17/conditions/2", "timestamp": "2026-01-16T05:00:00.230837+00:00", "result": { "result": true, "entities": [] } } ], "condition/0/conditions/17/conditions/3": [ { "path": "condition/0/conditions/17/conditions/3", "timestamp": "2026-01-16T05:00:00.230922+00:00", "result": { "result": false } } ], "condition/0/conditions/17/conditions/3/conditions/0": [ { "path": "condition/0/conditions/17/conditions/3/conditions/0", "timestamp": "2026-01-16T05:00:00.230940+00:00", "result": { "result": false, "entities": [ "light.lamp_keuken_main" ] } } ], "condition/0/conditions/17/conditions/3/conditions/1": [ { "path": "condition/0/conditions/17/conditions/3/conditions/1", "timestamp": "2026-01-16T05:00:00.231053+00:00", "result": { "result": false, "entities": [ "light.lamp_keuken_kleur" ] } } ], "condition/0/conditions/17/conditions/3/conditions/2": [ { "path": "condition/0/conditions/17/conditions/3/conditions/2", "timestamp": "2026-01-16T05:00:00.231158+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/17/conditions/3/conditions/3": [ { "path": "condition/0/conditions/17/conditions/3/conditions/3", "timestamp": "2026-01-16T05:00:00.231266+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/17/conditions/3/conditions/4": [ { "path": "condition/0/conditions/17/conditions/3/conditions/4", "timestamp": "2026-01-16T05:00:00.231345+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/17/conditions/3/conditions/5": [ { "path": "condition/0/conditions/17/conditions/3/conditions/5", "timestamp": "2026-01-16T05:00:00.231420+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/17/conditions/3/conditions/6": [ { "path": "condition/0/conditions/17/conditions/3/conditions/6", "timestamp": "2026-01-16T05:00:00.231493+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/18": [ { "path": "condition/0/conditions/18", "timestamp": "2026-01-16T05:00:00.231570+00:00", "result": { "result": false } } ], "condition/0/conditions/18/conditions/0": [ { "path": "condition/0/conditions/18/conditions/0", "timestamp": "2026-01-16T05:00:00.231589+00:00", "result": { "result": false } } ], "condition/0/conditions/19": [ { "path": "condition/0/conditions/19", "timestamp": "2026-01-16T05:00:00.231610+00:00", "result": { "result": false } } ], "condition/0/conditions/19/conditions/0": [ { "path": "condition/0/conditions/19/conditions/0", "timestamp": "2026-01-16T05:00:00.231627+00:00", "result": { "result": false } } ], "condition/0/conditions/20": [ { "path": "condition/0/conditions/20", "timestamp": "2026-01-16T05:00:00.231647+00:00", "result": { "result": false } } ], "condition/0/conditions/20/conditions/0": [ { "path": "condition/0/conditions/20/conditions/0", "timestamp": "2026-01-16T05:00:00.231662+00:00", "result": { "result": false } } ], "condition/0/conditions/21": [ { "path": "condition/0/conditions/21", "timestamp": "2026-01-16T05:00:00.231681+00:00", "result": { "result": false } } ], "condition/0/conditions/21/conditions/0": [ { "path": "condition/0/conditions/21/conditions/0", "timestamp": "2026-01-16T05:00:00.231697+00:00", "result": { "result": false } } ], "condition/0/conditions/22": [ { "path": "condition/0/conditions/22", "timestamp": "2026-01-16T05:00:00.231716+00:00", "result": { "result": false } } ], "condition/0/conditions/22/conditions/0": [ { "path": "condition/0/conditions/22/conditions/0", "timestamp": "2026-01-16T05:00:00.231732+00:00", "result": { "result": false } } ], "condition/0/conditions/23": [ { "path": "condition/0/conditions/23", "timestamp": "2026-01-16T05:00:00.231752+00:00", "result": { "result": false } } ], "condition/0/conditions/23/conditions/0": [ { "path": "condition/0/conditions/23/conditions/0", "timestamp": "2026-01-16T05:00:00.231768+00:00", "result": { "result": false } } ], "condition/0/conditions/24": [ { "path": "condition/0/conditions/24", "timestamp": "2026-01-16T05:00:00.231788+00:00", "result": { "result": false } } ], "condition/0/conditions/24/conditions/0": [ { "path": "condition/0/conditions/24/conditions/0", "timestamp": "2026-01-16T05:00:00.231805+00:00", "result": { "result": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "motion_trigger": [ "binary_sensor.beweging_keuken_bezetting" ], "light_switch": { "entity_id": "light.lamp_keuken_main" }, "boolean_scenes_scripts": [], "end_scenes": [], "time_delay": 5, "include_light_control": [ "use_brightness" ], "light_brightness": 80, "light_transition_on": 1, "light_transition_off": 1, "include_light_colour_control": "disable_colour_control", "light_colour_temperature": 5000, "light_rgb_colour": [ 255, 255, 255 ], "light_rgbw_colour": [ 255, 255, 255, 255 ], "light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_dynamic_lighting": "enable_sun_elevation_colour_brightness", "dynamic_lighting_lux_sensor": [], "dynamic_lighting_max_lux": 400, "dynamic_lighting_min_lux": 40, "dynamic_lighting_max_brightness": 80, "dynamic_lighting_min_brightness": 42, "dynamic_lighting_boolean": [], "dynamic_lighting_max_colour_temp": 4200, "dynamic_lighting_min_colour_temp": 2500, "dynamic_lighting_sun_elevation_start_rising": -1.5, "dynamic_lighting_sun_elevation_end_rising": 15, "dynamic_lighting_sun_elevation_start_falling": 15, "dynamic_lighting_sun_elevation_end_falling": -4.0, "dynamic_lighting_time_start_morning": "06:00:00", "dynamic_lighting_time_end_morning": "09:00:00", "dynamic_lighting_time_start_evening": "17:00:00", "dynamic_lighting_time_end_evening": "19:00:00", "dynamic_lighting_heartbeat": 1, "dynamic_lighting_step_value": 4, "dynamic_lighting_dead_zone": 7, "dynamic_lighting_state_control": "disable_state_control", "dynamic_lighting_state_control_activation_state": "on", "dynamic_lighting_state_control_entity": [], "include_bypass": [], "motion_bypass_lights_on": [], "motion_bypass_lights_off": [], "motion_bypass_lights_stop": [], "bypass_time_delay": 0, "include_bypass_auto_off": [], "bypass_auto_off_delay": 60, "include_sun": "sun_enabled", "sun_elevation": -1.5, "sun_elevation_rising": -4.0, "include_ambient": "ambient_disabled", "ambient_light_sensor": [], "ambient_light_options": "ambient_light_option_disabled", "ambient_light_value": 20, "ambient_light_high_value": 80, "include_time": "time_disabled", "after_time": "18:00:00", "before_time": "09:00:00", "weekday_options": [ "mon", "tue", "wed", "thu", "fri", "sat", "sun" ], "include_state_control": "state_control_disabled", "state_control_activation_state": "off", "state_control_entity": [], "include_device_tracker": "device_tracker_disabled", "zone": [], "people": [], "include_night_lights": "night_lights_enabled", "night_lights_conditions": [ "time_enabled" ], "night_lights_entity_state": [], "night_lights_after_time": "20:30:00", "night_lights_before_time": "06:00:00", "night_lights_sun_elevation": -1.5, "night_lights_sun_elevation_rising": -4.0, "night_lights": { "entity_id": "light.lamp_keuken_kleur" }, "night_boolean_scenes_scripts": [], "night_time_delay": 5, "include_night_light_control": [ "use_brightness", "use_transition" ], "night_light_brightness": 100, "night_light_transition_on": 0, "night_light_transition_off": 10, "include_night_light_colour_control": "use_colour_temperature", "night_light_colour_temperature": 2700, "night_light_rgb_colour": [ 255, 255, 255 ], "night_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_night_glow": "night_glow_disabled", "night_glow_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_glow_light_control": [ "use_brightness" ], "night_glow_light_brightness": 20, "night_glow_light_transition_on": 1, "night_glow_light_transition_off": 1, "include_night_glow_light_colour_control": "use_colour_temperature", "night_glow_light_colour_temperature": 2000, "night_glow_light_rgb_colour": [ 255, 255, 255 ], "night_glow_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_glow_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "light_entities_off": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'light')\n | selectattr('state', 'eq', 'off')\n | map(attribute='entity_id')\n | list }}\n", "switch_entities_off": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'switch')\n | selectattr('state', 'eq', 'off')\n | map(attribute='entity_id')| list }}\n", "light_data": "{% set light = namespace(data={}) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': light_brightness }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}", "light_entities": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'light')\n | map(attribute='entity_id')\n | list }}\n", "switch_entities": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'switch')\n | map(attribute='entity_id')\n | list }}\n", "scene_entities": "{% set a = light_switch.entity_id %} {% if boolean_scenes_scripts == [] %}\n {{ expand(a) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% elif is_state(boolean_scenes_scripts, 'off') %}\n {{ expand(a) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "script_entities": "{% set a = light_switch.entity_id %} {% if boolean_scenes_scripts == [] %}\n {{ expand(a) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% elif is_state(boolean_scenes_scripts, 'off') %}\n {{ expand(a) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "boolean_scenes_scripts_helper": "{% if boolean_scenes_scripts | length > 0 and states(boolean_scenes_scripts) == 'off' %}\n {{ boolean_scenes_scripts }}\n{% else %}\n []\n{% endif %}", "end_scene_entities": "{{ end_scenes | select('match', '^scene\\..*') | list }}", "end_script_entities": "{{ end_scenes | select('match', '^script\\..*') | list }}", "night_light_entities_off": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'off') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_switch_entities_off": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'switch') | selectattr('state', 'eq', 'off') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_light_data": "{% set light = namespace(data={}) %} {% if 'use_transition' in include_night_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': night_light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_night_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': night_light_brightness }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': night_light_colour_temperature }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': night_light_rgb_colour }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': night_light_rgbw_colour }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': night_light_rgbww_colour }) %}\n{% endif %} {{ light.data }}", "night_light_entities": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_switch_entities": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_scene_entities": "{% set b = night_lights and night_lights.entity_id %} {% if night_boolean_scenes_scripts == [] %}\n {{ expand(b) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% elif is_state(night_boolean_scenes_scripts, 'off') %}\n {{ expand(b) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_script_entities": "{% set b = night_lights and night_lights.entity_id %} {% if night_boolean_scenes_scripts == [] %}\n {{ expand(b) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% elif is_state(night_boolean_scenes_scripts, 'off') %}\n {{ expand(b) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_boolean_scenes_scripts_helper": "{% if night_boolean_scenes_scripts | length > 0 and states(night_boolean_scenes_scripts) == 'off' %}\n {{ night_boolean_scenes_scripts }}\n{% else %}\n []\n{% endif %}", "night_glow_light_data": "{% set light = namespace(data={}) %} {% if 'use_transition' in include_night_glow_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': night_glow_light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_night_glow_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': night_glow_light_brightness }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': night_glow_light_colour_temperature }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': night_glow_light_rgb_colour }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': night_glow_light_rgbw_colour }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': night_glow_light_rgbww_colour }) %}\n{% endif %} {{ light.data }}", "night_glow_light_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_glow_switch_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_glow_scene_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_glow_script_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_glow_to_night_lights_light": "{% set a = night_lights and night_lights.entity_id %} {% set b = night_glow_lights and night_glow_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_glow_to_night_lights_switch": "{% set a = night_lights and night_lights.entity_id %} {% set b = night_glow_lights and night_glow_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_to_night_glow_light": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_to_night_glow_switch": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_to_night_glow_light": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = light_switch.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_to_night_glow_switch": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = light_switch.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_light": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(a) | reject('in', expand(b)) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_switch": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(a) | reject('in', expand(b)) | selectattr('domain', 'eq', 'switch') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_light_on": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_light": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_switch": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_light_on": "{% set a = light_switch.entity_id %} {% if a %}\n {{ expand(a) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "dynamic_lighting_state_control_activation_state_inv": "{% if dynamic_lighting_state_control_activation_state == 'on' %}\n off\n{% else %}\n on\n{% endif %}\n" }, "triggers": [ { "trigger": "state", "id": "t0", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "from": "off", "to": "on" }, { "trigger": "numeric_state", "id": "t1", "entity_id": "sun.sun", "attribute": "elevation", "below": -1.5 }, { "trigger": "numeric_state", "id": "t2", "entity_id": [], "below": 20 }, { "trigger": "time", "id": "t3", "at": "18:00:00" }, { "trigger": "state", "id": "t4", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "time", "id": "t5", "at": "20:30:00" }, { "trigger": "numeric_state", "id": "t6", "entity_id": "sun.sun", "attribute": "elevation", "below": -1.5 }, { "trigger": "state", "id": "t7_on", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t7_off", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t7_stop", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t8_on", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "state", "id": "t8_off", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "state", "id": "t8_stop", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "numeric_state", "id": "t9", "entity_id": "sun.sun", "attribute": "elevation", "above": -4.0 }, { "trigger": "numeric_state", "id": "t10", "entity_id": [], "above": 80 }, { "trigger": "time", "id": "t11", "at": "09:00:00" }, { "trigger": "state", "id": "t12", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "time", "id": "t13", "at": "06:00:00" }, { "trigger": "numeric_state", "id": "t14", "entity_id": "sun.sun", "attribute": "elevation", "above": -4.0 }, { "trigger": "state", "id": "t15", "entity_id": [], "to": "on" }, { "trigger": "state", "id": "t16", "entity_id": [], "from": "on" }, { "trigger": "state", "id": "t17", "entity_id": [], "to": "off" }, { "trigger": "state", "id": "t18", "entity_id": [], "from": "off" }, { "trigger": "homeassistant", "id": "t19", "event": "start" } ], "actions": [ { "choose": [ { "alias": "Check if night lights are enabled and within conditions", "conditions": [ { "condition": "and", "conditions": [ { "alias": "Check if night lights is enabled", "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_enabled' }}" }, { "alias": "Check if night lights entity state is enabled", "condition": "or", "conditions": [ "{{ ('time_enabled' in night_lights_conditions) and not ('entity_state_enabled' in night_lights_conditions) }}", "{{ ('sun_enabled' in night_lights_conditions) and not ('entity_state_enabled' in night_lights_conditions) }}", { "condition": "and", "conditions": [ "{{ 'entity_state_enabled' in night_lights_conditions }}", { "condition": "state", "entity_id": [], "state": "on", "match": "any" } ] } ] }, { "alias": "Check if night lights time is enabled", "condition": "or", "conditions": [ "{{ ('entity_state_enabled' in night_lights_conditions) and not ('time_enabled' in night_lights_conditions) }}", "{{ ('sun_enabled' in night_lights_conditions) and not ('time_enabled' in night_lights_conditions) }}", { "condition": "and", "conditions": [ "{{ 'time_enabled' in night_lights_conditions }}", { "condition": "time", "after": "20:30:00", "before": "06:00:00" } ] } ] }, { "alias": "Check if night lights sun is enabled", "condition": "or", "conditions": [ "{{ ('entity_state_enabled' in night_lights_conditions) and not ('sun_enabled' in night_lights_conditions) }}", "{{ ('time_enabled' in night_lights_conditions) and not ('sun_enabled' in night_lights_conditions) }}", "{{ ('sun_enabled' in night_lights_conditions) and (((is_state_attr('sun.sun', 'rising', false)) and (state_attr('sun.sun','elevation') <= night_lights_sun_elevation | float(90))) or ((is_state_attr('sun.sun', 'rising', true)) and (state_attr('sun.sun','elevation') <= night_lights_sun_elevation_rising | float(90)))) }}" ] } ] } ], "sequence": [ { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "By-pass is turned on & check by-pass option - Turn lights off", "conditions": [ { "condition": "trigger", "id": "t7_off" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] }, { "alias": "By-pass is turned on & check by-pass option - Keep the current lights state", "conditions": [ { "condition": "trigger", "id": "t7_stop" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & check if the motion trigger is off", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "all", "state": "off" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If night glow is disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] }, { "alias": "If night glow is enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn on the lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": "{{ night_glow_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn OFF crossover lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_to_night_glow_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" } }, { "alias": "Turn OFF crossover lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_to_night_glow_light }}" } } ] } ] }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_on }}" } }, { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}", "transition": "{{ night_glow_light_transition_on }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } }, { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn OFF crossover night switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_switch }}" } }, { "alias": "Turn OFF crossover light switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_to_night_glow_switch }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ night_glow_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Motion trigger is off and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "By-pass is turned off & check if the motion trigger is on", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] }, { "condition": "or", "conditions": [ "{{ (include_sun == 'sun_enabled') and (state_attr('sun.sun','elevation') >= sun_elevation | float(90)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_disabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (is_state(night_boolean_scenes_scripts, 'off')) }}", { "condition": "and", "conditions": [ "{{ include_time == 'time_enabled' }}", { "condition": "time", "after": "09:00:00", "before": "18:00:00" } ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "template", "value_template": "{% set opposite = 'off' if state_control_activation_state == 'on' else 'on' %} {{ is_state(state_control_entity, opposite) }}" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] }, { "alias": "Motion trigger is on and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned off & reset lights to the site conditions", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "choose": [ { "alias": "Check if normal lights Scenes & Scripts - Toggle Helper is on", "conditions": [ { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean normal lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ crossover_night_lights_light_on }}" }, "data": "{{ night_light_data }}" } ] } ] } ] } ] }, { "choose": [ { "alias": "Sun, ambient, time & state control above setting to turn off", "conditions": [ { "condition": "trigger", "id": [ "t9", "t10", "t11", "t18" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] }, { "alias": "Turn off normal lights when trigger by start night lights conditions", "conditions": [ { "condition": "trigger", "id": [ "t4", "t5", "t6" ] } ], "sequence": [ { "choose": [ { "alias": "light - switch - scene - script is ON", "conditions": [ { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "choose": [ { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the input boolean normal lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ crossover_night_lights_light_on }}" }, "data": "{{ night_light_data }}" } ] } ] } ] }, { "alias": "Turn on night glow lights if all lights are off", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" }, { "condition": "template", "value_template": "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (is_state(boolean_scenes_scripts, 'off')) }}\n" } ], "sequence": [ { "alias": "Turn on the lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": "{{ night_glow_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}", "transition": "{{ night_glow_light_transition_on }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ night_glow_script_entities }}" } }, { "stop": "Stop the automation" } ] }, { "alias": "If manage scripts is enabled", "conditions": [ "{{ 'manage_scripts_crossing_over' in include_night_light_control }}", "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (is_state(boolean_scenes_scripts, 'off')) }}" ], "sequence": [ { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Safe Guard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t19" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Small time delay required", "delay": { "seconds": 1 } } ] }, { "alias": "Check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass auto off is enabled and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "choose": [ { "alias": "If night glow is disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_disabled' }}" } ], "sequence": [ { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_light_entities_off }}" }, "data": "{{ night_light_data }}" }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ { "condition": "template", "value_template": "{% if boolean_scenes_scripts == [] %}\n false\n{% elif is_state(boolean_scenes_scripts, 'on') %}\n true\n{% else %}\n false\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": "{{ boolean_scenes_scripts }}" } }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ "{{ night_boolean_scenes_scripts != [] }}" ], "sequence": [ { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" }, "data": { "transition": "{{ night_light_transition_on }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] }, { "alias": "Turn on the night switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_switch_entities_off }}" } }, { "alias": "Turn on the night scripts", "action": "script.turn_on", "target": { "entity_id": "{{ night_script_entities }}" } } ] }, { "alias": "If night glow is enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" }, { "condition": "not", "conditions": [ { "condition": "trigger", "id": [ "t15", "t16" ] } ] } ], "sequence": [ { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_light_entities }}" }, "data": "{{ night_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night glow lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night glow lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ { "condition": "template", "value_template": "{% if boolean_scenes_scripts == [] %}\n false\n{% elif is_state(boolean_scenes_scripts, 'on') %}\n true\n{% else %}\n false\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": "{{ boolean_scenes_scripts }}" } }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ "{{ night_boolean_scenes_scripts != [] }}" ], "sequence": [ { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" }, "data": { "transition": "{{ night_light_transition_on }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] }, { "alias": "Turn on the night switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off crossover night glow switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } }, { "alias": "Turn on the night scripts", "action": "script.turn_on", "target": { "entity_id": "{{ night_script_entities }}" } } ] } ] }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - Turn lights on", "conditions": [ { "condition": "trigger", "id": "t7_on" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Check if the trigger is on and wait for it to go off", "conditions": [ { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" } ], "sequence": [ { "alias": "Wait until motion sensor is off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Wait the number of minutes set in the night lights time delay", "delay": { "minutes": 5 } }, { "choose": [ { "alias": "If night glow is disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] }, { "alias": "If night glow is enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn on the lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": "{{ night_glow_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" } } ] } ] }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}", "transition": "{{ night_glow_light_transition_on }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn OFF crossover night switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_switch }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ night_glow_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ], "default": [ { "choose": [ { "alias": "By-pass is turned on & check by-pass option - Turn lights off", "conditions": [ { "condition": "trigger", "id": "t7_off" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If night lights are disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] }, { "alias": "If night lights are enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] } ] }, { "alias": "By-pass is turned on & check by-pass option - Keep the current lights state", "conditions": [ { "condition": "trigger", "id": "t7_stop" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & check if the motion trigger is off", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "all", "state": "off" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If night lights are disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "If night lights are enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Motion trigger is off and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "By-pass is turned off & check if the motion trigger is on", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] }, { "condition": "or", "conditions": [ "{{ (include_sun == 'sun_enabled') and (state_attr('sun.sun','elevation') >= sun_elevation | float(90)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_disabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (is_state(boolean_scenes_scripts, 'off')) }}", { "condition": "and", "conditions": [ { "condition": "time", "after": "09:00:00", "before": "18:00:00" }, "{{ include_time == 'time_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "template", "value_template": "{% set opposite = 'off' if state_control_activation_state == 'on' else 'on' %} {{ is_state(state_control_entity, opposite) }}" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Motion trigger is on and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned off & reset lights to the site conditions", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] } ] } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "choose": [ { "alias": "Check if night lights scenes & scripts - toggle helper is on", "conditions": [ { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "Turn ON lights", "conditions": [ { "alias": "Check the dynamic lighting options", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'disable_dynamic_lighting' }}" }, { "alias": "Check that dynamic lighting is active and the state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "template", "value_template": "{{ states(dynamic_lighting_state_control_entity) == dynamic_lighting_state_control_activation_state_inv }}" } ] } ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ crossover_lights_light_on }}" }, "data": "{{ light_data }}" }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ] } ] } ] } ] } ] }, { "choose": [ { "alias": "Sun, ambient, time & state control above setting to turn off", "conditions": [ { "condition": "trigger", "id": [ "t9", "t10", "t11", "t18" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Turn off night lights when trigger by end night lights conditions", "conditions": [ { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "choose": [ { "alias": "If the night glow is enabled", "conditions": [ "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "off", "for": { "minutes": 5 } } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": { "transition": "{{ night_glow_light_transition_off}}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_glow_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_glow_light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "stop": "Stop the automation" } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or (is_state(night_boolean_scenes_scripts, 'on')) }}\n" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "choose": [ { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Turn ON lights", "conditions": [ { "alias": "Check the dynamic lighting options", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'disable_dynamic_lighting' }}" }, { "alias": "Check that dynamic lighting is active and the state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "template", "value_template": "{{ states(dynamic_lighting_state_control_entity) == dynamic_lighting_state_control_activation_state_inv }}" } ] } ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ crossover_lights_light_on }}" }, "data": "{{ light_data }}" } ] } ] } ] } ] } ] }, { "alias": "If manage scripts is enabled", "conditions": [ "{{ 'manage_scripts_crossing_over' in include_night_light_control }}", "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (is_state(night_boolean_scenes_scripts, 'off')) }}" ], "sequence": [ { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Safe Guard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t19" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Small time delay required", "delay": { "seconds": 1 } } ] }, { "alias": "Check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass auto off is enabled and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "alias": "Parallel actions for dynamic lighting and normal lights", "parallel": [ { "sequence": [ { "alias": "Check if the dynamic lighting is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "alias": "Check the dynamic lighting state control option", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'disable_state_control' }}" }, { "alias": "Check if the dynamic lighting state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "state", "entity_id": [], "state": "on" } ] } ] } ] }, { "choose": [ { "alias": "Dynamic Lighting - Input Boolean Helper", "conditions": [ { "condition": "template", "value_template": "{{ dynamic_lighting_boolean != [] }}" } ], "sequence": [ { "alias": "Turn on the boolean for dynamic lighting", "action": "input_boolean.turn_on", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "1 - Dynamic Lighting - Lux Controlled Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness'}}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n false\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "2 - Dynamic Lighting - Lux Controlled Brightness - Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness_inv'}}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting brightness inverted for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "3 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': light_brightness }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if elevation >= (dynamic_lighting_sun_elevation_start_rising - 2) and elevation <= (dynamic_lighting_sun_elevation_end_rising + 2) and is_state_attr('sun.sun', 'rising', true) %}\n false\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_falling + 2) and elevation >= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n false\n {% elif elevation >= (dynamic_lighting_sun_elevation_end_rising + 2) and elevation >= (dynamic_lighting_sun_elevation_start_falling - 2) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_rising - 2) and is_state_attr('sun.sun', 'rising', true) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n true\n {% else %}\n true\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If sun elevation is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "4 - Dynamic Lighting - Sun Elevation Lighting - Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "5 - Dynamic Lighting - Sun Elevation Lighting - Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness_inv' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness inverted for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "6 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "7 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness_inv' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "8 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Lux Controlled Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" } ], "sequence": [ { "alias": "Parallel actions for dynamic lighting", "parallel": [ { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_kelvin": "{% if expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 %}\n {% set elevation = state_attr('sun.sun', 'elevation') | float %}\n {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %}\n {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %}\n {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %}\n {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %}\n {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% endif %}\n {{ colour_temp_value | round(0) }}\n{% endif %}\n", "dynamic_light_off_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n false\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Check if the light is off", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Delay for parallel actions needed for when the light is off", "delay": { "milliseconds": 100 } } ] } ] }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" }, "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}" ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_off_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] }, { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if elevation >= (dynamic_lighting_sun_elevation_start_rising - 2) and elevation <= (dynamic_lighting_sun_elevation_end_rising + 2) and is_state_attr('sun.sun', 'rising', true) %}\n false\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_falling + 2) and elevation >= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n false\n {% elif elevation >= (dynamic_lighting_sun_elevation_end_rising + 2) and elevation >= (dynamic_lighting_sun_elevation_start_falling - 2) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_rising - 2) and is_state_attr('sun.sun', 'rising', true) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n true\n {% else %}\n true\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If sun elevation is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If the lights are OFF", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] } ] } ] }, { "choose": [ { "alias": "9 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Lux Controlled Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" } ], "sequence": [ { "alias": "Parallel actions for dynamic lighting", "parallel": [ { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_kelvin": "{% if expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 %}\n {% set elevation = state_attr('sun.sun', 'elevation') | float %}\n {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %}\n {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %}\n {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %}\n {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %}\n {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% endif %}\n {{ colour_temp_value | round(0) }}\n{% endif %}\n", "dynamic_light_off_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Check if the light is off", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Delay for parallel actions needed for when the light is off", "delay": { "milliseconds": 100 } } ] } ] }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" }, "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}" ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_off_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] }, { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if elevation >= (dynamic_lighting_sun_elevation_start_rising - 2) and elevation <= (dynamic_lighting_sun_elevation_end_rising + 2) and is_state_attr('sun.sun', 'rising', true) %}\n false\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_falling + 2) and elevation >= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n false\n {% elif elevation >= (dynamic_lighting_sun_elevation_end_rising + 2) and elevation >= (dynamic_lighting_sun_elevation_start_falling - 2) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_rising - 2) and is_state_attr('sun.sun', 'rising', true) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n true\n {% else %}\n true\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If sun elevation is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If the lights are OFF", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] } ] } ] }, { "choose": [ { "alias": "10 - Dynamic Lighting - Time Controlled - Colour Temp", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_colour_temp %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set colour_temp_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set colour_temp_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% elif current_time < start_time_morning %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% elif current_time > end_time_evening %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': light_brightness }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "11 - Dynamic Lighting - Time Controlled - Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_brightness %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set brightness_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set brightness_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% elif current_time < start_time_morning %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% elif current_time > end_time_evening %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "12 - Dynamic Lighting - Time Controlled - Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness_inv' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_max_brightness %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set brightness_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set brightness_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% elif current_time < start_time_morning %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% elif current_time > end_time_evening %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "13 - Dynamic Lighting - Time Controlled - Colour Temp & Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_brightness %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set brightness_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set brightness_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% elif current_time < start_time_morning %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% elif current_time > end_time_evening %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_kelvin": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_colour_temp %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set colour_temp_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set colour_temp_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% elif current_time < start_time_morning %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% elif current_time > end_time_evening %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "sequence": [ { "choose": [ { "alias": "Turn ON lights", "conditions": [ { "alias": "Check the dynamic lighting options", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'disable_dynamic_lighting' }}" }, { "alias": "Check that dynamic lighting is active and the state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "template", "value_template": "{{ states(dynamic_lighting_state_control_entity) == dynamic_lighting_state_control_activation_state_inv }}" } ] } ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities_off }}" }, "data": "{{ light_data }}" } ] } ] }, { "choose": [ { "alias": "Dynamic Lighting State Control Turning OFF", "conditions": [ { "condition": "trigger", "id": "t16" }, { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ light_data }}" }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts == [] %}\n false\n{% elif is_state(night_boolean_scenes_scripts, 'on') %}\n true\n{% else %}\n false\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": "{{ night_boolean_scenes_scripts }}" } }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ "{{ boolean_scenes_scripts != [] }}" ], "sequence": [ { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ boolean_scenes_scripts_helper }}" } } ] } ] } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ scene_entities }}" }, "data": { "transition": "{{ light_transition_on }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ boolean_scenes_scripts_helper }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ scene_entities }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ boolean_scenes_scripts_helper }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ switch_entities_off }}" } }, { "alias": "Turn on the scripts", "action": "script.turn_on", "target": { "entity_id": "{{ script_entities }}" } }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - Turn lights on", "conditions": [ { "condition": "trigger", "id": "t7_on" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Check if the trigger is on and wait for it to go off", "conditions": [ { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" } ], "sequence": [ { "alias": "Wait until motion sensor is off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Wait the number of minutes set in the normal lights time delay", "delay": { "minutes": 5 } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ], "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t0" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t1" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, "{{ include_sun == 'sun_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t2" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, "{{ include_ambient == 'ambient_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t3" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, "{{ include_time == 'time_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t4" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'entity_state_enabled' in night_lights_conditions }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t5" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'time_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t6" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'sun_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t7_on" }, "{{ 'bypass_enabled_turn_on' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t7_off" }, "{{ 'bypass_enabled_turn_off' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t7_stop" }, "{{ 'bypass_enabled_stop' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t8_on" }, "{{ 'bypass_enabled_turn_on' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t8_off" }, "{{ 'bypass_enabled_turn_off' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t8_stop" }, "{{ 'bypass_enabled_stop' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t9" }, "{{ include_sun == 'sun_enabled' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t10" }, "{{ include_ambient == 'ambient_enabled' }}", "{{ ambient_light_options == 'ambient_light_option_disabled' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t11" }, "{{ include_time == 'time_enabled' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t12" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'entity_state_enabled' in night_lights_conditions }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t13" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'time_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t14" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'sun_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t15", "t16" ] }, { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, "{{ dynamic_lighting_state_control == 'enable_state_control' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t17" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t18" }, { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t19" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t19" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t19" }, "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ] }, { "condition": "or", "conditions": [ "{{ include_bypass == [] }}", { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t19" ] } ] }, { "condition": "or", "conditions": [ "{{ include_sun == 'sun_disabled' }}", "{{ include_sun == 'sun_enabled_night_lights' }}", "{{ (include_sun == 'sun_enabled') and (is_state_attr('sun.sun', 'rising', false)) and (state_attr('sun.sun','elevation') <= sun_elevation | float(90)) }}", "{{ (include_sun == 'sun_enabled') and (is_state_attr('sun.sun', 'rising', true)) and (state_attr('sun.sun','elevation') <= sun_elevation_rising | float(90)) }}", { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t9" ] } ] }, { "condition": "or", "conditions": [ "{{ include_ambient == 'ambient_disabled' }}", "{{ ambient_light_sensor == [] }}", "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_value | int)) }}", "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) and ((include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) }}", { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ( ambient_light_options == 'ambient_light_option_enabled' ) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ( ambient_light_options == 'ambient_light_option_enabled' ) }}", { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t10" ] } ] }, { "condition": "or", "conditions": [ "{{ include_time == 'time_disabled' }}", { "condition": "and", "conditions": [ { "condition": "time", "after": "18:00:00", "before": "09:00:00", "weekday": [ "mon", "tue", "wed", "thu", "fri", "sat", "sun" ] }, "{{ include_time == 'time_enabled' }}" ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t11" ] } ] }, { "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_disabled' }}" }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t18" ] } ] }, { "condition": "or", "conditions": [ "{{ include_device_tracker == 'device_tracker_disabled' }}", { "condition": "and", "conditions": [ "{{ include_device_tracker == 'zone_enabled' }}", { "condition": "numeric_state", "entity_id": [], "above": 0 } ] }, { "condition": "and", "conditions": [ "{{ include_device_tracker == 'zone_people_enabled' }}", "{{ (state_attr(zone, 'persons') | list | select('in', people) | list | length) > 0 }}" ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop" ] } ] } ], "id": "1758055141945", "alias": "Beweging Keuken", "description": "" }, "blueprint_inputs": { "id": "1758055141945", "alias": "Beweging Keuken", "description": "", "use_blueprint": { "path": "Blackshome/sensor-light.yaml", "input": { "motion_trigger": [ "binary_sensor.beweging_keuken_bezetting" ], "light_switch": { "entity_id": "light.lamp_keuken_main" }, "include_light_control": [ "use_brightness" ], "light_brightness": 80, "include_sun": "sun_enabled", "night_lights_conditions": [ "time_enabled" ], "include_time": "time_disabled", "after_time": "18:00:00", "before_time": "09:00:00", "night_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_light_control": [ "use_brightness", "use_transition" ], "night_light_brightness": 100, "include_night_light_colour_control": "use_colour_temperature", "night_light_colour_temperature": 2700, "include_night_glow": "night_glow_disabled", "night_glow_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_glow_light_colour_control": "use_colour_temperature", "night_glow_light_colour_temperature": 2000, "include_night_glow_light_control": [ "use_brightness" ], "include_dynamic_lighting": "enable_sun_elevation_colour_brightness", "dynamic_lighting_min_colour_temp": 2500, "include_night_lights": "night_lights_enabled", "dynamic_lighting_max_colour_temp": 4200, "night_lights_after_time": "20:30:00", "dynamic_lighting_max_brightness": 80, "dynamic_lighting_min_brightness": 42, "night_lights_before_time": "06:00:00", "night_light_transition_on": 0, "night_light_transition_off": 10 } } }, "context": { "id": "01KF2JSDB2C5E3SJQYEF017FED", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "condition/0/conditions/24/conditions/0", "run_id": "1348077135f5548d03ef416f6d316a7e", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T05:00:00.226834+00:00", "finish": "2026-01-16T05:00:00.231831+00:00" }, "domain": "automation", "item_id": "1758055141945", "trigger": "time" } }, { "extended_dict": { "last_step": "condition/0/conditions/24/conditions/0", "run_id": "12fd9115ea5dad56325b306c44777969", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T07:14:16.399415+00:00", "finish": "2026-01-16T07:14:16.403896+00:00" }, "domain": "automation", "item_id": "1758055141945", "trigger": "numeric state of sun.sun", "trace": { "trigger/13": [ { "path": "trigger/13", "timestamp": "2026-01-16T07:14:16.402241+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_keuken", "state": "on", "attributes": { "id": "1758055141945", "last_triggered": "2026-01-14T07:15:42.494411+00:00", "mode": "restart", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Keuken [BP]" }, "last_changed": "2026-01-15T08:04:17.790058+00:00", "last_reported": "2026-01-15T08:04:17.790058+00:00", "last_updated": "2026-01-15T08:04:17.790058+00:00", "context": { "id": "01KF0AY4QYBE01ZPZ9TKTK0DH5", "parent_id": null, "user_id": null } }, "trigger": { "id": "t9", "idx": "13", "alias": null, "platform": "numeric_state", "entity_id": "sun.sun", "below": null, "above": -4.0, "from_state": { "entity_id": "sun.sun", "state": "below_horizon", "attributes": { "next_dawn": "2026-01-17T06:57:29.214245+00:00", "next_dusk": "2026-01-16T16:39:29.769293+00:00", "next_midnight": "2026-01-16T23:49:00+00:00", "next_noon": "2026-01-16T11:48:29+00:00", "next_rising": "2026-01-16T07:37:25.658814+00:00", "next_setting": "2026-01-16T16:00:18.850979+00:00", "elevation": -4.13, "azimuth": 118.97, "rising": true, "friendly_name": "Sun" }, "last_changed": "2026-01-15T16:00:44.092093+00:00", "last_reported": "2026-01-16T07:12:16.398043+00:00", "last_updated": "2026-01-16T07:12:16.398043+00:00", "context": { "id": "01KF2TBKGEE7ZS3H9Y74ZP7GJE", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sun.sun", "state": "below_horizon", "attributes": { "next_dawn": "2026-01-17T06:57:29.214245+00:00", "next_dusk": "2026-01-16T16:39:29.769293+00:00", "next_midnight": "2026-01-16T23:49:00+00:00", "next_noon": "2026-01-16T11:48:29+00:00", "next_rising": "2026-01-16T07:37:25.658814+00:00", "next_setting": "2026-01-16T16:00:18.850979+00:00", "elevation": -3.86, "azimuth": 119.35, "rising": true, "friendly_name": "Sun" }, "last_changed": "2026-01-15T16:00:44.092093+00:00", "last_reported": "2026-01-16T07:14:16.398986+00:00", "last_updated": "2026-01-16T07:14:16.398986+00:00", "context": { "id": "01KF2TF8PEEKP0M3X8D38537S6", "parent_id": null, "user_id": null } }, "for": null, "description": "numeric state of sun.sun" }, "motion_trigger": [ "binary_sensor.beweging_keuken_bezetting" ], "light_switch": { "entity_id": "light.lamp_keuken_main" }, "boolean_scenes_scripts": [], "end_scenes": [], "time_delay": 5, "include_light_control": [ "use_brightness" ], "light_brightness": 80, "light_transition_on": 1, "light_transition_off": 1, "include_light_colour_control": "disable_colour_control", "light_colour_temperature": 5000, "light_rgb_colour": [ 255, 255, 255 ], "light_rgbw_colour": [ 255, 255, 255, 255 ], "light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_dynamic_lighting": "enable_sun_elevation_colour_brightness", "dynamic_lighting_lux_sensor": [], "dynamic_lighting_max_lux": 400, "dynamic_lighting_min_lux": 40, "dynamic_lighting_max_brightness": 80, "dynamic_lighting_min_brightness": 42, "dynamic_lighting_boolean": [], "dynamic_lighting_max_colour_temp": 4200, "dynamic_lighting_min_colour_temp": 2500, "dynamic_lighting_sun_elevation_start_rising": -1.5, "dynamic_lighting_sun_elevation_end_rising": 15, "dynamic_lighting_sun_elevation_start_falling": 15, "dynamic_lighting_sun_elevation_end_falling": -4.0, "dynamic_lighting_time_start_morning": "06:00:00", "dynamic_lighting_time_end_morning": "09:00:00", "dynamic_lighting_time_start_evening": "17:00:00", "dynamic_lighting_time_end_evening": "19:00:00", "dynamic_lighting_heartbeat": 1, "dynamic_lighting_step_value": 4, "dynamic_lighting_dead_zone": 7, "dynamic_lighting_state_control": "disable_state_control", "dynamic_lighting_state_control_activation_state": "on", "dynamic_lighting_state_control_entity": [], "include_bypass": [], "motion_bypass_lights_on": [], "motion_bypass_lights_off": [], "motion_bypass_lights_stop": [], "bypass_time_delay": 0, "include_bypass_auto_off": [], "bypass_auto_off_delay": 60, "include_sun": "sun_enabled", "sun_elevation": -1.5, "sun_elevation_rising": -4.0, "include_ambient": "ambient_disabled", "ambient_light_sensor": [], "ambient_light_options": "ambient_light_option_disabled", "ambient_light_value": 20, "ambient_light_high_value": 80, "include_time": "time_disabled", "after_time": "18:00:00", "before_time": "09:00:00", "weekday_options": [ "mon", "tue", "wed", "thu", "fri", "sat", "sun" ], "include_state_control": "state_control_disabled", "state_control_activation_state": "off", "state_control_entity": [], "include_device_tracker": "device_tracker_disabled", "zone": [], "people": [], "include_night_lights": "night_lights_enabled", "night_lights_conditions": [ "time_enabled" ], "night_lights_entity_state": [], "night_lights_after_time": "20:30:00", "night_lights_before_time": "06:00:00", "night_lights_sun_elevation": -1.5, "night_lights_sun_elevation_rising": -4.0, "night_lights": { "entity_id": "light.lamp_keuken_kleur" }, "night_boolean_scenes_scripts": [], "night_time_delay": 5, "include_night_light_control": [ "use_brightness", "use_transition" ], "night_light_brightness": 100, "night_light_transition_on": 0, "night_light_transition_off": 10, "include_night_light_colour_control": "use_colour_temperature", "night_light_colour_temperature": 2700, "night_light_rgb_colour": [ 255, 255, 255 ], "night_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_night_glow": "night_glow_disabled", "night_glow_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_glow_light_control": [ "use_brightness" ], "night_glow_light_brightness": 20, "night_glow_light_transition_on": 1, "night_glow_light_transition_off": 1, "include_night_glow_light_colour_control": "use_colour_temperature", "night_glow_light_colour_temperature": 2000, "night_glow_light_rgb_colour": [ 255, 255, 255 ], "night_glow_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_glow_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "light_entities_off": [ "light.lamp_keuken_main" ], "switch_entities_off": [], "light_data": { "brightness_pct": 80 }, "light_entities": [ "light.lamp_keuken_main" ], "switch_entities": [], "scene_entities": [], "script_entities": [], "boolean_scenes_scripts_helper": [], "end_scene_entities": [], "end_script_entities": [], "night_light_entities_off": [ "light.lamp_keuken_kleur" ], "night_switch_entities_off": [], "night_light_data": { "transition": 0, "brightness_pct": 100, "color_temp_kelvin": 2700 }, "night_light_entities": [ "light.lamp_keuken_kleur" ], "night_switch_entities": [], "night_scene_entities": [], "night_script_entities": [], "night_boolean_scenes_scripts_helper": [], "night_glow_light_data": { "brightness_pct": 20, "color_temp_kelvin": 2000 }, "night_glow_light_entities": [ "light.lamp_keuken_kleur" ], "night_glow_switch_entities": [], "night_glow_scene_entities": [], "night_glow_script_entities": [], "crossover_night_glow_to_night_lights_light": [], "crossover_night_glow_to_night_lights_switch": [], "crossover_night_lights_to_night_glow_light": [], "crossover_night_lights_to_night_glow_switch": [], "crossover_lights_to_night_glow_light": [ "light.lamp_keuken_main" ], "crossover_lights_to_night_glow_switch": [], "crossover_lights_light": [], "crossover_lights_switch": [], "crossover_night_lights_light_on": [], "crossover_night_lights_light": [], "crossover_night_lights_switch": [], "crossover_lights_light_on": [], "dynamic_lighting_state_control_activation_state_inv": "off" } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-16T07:14:16.402268+00:00", "result": { "result": false } } ], "condition/0/conditions/0": [ { "path": "condition/0/conditions/0", "timestamp": "2026-01-16T07:14:16.402292+00:00", "result": { "result": false } } ], "condition/0/conditions/0/conditions/0": [ { "path": "condition/0/conditions/0/conditions/0", "timestamp": "2026-01-16T07:14:16.402312+00:00", "result": { "result": false } } ], "condition/0/conditions/1": [ { "path": "condition/0/conditions/1", "timestamp": "2026-01-16T07:14:16.402340+00:00", "result": { "result": false } } ], "condition/0/conditions/1/conditions/0": [ { "path": "condition/0/conditions/1/conditions/0", "timestamp": "2026-01-16T07:14:16.402358+00:00", "result": { "result": false } } ], "condition/0/conditions/2": [ { "path": "condition/0/conditions/2", "timestamp": "2026-01-16T07:14:16.402381+00:00", "result": { "result": false } } ], "condition/0/conditions/2/conditions/0": [ { "path": "condition/0/conditions/2/conditions/0", "timestamp": "2026-01-16T07:14:16.402397+00:00", "result": { "result": false } } ], "condition/0/conditions/3": [ { "path": "condition/0/conditions/3", "timestamp": "2026-01-16T07:14:16.402418+00:00", "result": { "result": false } } ], "condition/0/conditions/3/conditions/0": [ { "path": "condition/0/conditions/3/conditions/0", "timestamp": "2026-01-16T07:14:16.402434+00:00", "result": { "result": false } } ], "condition/0/conditions/4": [ { "path": "condition/0/conditions/4", "timestamp": "2026-01-16T07:14:16.402454+00:00", "result": { "result": false } } ], "condition/0/conditions/4/conditions/0": [ { "path": "condition/0/conditions/4/conditions/0", "timestamp": "2026-01-16T07:14:16.402471+00:00", "result": { "result": false } } ], "condition/0/conditions/5": [ { "path": "condition/0/conditions/5", "timestamp": "2026-01-16T07:14:16.402492+00:00", "result": { "result": false } } ], "condition/0/conditions/5/conditions/0": [ { "path": "condition/0/conditions/5/conditions/0", "timestamp": "2026-01-16T07:14:16.402508+00:00", "result": { "result": false } } ], "condition/0/conditions/6": [ { "path": "condition/0/conditions/6", "timestamp": "2026-01-16T07:14:16.402529+00:00", "result": { "result": false } } ], "condition/0/conditions/6/conditions/0": [ { "path": "condition/0/conditions/6/conditions/0", "timestamp": "2026-01-16T07:14:16.402544+00:00", "result": { "result": false } } ], "condition/0/conditions/7": [ { "path": "condition/0/conditions/7", "timestamp": "2026-01-16T07:14:16.402564+00:00", "result": { "result": false } } ], "condition/0/conditions/7/conditions/0": [ { "path": "condition/0/conditions/7/conditions/0", "timestamp": "2026-01-16T07:14:16.402580+00:00", "result": { "result": false } } ], "condition/0/conditions/8": [ { "path": "condition/0/conditions/8", "timestamp": "2026-01-16T07:14:16.402601+00:00", "result": { "result": false } } ], "condition/0/conditions/8/conditions/0": [ { "path": "condition/0/conditions/8/conditions/0", "timestamp": "2026-01-16T07:14:16.402616+00:00", "result": { "result": false } } ], "condition/0/conditions/9": [ { "path": "condition/0/conditions/9", "timestamp": "2026-01-16T07:14:16.402636+00:00", "result": { "result": false } } ], "condition/0/conditions/9/conditions/0": [ { "path": "condition/0/conditions/9/conditions/0", "timestamp": "2026-01-16T07:14:16.402651+00:00", "result": { "result": false } } ], "condition/0/conditions/10": [ { "path": "condition/0/conditions/10", "timestamp": "2026-01-16T07:14:16.402672+00:00", "result": { "result": false } } ], "condition/0/conditions/10/conditions/0": [ { "path": "condition/0/conditions/10/conditions/0", "timestamp": "2026-01-16T07:14:16.402687+00:00", "result": { "result": false } } ], "condition/0/conditions/11": [ { "path": "condition/0/conditions/11", "timestamp": "2026-01-16T07:14:16.402707+00:00", "result": { "result": false } } ], "condition/0/conditions/11/conditions/0": [ { "path": "condition/0/conditions/11/conditions/0", "timestamp": "2026-01-16T07:14:16.402722+00:00", "result": { "result": false } } ], "condition/0/conditions/12": [ { "path": "condition/0/conditions/12", "timestamp": "2026-01-16T07:14:16.402742+00:00", "result": { "result": false } } ], "condition/0/conditions/12/conditions/0": [ { "path": "condition/0/conditions/12/conditions/0", "timestamp": "2026-01-16T07:14:16.402757+00:00", "result": { "result": false } } ], "condition/0/conditions/13": [ { "path": "condition/0/conditions/13", "timestamp": "2026-01-16T07:14:16.402777+00:00", "result": { "result": false } } ], "condition/0/conditions/13/conditions/0": [ { "path": "condition/0/conditions/13/conditions/0", "timestamp": "2026-01-16T07:14:16.402792+00:00", "result": { "result": true } } ], "condition/0/conditions/13/conditions/1": [ { "path": "condition/0/conditions/13/conditions/1", "timestamp": "2026-01-16T07:14:16.402809+00:00", "result": { "result": true, "entities": [] } } ], "condition/0/conditions/13/conditions/2": [ { "path": "condition/0/conditions/13/conditions/2", "timestamp": "2026-01-16T07:14:16.402915+00:00", "result": { "result": false } } ], "condition/0/conditions/13/conditions/2/conditions/0": [ { "path": "condition/0/conditions/13/conditions/2/conditions/0", "timestamp": "2026-01-16T07:14:16.402933+00:00", "result": { "result": false, "entities": [ "light.lamp_keuken_main" ] } } ], "condition/0/conditions/13/conditions/2/conditions/1": [ { "path": "condition/0/conditions/13/conditions/2/conditions/1", "timestamp": "2026-01-16T07:14:16.403046+00:00", "result": { "result": false, "entities": [ "light.lamp_keuken_kleur" ] } } ], "condition/0/conditions/13/conditions/2/conditions/2": [ { "path": "condition/0/conditions/13/conditions/2/conditions/2", "timestamp": "2026-01-16T07:14:16.403160+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/13/conditions/2/conditions/3": [ { "path": "condition/0/conditions/13/conditions/2/conditions/3", "timestamp": "2026-01-16T07:14:16.403260+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/13/conditions/2/conditions/4": [ { "path": "condition/0/conditions/13/conditions/2/conditions/4", "timestamp": "2026-01-16T07:14:16.403338+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/13/conditions/2/conditions/5": [ { "path": "condition/0/conditions/13/conditions/2/conditions/5", "timestamp": "2026-01-16T07:14:16.403414+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/14": [ { "path": "condition/0/conditions/14", "timestamp": "2026-01-16T07:14:16.403494+00:00", "result": { "result": false } } ], "condition/0/conditions/14/conditions/0": [ { "path": "condition/0/conditions/14/conditions/0", "timestamp": "2026-01-16T07:14:16.403513+00:00", "result": { "result": false } } ], "condition/0/conditions/15": [ { "path": "condition/0/conditions/15", "timestamp": "2026-01-16T07:14:16.403534+00:00", "result": { "result": false } } ], "condition/0/conditions/15/conditions/0": [ { "path": "condition/0/conditions/15/conditions/0", "timestamp": "2026-01-16T07:14:16.403550+00:00", "result": { "result": false } } ], "condition/0/conditions/16": [ { "path": "condition/0/conditions/16", "timestamp": "2026-01-16T07:14:16.403571+00:00", "result": { "result": false } } ], "condition/0/conditions/16/conditions/0": [ { "path": "condition/0/conditions/16/conditions/0", "timestamp": "2026-01-16T07:14:16.403588+00:00", "result": { "result": false } } ], "condition/0/conditions/17": [ { "path": "condition/0/conditions/17", "timestamp": "2026-01-16T07:14:16.403608+00:00", "result": { "result": false } } ], "condition/0/conditions/17/conditions/0": [ { "path": "condition/0/conditions/17/conditions/0", "timestamp": "2026-01-16T07:14:16.403624+00:00", "result": { "result": false } } ], "condition/0/conditions/18": [ { "path": "condition/0/conditions/18", "timestamp": "2026-01-16T07:14:16.403644+00:00", "result": { "result": false } } ], "condition/0/conditions/18/conditions/0": [ { "path": "condition/0/conditions/18/conditions/0", "timestamp": "2026-01-16T07:14:16.403660+00:00", "result": { "result": false } } ], "condition/0/conditions/19": [ { "path": "condition/0/conditions/19", "timestamp": "2026-01-16T07:14:16.403680+00:00", "result": { "result": false } } ], "condition/0/conditions/19/conditions/0": [ { "path": "condition/0/conditions/19/conditions/0", "timestamp": "2026-01-16T07:14:16.403695+00:00", "result": { "result": false } } ], "condition/0/conditions/20": [ { "path": "condition/0/conditions/20", "timestamp": "2026-01-16T07:14:16.403715+00:00", "result": { "result": false } } ], "condition/0/conditions/20/conditions/0": [ { "path": "condition/0/conditions/20/conditions/0", "timestamp": "2026-01-16T07:14:16.403730+00:00", "result": { "result": false } } ], "condition/0/conditions/21": [ { "path": "condition/0/conditions/21", "timestamp": "2026-01-16T07:14:16.403750+00:00", "result": { "result": false } } ], "condition/0/conditions/21/conditions/0": [ { "path": "condition/0/conditions/21/conditions/0", "timestamp": "2026-01-16T07:14:16.403766+00:00", "result": { "result": false } } ], "condition/0/conditions/22": [ { "path": "condition/0/conditions/22", "timestamp": "2026-01-16T07:14:16.403785+00:00", "result": { "result": false } } ], "condition/0/conditions/22/conditions/0": [ { "path": "condition/0/conditions/22/conditions/0", "timestamp": "2026-01-16T07:14:16.403801+00:00", "result": { "result": false } } ], "condition/0/conditions/23": [ { "path": "condition/0/conditions/23", "timestamp": "2026-01-16T07:14:16.403821+00:00", "result": { "result": false } } ], "condition/0/conditions/23/conditions/0": [ { "path": "condition/0/conditions/23/conditions/0", "timestamp": "2026-01-16T07:14:16.403837+00:00", "result": { "result": false } } ], "condition/0/conditions/24": [ { "path": "condition/0/conditions/24", "timestamp": "2026-01-16T07:14:16.403856+00:00", "result": { "result": false } } ], "condition/0/conditions/24/conditions/0": [ { "path": "condition/0/conditions/24/conditions/0", "timestamp": "2026-01-16T07:14:16.403871+00:00", "result": { "result": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "motion_trigger": [ "binary_sensor.beweging_keuken_bezetting" ], "light_switch": { "entity_id": "light.lamp_keuken_main" }, "boolean_scenes_scripts": [], "end_scenes": [], "time_delay": 5, "include_light_control": [ "use_brightness" ], "light_brightness": 80, "light_transition_on": 1, "light_transition_off": 1, "include_light_colour_control": "disable_colour_control", "light_colour_temperature": 5000, "light_rgb_colour": [ 255, 255, 255 ], "light_rgbw_colour": [ 255, 255, 255, 255 ], "light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_dynamic_lighting": "enable_sun_elevation_colour_brightness", "dynamic_lighting_lux_sensor": [], "dynamic_lighting_max_lux": 400, "dynamic_lighting_min_lux": 40, "dynamic_lighting_max_brightness": 80, "dynamic_lighting_min_brightness": 42, "dynamic_lighting_boolean": [], "dynamic_lighting_max_colour_temp": 4200, "dynamic_lighting_min_colour_temp": 2500, "dynamic_lighting_sun_elevation_start_rising": -1.5, "dynamic_lighting_sun_elevation_end_rising": 15, "dynamic_lighting_sun_elevation_start_falling": 15, "dynamic_lighting_sun_elevation_end_falling": -4.0, "dynamic_lighting_time_start_morning": "06:00:00", "dynamic_lighting_time_end_morning": "09:00:00", "dynamic_lighting_time_start_evening": "17:00:00", "dynamic_lighting_time_end_evening": "19:00:00", "dynamic_lighting_heartbeat": 1, "dynamic_lighting_step_value": 4, "dynamic_lighting_dead_zone": 7, "dynamic_lighting_state_control": "disable_state_control", "dynamic_lighting_state_control_activation_state": "on", "dynamic_lighting_state_control_entity": [], "include_bypass": [], "motion_bypass_lights_on": [], "motion_bypass_lights_off": [], "motion_bypass_lights_stop": [], "bypass_time_delay": 0, "include_bypass_auto_off": [], "bypass_auto_off_delay": 60, "include_sun": "sun_enabled", "sun_elevation": -1.5, "sun_elevation_rising": -4.0, "include_ambient": "ambient_disabled", "ambient_light_sensor": [], "ambient_light_options": "ambient_light_option_disabled", "ambient_light_value": 20, "ambient_light_high_value": 80, "include_time": "time_disabled", "after_time": "18:00:00", "before_time": "09:00:00", "weekday_options": [ "mon", "tue", "wed", "thu", "fri", "sat", "sun" ], "include_state_control": "state_control_disabled", "state_control_activation_state": "off", "state_control_entity": [], "include_device_tracker": "device_tracker_disabled", "zone": [], "people": [], "include_night_lights": "night_lights_enabled", "night_lights_conditions": [ "time_enabled" ], "night_lights_entity_state": [], "night_lights_after_time": "20:30:00", "night_lights_before_time": "06:00:00", "night_lights_sun_elevation": -1.5, "night_lights_sun_elevation_rising": -4.0, "night_lights": { "entity_id": "light.lamp_keuken_kleur" }, "night_boolean_scenes_scripts": [], "night_time_delay": 5, "include_night_light_control": [ "use_brightness", "use_transition" ], "night_light_brightness": 100, "night_light_transition_on": 0, "night_light_transition_off": 10, "include_night_light_colour_control": "use_colour_temperature", "night_light_colour_temperature": 2700, "night_light_rgb_colour": [ 255, 255, 255 ], "night_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_night_glow": "night_glow_disabled", "night_glow_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_glow_light_control": [ "use_brightness" ], "night_glow_light_brightness": 20, "night_glow_light_transition_on": 1, "night_glow_light_transition_off": 1, "include_night_glow_light_colour_control": "use_colour_temperature", "night_glow_light_colour_temperature": 2000, "night_glow_light_rgb_colour": [ 255, 255, 255 ], "night_glow_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_glow_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "light_entities_off": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'light')\n | selectattr('state', 'eq', 'off')\n | map(attribute='entity_id')\n | list }}\n", "switch_entities_off": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'switch')\n | selectattr('state', 'eq', 'off')\n | map(attribute='entity_id')| list }}\n", "light_data": "{% set light = namespace(data={}) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': light_brightness }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}", "light_entities": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'light')\n | map(attribute='entity_id')\n | list }}\n", "switch_entities": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'switch')\n | map(attribute='entity_id')\n | list }}\n", "scene_entities": "{% set a = light_switch.entity_id %} {% if boolean_scenes_scripts == [] %}\n {{ expand(a) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% elif is_state(boolean_scenes_scripts, 'off') %}\n {{ expand(a) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "script_entities": "{% set a = light_switch.entity_id %} {% if boolean_scenes_scripts == [] %}\n {{ expand(a) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% elif is_state(boolean_scenes_scripts, 'off') %}\n {{ expand(a) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "boolean_scenes_scripts_helper": "{% if boolean_scenes_scripts | length > 0 and states(boolean_scenes_scripts) == 'off' %}\n {{ boolean_scenes_scripts }}\n{% else %}\n []\n{% endif %}", "end_scene_entities": "{{ end_scenes | select('match', '^scene\\..*') | list }}", "end_script_entities": "{{ end_scenes | select('match', '^script\\..*') | list }}", "night_light_entities_off": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'off') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_switch_entities_off": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'switch') | selectattr('state', 'eq', 'off') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_light_data": "{% set light = namespace(data={}) %} {% if 'use_transition' in include_night_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': night_light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_night_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': night_light_brightness }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': night_light_colour_temperature }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': night_light_rgb_colour }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': night_light_rgbw_colour }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': night_light_rgbww_colour }) %}\n{% endif %} {{ light.data }}", "night_light_entities": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_switch_entities": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_scene_entities": "{% set b = night_lights and night_lights.entity_id %} {% if night_boolean_scenes_scripts == [] %}\n {{ expand(b) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% elif is_state(night_boolean_scenes_scripts, 'off') %}\n {{ expand(b) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_script_entities": "{% set b = night_lights and night_lights.entity_id %} {% if night_boolean_scenes_scripts == [] %}\n {{ expand(b) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% elif is_state(night_boolean_scenes_scripts, 'off') %}\n {{ expand(b) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_boolean_scenes_scripts_helper": "{% if night_boolean_scenes_scripts | length > 0 and states(night_boolean_scenes_scripts) == 'off' %}\n {{ night_boolean_scenes_scripts }}\n{% else %}\n []\n{% endif %}", "night_glow_light_data": "{% set light = namespace(data={}) %} {% if 'use_transition' in include_night_glow_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': night_glow_light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_night_glow_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': night_glow_light_brightness }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': night_glow_light_colour_temperature }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': night_glow_light_rgb_colour }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': night_glow_light_rgbw_colour }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': night_glow_light_rgbww_colour }) %}\n{% endif %} {{ light.data }}", "night_glow_light_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_glow_switch_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_glow_scene_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_glow_script_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_glow_to_night_lights_light": "{% set a = night_lights and night_lights.entity_id %} {% set b = night_glow_lights and night_glow_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_glow_to_night_lights_switch": "{% set a = night_lights and night_lights.entity_id %} {% set b = night_glow_lights and night_glow_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_to_night_glow_light": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_to_night_glow_switch": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_to_night_glow_light": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = light_switch.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_to_night_glow_switch": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = light_switch.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_light": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(a) | reject('in', expand(b)) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_switch": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(a) | reject('in', expand(b)) | selectattr('domain', 'eq', 'switch') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_light_on": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_light": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_switch": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_light_on": "{% set a = light_switch.entity_id %} {% if a %}\n {{ expand(a) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "dynamic_lighting_state_control_activation_state_inv": "{% if dynamic_lighting_state_control_activation_state == 'on' %}\n off\n{% else %}\n on\n{% endif %}\n" }, "triggers": [ { "trigger": "state", "id": "t0", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "from": "off", "to": "on" }, { "trigger": "numeric_state", "id": "t1", "entity_id": "sun.sun", "attribute": "elevation", "below": -1.5 }, { "trigger": "numeric_state", "id": "t2", "entity_id": [], "below": 20 }, { "trigger": "time", "id": "t3", "at": "18:00:00" }, { "trigger": "state", "id": "t4", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "time", "id": "t5", "at": "20:30:00" }, { "trigger": "numeric_state", "id": "t6", "entity_id": "sun.sun", "attribute": "elevation", "below": -1.5 }, { "trigger": "state", "id": "t7_on", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t7_off", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t7_stop", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t8_on", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "state", "id": "t8_off", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "state", "id": "t8_stop", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "numeric_state", "id": "t9", "entity_id": "sun.sun", "attribute": "elevation", "above": -4.0 }, { "trigger": "numeric_state", "id": "t10", "entity_id": [], "above": 80 }, { "trigger": "time", "id": "t11", "at": "09:00:00" }, { "trigger": "state", "id": "t12", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "time", "id": "t13", "at": "06:00:00" }, { "trigger": "numeric_state", "id": "t14", "entity_id": "sun.sun", "attribute": "elevation", "above": -4.0 }, { "trigger": "state", "id": "t15", "entity_id": [], "to": "on" }, { "trigger": "state", "id": "t16", "entity_id": [], "from": "on" }, { "trigger": "state", "id": "t17", "entity_id": [], "to": "off" }, { "trigger": "state", "id": "t18", "entity_id": [], "from": "off" }, { "trigger": "homeassistant", "id": "t19", "event": "start" } ], "actions": [ { "choose": [ { "alias": "Check if night lights are enabled and within conditions", "conditions": [ { "condition": "and", "conditions": [ { "alias": "Check if night lights is enabled", "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_enabled' }}" }, { "alias": "Check if night lights entity state is enabled", "condition": "or", "conditions": [ "{{ ('time_enabled' in night_lights_conditions) and not ('entity_state_enabled' in night_lights_conditions) }}", "{{ ('sun_enabled' in night_lights_conditions) and not ('entity_state_enabled' in night_lights_conditions) }}", { "condition": "and", "conditions": [ "{{ 'entity_state_enabled' in night_lights_conditions }}", { "condition": "state", "entity_id": [], "state": "on", "match": "any" } ] } ] }, { "alias": "Check if night lights time is enabled", "condition": "or", "conditions": [ "{{ ('entity_state_enabled' in night_lights_conditions) and not ('time_enabled' in night_lights_conditions) }}", "{{ ('sun_enabled' in night_lights_conditions) and not ('time_enabled' in night_lights_conditions) }}", { "condition": "and", "conditions": [ "{{ 'time_enabled' in night_lights_conditions }}", { "condition": "time", "after": "20:30:00", "before": "06:00:00" } ] } ] }, { "alias": "Check if night lights sun is enabled", "condition": "or", "conditions": [ "{{ ('entity_state_enabled' in night_lights_conditions) and not ('sun_enabled' in night_lights_conditions) }}", "{{ ('time_enabled' in night_lights_conditions) and not ('sun_enabled' in night_lights_conditions) }}", "{{ ('sun_enabled' in night_lights_conditions) and (((is_state_attr('sun.sun', 'rising', false)) and (state_attr('sun.sun','elevation') <= night_lights_sun_elevation | float(90))) or ((is_state_attr('sun.sun', 'rising', true)) and (state_attr('sun.sun','elevation') <= night_lights_sun_elevation_rising | float(90)))) }}" ] } ] } ], "sequence": [ { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "By-pass is turned on & check by-pass option - Turn lights off", "conditions": [ { "condition": "trigger", "id": "t7_off" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] }, { "alias": "By-pass is turned on & check by-pass option - Keep the current lights state", "conditions": [ { "condition": "trigger", "id": "t7_stop" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & check if the motion trigger is off", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "all", "state": "off" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If night glow is disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] }, { "alias": "If night glow is enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn on the lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": "{{ night_glow_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn OFF crossover lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_to_night_glow_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" } }, { "alias": "Turn OFF crossover lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_to_night_glow_light }}" } } ] } ] }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_on }}" } }, { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}", "transition": "{{ night_glow_light_transition_on }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } }, { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn OFF crossover night switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_switch }}" } }, { "alias": "Turn OFF crossover light switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_to_night_glow_switch }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ night_glow_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Motion trigger is off and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "By-pass is turned off & check if the motion trigger is on", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] }, { "condition": "or", "conditions": [ "{{ (include_sun == 'sun_enabled') and (state_attr('sun.sun','elevation') >= sun_elevation | float(90)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_disabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (is_state(night_boolean_scenes_scripts, 'off')) }}", { "condition": "and", "conditions": [ "{{ include_time == 'time_enabled' }}", { "condition": "time", "after": "09:00:00", "before": "18:00:00" } ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "template", "value_template": "{% set opposite = 'off' if state_control_activation_state == 'on' else 'on' %} {{ is_state(state_control_entity, opposite) }}" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] }, { "alias": "Motion trigger is on and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned off & reset lights to the site conditions", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "choose": [ { "alias": "Check if normal lights Scenes & Scripts - Toggle Helper is on", "conditions": [ { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean normal lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ crossover_night_lights_light_on }}" }, "data": "{{ night_light_data }}" } ] } ] } ] } ] }, { "choose": [ { "alias": "Sun, ambient, time & state control above setting to turn off", "conditions": [ { "condition": "trigger", "id": [ "t9", "t10", "t11", "t18" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] }, { "alias": "Turn off normal lights when trigger by start night lights conditions", "conditions": [ { "condition": "trigger", "id": [ "t4", "t5", "t6" ] } ], "sequence": [ { "choose": [ { "alias": "light - switch - scene - script is ON", "conditions": [ { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "choose": [ { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the input boolean normal lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ crossover_night_lights_light_on }}" }, "data": "{{ night_light_data }}" } ] } ] } ] }, { "alias": "Turn on night glow lights if all lights are off", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" }, { "condition": "template", "value_template": "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (is_state(boolean_scenes_scripts, 'off')) }}\n" } ], "sequence": [ { "alias": "Turn on the lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": "{{ night_glow_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}", "transition": "{{ night_glow_light_transition_on }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ night_glow_script_entities }}" } }, { "stop": "Stop the automation" } ] }, { "alias": "If manage scripts is enabled", "conditions": [ "{{ 'manage_scripts_crossing_over' in include_night_light_control }}", "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (is_state(boolean_scenes_scripts, 'off')) }}" ], "sequence": [ { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Safe Guard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t19" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Small time delay required", "delay": { "seconds": 1 } } ] }, { "alias": "Check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass auto off is enabled and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "choose": [ { "alias": "If night glow is disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_disabled' }}" } ], "sequence": [ { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_light_entities_off }}" }, "data": "{{ night_light_data }}" }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ { "condition": "template", "value_template": "{% if boolean_scenes_scripts == [] %}\n false\n{% elif is_state(boolean_scenes_scripts, 'on') %}\n true\n{% else %}\n false\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": "{{ boolean_scenes_scripts }}" } }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ "{{ night_boolean_scenes_scripts != [] }}" ], "sequence": [ { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" }, "data": { "transition": "{{ night_light_transition_on }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] }, { "alias": "Turn on the night switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_switch_entities_off }}" } }, { "alias": "Turn on the night scripts", "action": "script.turn_on", "target": { "entity_id": "{{ night_script_entities }}" } } ] }, { "alias": "If night glow is enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" }, { "condition": "not", "conditions": [ { "condition": "trigger", "id": [ "t15", "t16" ] } ] } ], "sequence": [ { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_light_entities }}" }, "data": "{{ night_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night glow lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night glow lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ { "condition": "template", "value_template": "{% if boolean_scenes_scripts == [] %}\n false\n{% elif is_state(boolean_scenes_scripts, 'on') %}\n true\n{% else %}\n false\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": "{{ boolean_scenes_scripts }}" } }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ "{{ night_boolean_scenes_scripts != [] }}" ], "sequence": [ { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" }, "data": { "transition": "{{ night_light_transition_on }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] }, { "alias": "Turn on the night switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off crossover night glow switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } }, { "alias": "Turn on the night scripts", "action": "script.turn_on", "target": { "entity_id": "{{ night_script_entities }}" } } ] } ] }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - Turn lights on", "conditions": [ { "condition": "trigger", "id": "t7_on" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Check if the trigger is on and wait for it to go off", "conditions": [ { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" } ], "sequence": [ { "alias": "Wait until motion sensor is off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Wait the number of minutes set in the night lights time delay", "delay": { "minutes": 5 } }, { "choose": [ { "alias": "If night glow is disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] }, { "alias": "If night glow is enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn on the lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": "{{ night_glow_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" } } ] } ] }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}", "transition": "{{ night_glow_light_transition_on }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn OFF crossover night switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_switch }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ night_glow_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ], "default": [ { "choose": [ { "alias": "By-pass is turned on & check by-pass option - Turn lights off", "conditions": [ { "condition": "trigger", "id": "t7_off" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If night lights are disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] }, { "alias": "If night lights are enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] } ] }, { "alias": "By-pass is turned on & check by-pass option - Keep the current lights state", "conditions": [ { "condition": "trigger", "id": "t7_stop" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & check if the motion trigger is off", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "all", "state": "off" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If night lights are disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "If night lights are enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Motion trigger is off and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "By-pass is turned off & check if the motion trigger is on", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] }, { "condition": "or", "conditions": [ "{{ (include_sun == 'sun_enabled') and (state_attr('sun.sun','elevation') >= sun_elevation | float(90)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_disabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (is_state(boolean_scenes_scripts, 'off')) }}", { "condition": "and", "conditions": [ { "condition": "time", "after": "09:00:00", "before": "18:00:00" }, "{{ include_time == 'time_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "template", "value_template": "{% set opposite = 'off' if state_control_activation_state == 'on' else 'on' %} {{ is_state(state_control_entity, opposite) }}" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Motion trigger is on and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned off & reset lights to the site conditions", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] } ] } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "choose": [ { "alias": "Check if night lights scenes & scripts - toggle helper is on", "conditions": [ { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "Turn ON lights", "conditions": [ { "alias": "Check the dynamic lighting options", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'disable_dynamic_lighting' }}" }, { "alias": "Check that dynamic lighting is active and the state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "template", "value_template": "{{ states(dynamic_lighting_state_control_entity) == dynamic_lighting_state_control_activation_state_inv }}" } ] } ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ crossover_lights_light_on }}" }, "data": "{{ light_data }}" }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ] } ] } ] } ] } ] }, { "choose": [ { "alias": "Sun, ambient, time & state control above setting to turn off", "conditions": [ { "condition": "trigger", "id": [ "t9", "t10", "t11", "t18" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Turn off night lights when trigger by end night lights conditions", "conditions": [ { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "choose": [ { "alias": "If the night glow is enabled", "conditions": [ "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "off", "for": { "minutes": 5 } } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": { "transition": "{{ night_glow_light_transition_off}}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_glow_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_glow_light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "stop": "Stop the automation" } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or (is_state(night_boolean_scenes_scripts, 'on')) }}\n" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "choose": [ { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Turn ON lights", "conditions": [ { "alias": "Check the dynamic lighting options", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'disable_dynamic_lighting' }}" }, { "alias": "Check that dynamic lighting is active and the state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "template", "value_template": "{{ states(dynamic_lighting_state_control_entity) == dynamic_lighting_state_control_activation_state_inv }}" } ] } ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ crossover_lights_light_on }}" }, "data": "{{ light_data }}" } ] } ] } ] } ] } ] }, { "alias": "If manage scripts is enabled", "conditions": [ "{{ 'manage_scripts_crossing_over' in include_night_light_control }}", "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (is_state(night_boolean_scenes_scripts, 'off')) }}" ], "sequence": [ { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Safe Guard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t19" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Small time delay required", "delay": { "seconds": 1 } } ] }, { "alias": "Check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass auto off is enabled and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "alias": "Parallel actions for dynamic lighting and normal lights", "parallel": [ { "sequence": [ { "alias": "Check if the dynamic lighting is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "alias": "Check the dynamic lighting state control option", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'disable_state_control' }}" }, { "alias": "Check if the dynamic lighting state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "state", "entity_id": [], "state": "on" } ] } ] } ] }, { "choose": [ { "alias": "Dynamic Lighting - Input Boolean Helper", "conditions": [ { "condition": "template", "value_template": "{{ dynamic_lighting_boolean != [] }}" } ], "sequence": [ { "alias": "Turn on the boolean for dynamic lighting", "action": "input_boolean.turn_on", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "1 - Dynamic Lighting - Lux Controlled Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness'}}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n false\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "2 - Dynamic Lighting - Lux Controlled Brightness - Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness_inv'}}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting brightness inverted for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "3 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': light_brightness }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if elevation >= (dynamic_lighting_sun_elevation_start_rising - 2) and elevation <= (dynamic_lighting_sun_elevation_end_rising + 2) and is_state_attr('sun.sun', 'rising', true) %}\n false\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_falling + 2) and elevation >= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n false\n {% elif elevation >= (dynamic_lighting_sun_elevation_end_rising + 2) and elevation >= (dynamic_lighting_sun_elevation_start_falling - 2) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_rising - 2) and is_state_attr('sun.sun', 'rising', true) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n true\n {% else %}\n true\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If sun elevation is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "4 - Dynamic Lighting - Sun Elevation Lighting - Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "5 - Dynamic Lighting - Sun Elevation Lighting - Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness_inv' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness inverted for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "6 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "7 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness_inv' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "8 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Lux Controlled Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" } ], "sequence": [ { "alias": "Parallel actions for dynamic lighting", "parallel": [ { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_kelvin": "{% if expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 %}\n {% set elevation = state_attr('sun.sun', 'elevation') | float %}\n {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %}\n {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %}\n {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %}\n {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %}\n {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% endif %}\n {{ colour_temp_value | round(0) }}\n{% endif %}\n", "dynamic_light_off_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n false\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Check if the light is off", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Delay for parallel actions needed for when the light is off", "delay": { "milliseconds": 100 } } ] } ] }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" }, "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}" ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_off_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] }, { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if elevation >= (dynamic_lighting_sun_elevation_start_rising - 2) and elevation <= (dynamic_lighting_sun_elevation_end_rising + 2) and is_state_attr('sun.sun', 'rising', true) %}\n false\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_falling + 2) and elevation >= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n false\n {% elif elevation >= (dynamic_lighting_sun_elevation_end_rising + 2) and elevation >= (dynamic_lighting_sun_elevation_start_falling - 2) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_rising - 2) and is_state_attr('sun.sun', 'rising', true) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n true\n {% else %}\n true\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If sun elevation is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If the lights are OFF", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] } ] } ] }, { "choose": [ { "alias": "9 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Lux Controlled Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" } ], "sequence": [ { "alias": "Parallel actions for dynamic lighting", "parallel": [ { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_kelvin": "{% if expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 %}\n {% set elevation = state_attr('sun.sun', 'elevation') | float %}\n {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %}\n {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %}\n {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %}\n {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %}\n {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% endif %}\n {{ colour_temp_value | round(0) }}\n{% endif %}\n", "dynamic_light_off_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Check if the light is off", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Delay for parallel actions needed for when the light is off", "delay": { "milliseconds": 100 } } ] } ] }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" }, "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}" ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_off_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] }, { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if elevation >= (dynamic_lighting_sun_elevation_start_rising - 2) and elevation <= (dynamic_lighting_sun_elevation_end_rising + 2) and is_state_attr('sun.sun', 'rising', true) %}\n false\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_falling + 2) and elevation >= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n false\n {% elif elevation >= (dynamic_lighting_sun_elevation_end_rising + 2) and elevation >= (dynamic_lighting_sun_elevation_start_falling - 2) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_rising - 2) and is_state_attr('sun.sun', 'rising', true) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n true\n {% else %}\n true\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If sun elevation is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If the lights are OFF", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] } ] } ] }, { "choose": [ { "alias": "10 - Dynamic Lighting - Time Controlled - Colour Temp", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_colour_temp %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set colour_temp_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set colour_temp_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% elif current_time < start_time_morning %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% elif current_time > end_time_evening %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': light_brightness }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "11 - Dynamic Lighting - Time Controlled - Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_brightness %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set brightness_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set brightness_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% elif current_time < start_time_morning %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% elif current_time > end_time_evening %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "12 - Dynamic Lighting - Time Controlled - Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness_inv' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_max_brightness %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set brightness_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set brightness_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% elif current_time < start_time_morning %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% elif current_time > end_time_evening %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "13 - Dynamic Lighting - Time Controlled - Colour Temp & Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_brightness %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set brightness_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set brightness_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% elif current_time < start_time_morning %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% elif current_time > end_time_evening %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_kelvin": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_colour_temp %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set colour_temp_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set colour_temp_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% elif current_time < start_time_morning %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% elif current_time > end_time_evening %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "sequence": [ { "choose": [ { "alias": "Turn ON lights", "conditions": [ { "alias": "Check the dynamic lighting options", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'disable_dynamic_lighting' }}" }, { "alias": "Check that dynamic lighting is active and the state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "template", "value_template": "{{ states(dynamic_lighting_state_control_entity) == dynamic_lighting_state_control_activation_state_inv }}" } ] } ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities_off }}" }, "data": "{{ light_data }}" } ] } ] }, { "choose": [ { "alias": "Dynamic Lighting State Control Turning OFF", "conditions": [ { "condition": "trigger", "id": "t16" }, { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ light_data }}" }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts == [] %}\n false\n{% elif is_state(night_boolean_scenes_scripts, 'on') %}\n true\n{% else %}\n false\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": "{{ night_boolean_scenes_scripts }}" } }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ "{{ boolean_scenes_scripts != [] }}" ], "sequence": [ { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ boolean_scenes_scripts_helper }}" } } ] } ] } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ scene_entities }}" }, "data": { "transition": "{{ light_transition_on }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ boolean_scenes_scripts_helper }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ scene_entities }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ boolean_scenes_scripts_helper }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ switch_entities_off }}" } }, { "alias": "Turn on the scripts", "action": "script.turn_on", "target": { "entity_id": "{{ script_entities }}" } }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - Turn lights on", "conditions": [ { "condition": "trigger", "id": "t7_on" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Check if the trigger is on and wait for it to go off", "conditions": [ { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" } ], "sequence": [ { "alias": "Wait until motion sensor is off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Wait the number of minutes set in the normal lights time delay", "delay": { "minutes": 5 } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ], "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t0" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t1" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, "{{ include_sun == 'sun_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t2" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, "{{ include_ambient == 'ambient_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t3" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, "{{ include_time == 'time_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t4" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'entity_state_enabled' in night_lights_conditions }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t5" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'time_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t6" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'sun_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t7_on" }, "{{ 'bypass_enabled_turn_on' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t7_off" }, "{{ 'bypass_enabled_turn_off' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t7_stop" }, "{{ 'bypass_enabled_stop' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t8_on" }, "{{ 'bypass_enabled_turn_on' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t8_off" }, "{{ 'bypass_enabled_turn_off' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t8_stop" }, "{{ 'bypass_enabled_stop' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t9" }, "{{ include_sun == 'sun_enabled' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t10" }, "{{ include_ambient == 'ambient_enabled' }}", "{{ ambient_light_options == 'ambient_light_option_disabled' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t11" }, "{{ include_time == 'time_enabled' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t12" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'entity_state_enabled' in night_lights_conditions }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t13" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'time_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t14" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'sun_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t15", "t16" ] }, { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, "{{ dynamic_lighting_state_control == 'enable_state_control' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t17" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t18" }, { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t19" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t19" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t19" }, "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ] }, { "condition": "or", "conditions": [ "{{ include_bypass == [] }}", { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t19" ] } ] }, { "condition": "or", "conditions": [ "{{ include_sun == 'sun_disabled' }}", "{{ include_sun == 'sun_enabled_night_lights' }}", "{{ (include_sun == 'sun_enabled') and (is_state_attr('sun.sun', 'rising', false)) and (state_attr('sun.sun','elevation') <= sun_elevation | float(90)) }}", "{{ (include_sun == 'sun_enabled') and (is_state_attr('sun.sun', 'rising', true)) and (state_attr('sun.sun','elevation') <= sun_elevation_rising | float(90)) }}", { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t9" ] } ] }, { "condition": "or", "conditions": [ "{{ include_ambient == 'ambient_disabled' }}", "{{ ambient_light_sensor == [] }}", "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_value | int)) }}", "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) and ((include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) }}", { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ( ambient_light_options == 'ambient_light_option_enabled' ) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ( ambient_light_options == 'ambient_light_option_enabled' ) }}", { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t10" ] } ] }, { "condition": "or", "conditions": [ "{{ include_time == 'time_disabled' }}", { "condition": "and", "conditions": [ { "condition": "time", "after": "18:00:00", "before": "09:00:00", "weekday": [ "mon", "tue", "wed", "thu", "fri", "sat", "sun" ] }, "{{ include_time == 'time_enabled' }}" ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t11" ] } ] }, { "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_disabled' }}" }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t18" ] } ] }, { "condition": "or", "conditions": [ "{{ include_device_tracker == 'device_tracker_disabled' }}", { "condition": "and", "conditions": [ "{{ include_device_tracker == 'zone_enabled' }}", { "condition": "numeric_state", "entity_id": [], "above": 0 } ] }, { "condition": "and", "conditions": [ "{{ include_device_tracker == 'zone_people_enabled' }}", "{{ (state_attr(zone, 'persons') | list | select('in', people) | list | length) > 0 }}" ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop" ] } ] } ], "id": "1758055141945", "alias": "Beweging Keuken", "description": "" }, "blueprint_inputs": { "id": "1758055141945", "alias": "Beweging Keuken", "description": "", "use_blueprint": { "path": "Blackshome/sensor-light.yaml", "input": { "motion_trigger": [ "binary_sensor.beweging_keuken_bezetting" ], "light_switch": { "entity_id": "light.lamp_keuken_main" }, "include_light_control": [ "use_brightness" ], "light_brightness": 80, "include_sun": "sun_enabled", "night_lights_conditions": [ "time_enabled" ], "include_time": "time_disabled", "after_time": "18:00:00", "before_time": "09:00:00", "night_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_light_control": [ "use_brightness", "use_transition" ], "night_light_brightness": 100, "include_night_light_colour_control": "use_colour_temperature", "night_light_colour_temperature": 2700, "include_night_glow": "night_glow_disabled", "night_glow_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_glow_light_colour_control": "use_colour_temperature", "night_glow_light_colour_temperature": 2000, "include_night_glow_light_control": [ "use_brightness" ], "include_dynamic_lighting": "enable_sun_elevation_colour_brightness", "dynamic_lighting_min_colour_temp": 2500, "include_night_lights": "night_lights_enabled", "dynamic_lighting_max_colour_temp": 4200, "night_lights_after_time": "20:30:00", "dynamic_lighting_max_brightness": 80, "dynamic_lighting_min_brightness": 42, "night_lights_before_time": "06:00:00", "night_light_transition_on": 0, "night_light_transition_off": 10 } } }, "context": { "id": "01KF2TF8PF2J6DKM5YNPDGN65M", "parent_id": "01KF2TF8PEEKP0M3X8D38537S6", "user_id": null } }, "short_dict": { "last_step": "condition/0/conditions/24/conditions/0", "run_id": "12fd9115ea5dad56325b306c44777969", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T07:14:16.399415+00:00", "finish": "2026-01-16T07:14:16.403896+00:00" }, "domain": "automation", "item_id": "1758055141945", "trigger": "numeric state of sun.sun" } }, { "extended_dict": { "last_step": "condition/0/conditions/24/conditions/0", "run_id": "a4a3fc96dc198a3303d29d78eb888775", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T07:14:16.403935+00:00", "finish": "2026-01-16T07:14:16.407924+00:00" }, "domain": "automation", "item_id": "1758055141945", "trigger": "numeric state of sun.sun", "trace": { "trigger/18": [ { "path": "trigger/18", "timestamp": "2026-01-16T07:14:16.406801+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_keuken", "state": "on", "attributes": { "id": "1758055141945", "last_triggered": "2026-01-14T07:15:42.494411+00:00", "mode": "restart", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Keuken [BP]" }, "last_changed": "2026-01-15T08:04:17.790058+00:00", "last_reported": "2026-01-15T08:04:17.790058+00:00", "last_updated": "2026-01-15T08:04:17.790058+00:00", "context": { "id": "01KF0AY4QYBE01ZPZ9TKTK0DH5", "parent_id": null, "user_id": null } }, "trigger": { "id": "t14", "idx": "18", "alias": null, "platform": "numeric_state", "entity_id": "sun.sun", "below": null, "above": -4.0, "from_state": { "entity_id": "sun.sun", "state": "below_horizon", "attributes": { "next_dawn": "2026-01-17T06:57:29.214245+00:00", "next_dusk": "2026-01-16T16:39:29.769293+00:00", "next_midnight": "2026-01-16T23:49:00+00:00", "next_noon": "2026-01-16T11:48:29+00:00", "next_rising": "2026-01-16T07:37:25.658814+00:00", "next_setting": "2026-01-16T16:00:18.850979+00:00", "elevation": -4.13, "azimuth": 118.97, "rising": true, "friendly_name": "Sun" }, "last_changed": "2026-01-15T16:00:44.092093+00:00", "last_reported": "2026-01-16T07:12:16.398043+00:00", "last_updated": "2026-01-16T07:12:16.398043+00:00", "context": { "id": "01KF2TBKGEE7ZS3H9Y74ZP7GJE", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sun.sun", "state": "below_horizon", "attributes": { "next_dawn": "2026-01-17T06:57:29.214245+00:00", "next_dusk": "2026-01-16T16:39:29.769293+00:00", "next_midnight": "2026-01-16T23:49:00+00:00", "next_noon": "2026-01-16T11:48:29+00:00", "next_rising": "2026-01-16T07:37:25.658814+00:00", "next_setting": "2026-01-16T16:00:18.850979+00:00", "elevation": -3.86, "azimuth": 119.35, "rising": true, "friendly_name": "Sun" }, "last_changed": "2026-01-15T16:00:44.092093+00:00", "last_reported": "2026-01-16T07:14:16.398986+00:00", "last_updated": "2026-01-16T07:14:16.398986+00:00", "context": { "id": "01KF2TF8PEEKP0M3X8D38537S6", "parent_id": null, "user_id": null } }, "for": null, "description": "numeric state of sun.sun" }, "motion_trigger": [ "binary_sensor.beweging_keuken_bezetting" ], "light_switch": { "entity_id": "light.lamp_keuken_main" }, "boolean_scenes_scripts": [], "end_scenes": [], "time_delay": 5, "include_light_control": [ "use_brightness" ], "light_brightness": 80, "light_transition_on": 1, "light_transition_off": 1, "include_light_colour_control": "disable_colour_control", "light_colour_temperature": 5000, "light_rgb_colour": [ 255, 255, 255 ], "light_rgbw_colour": [ 255, 255, 255, 255 ], "light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_dynamic_lighting": "enable_sun_elevation_colour_brightness", "dynamic_lighting_lux_sensor": [], "dynamic_lighting_max_lux": 400, "dynamic_lighting_min_lux": 40, "dynamic_lighting_max_brightness": 80, "dynamic_lighting_min_brightness": 42, "dynamic_lighting_boolean": [], "dynamic_lighting_max_colour_temp": 4200, "dynamic_lighting_min_colour_temp": 2500, "dynamic_lighting_sun_elevation_start_rising": -1.5, "dynamic_lighting_sun_elevation_end_rising": 15, "dynamic_lighting_sun_elevation_start_falling": 15, "dynamic_lighting_sun_elevation_end_falling": -4.0, "dynamic_lighting_time_start_morning": "06:00:00", "dynamic_lighting_time_end_morning": "09:00:00", "dynamic_lighting_time_start_evening": "17:00:00", "dynamic_lighting_time_end_evening": "19:00:00", "dynamic_lighting_heartbeat": 1, "dynamic_lighting_step_value": 4, "dynamic_lighting_dead_zone": 7, "dynamic_lighting_state_control": "disable_state_control", "dynamic_lighting_state_control_activation_state": "on", "dynamic_lighting_state_control_entity": [], "include_bypass": [], "motion_bypass_lights_on": [], "motion_bypass_lights_off": [], "motion_bypass_lights_stop": [], "bypass_time_delay": 0, "include_bypass_auto_off": [], "bypass_auto_off_delay": 60, "include_sun": "sun_enabled", "sun_elevation": -1.5, "sun_elevation_rising": -4.0, "include_ambient": "ambient_disabled", "ambient_light_sensor": [], "ambient_light_options": "ambient_light_option_disabled", "ambient_light_value": 20, "ambient_light_high_value": 80, "include_time": "time_disabled", "after_time": "18:00:00", "before_time": "09:00:00", "weekday_options": [ "mon", "tue", "wed", "thu", "fri", "sat", "sun" ], "include_state_control": "state_control_disabled", "state_control_activation_state": "off", "state_control_entity": [], "include_device_tracker": "device_tracker_disabled", "zone": [], "people": [], "include_night_lights": "night_lights_enabled", "night_lights_conditions": [ "time_enabled" ], "night_lights_entity_state": [], "night_lights_after_time": "20:30:00", "night_lights_before_time": "06:00:00", "night_lights_sun_elevation": -1.5, "night_lights_sun_elevation_rising": -4.0, "night_lights": { "entity_id": "light.lamp_keuken_kleur" }, "night_boolean_scenes_scripts": [], "night_time_delay": 5, "include_night_light_control": [ "use_brightness", "use_transition" ], "night_light_brightness": 100, "night_light_transition_on": 0, "night_light_transition_off": 10, "include_night_light_colour_control": "use_colour_temperature", "night_light_colour_temperature": 2700, "night_light_rgb_colour": [ 255, 255, 255 ], "night_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_night_glow": "night_glow_disabled", "night_glow_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_glow_light_control": [ "use_brightness" ], "night_glow_light_brightness": 20, "night_glow_light_transition_on": 1, "night_glow_light_transition_off": 1, "include_night_glow_light_colour_control": "use_colour_temperature", "night_glow_light_colour_temperature": 2000, "night_glow_light_rgb_colour": [ 255, 255, 255 ], "night_glow_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_glow_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "light_entities_off": [ "light.lamp_keuken_main" ], "switch_entities_off": [], "light_data": { "brightness_pct": 80 }, "light_entities": [ "light.lamp_keuken_main" ], "switch_entities": [], "scene_entities": [], "script_entities": [], "boolean_scenes_scripts_helper": [], "end_scene_entities": [], "end_script_entities": [], "night_light_entities_off": [ "light.lamp_keuken_kleur" ], "night_switch_entities_off": [], "night_light_data": { "transition": 0, "brightness_pct": 100, "color_temp_kelvin": 2700 }, "night_light_entities": [ "light.lamp_keuken_kleur" ], "night_switch_entities": [], "night_scene_entities": [], "night_script_entities": [], "night_boolean_scenes_scripts_helper": [], "night_glow_light_data": { "brightness_pct": 20, "color_temp_kelvin": 2000 }, "night_glow_light_entities": [ "light.lamp_keuken_kleur" ], "night_glow_switch_entities": [], "night_glow_scene_entities": [], "night_glow_script_entities": [], "crossover_night_glow_to_night_lights_light": [], "crossover_night_glow_to_night_lights_switch": [], "crossover_night_lights_to_night_glow_light": [], "crossover_night_lights_to_night_glow_switch": [], "crossover_lights_to_night_glow_light": [ "light.lamp_keuken_main" ], "crossover_lights_to_night_glow_switch": [], "crossover_lights_light": [], "crossover_lights_switch": [], "crossover_night_lights_light_on": [], "crossover_night_lights_light": [], "crossover_night_lights_switch": [], "crossover_lights_light_on": [], "dynamic_lighting_state_control_activation_state_inv": "off" } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-16T07:14:16.406824+00:00", "result": { "result": false } } ], "condition/0/conditions/0": [ { "path": "condition/0/conditions/0", "timestamp": "2026-01-16T07:14:16.406846+00:00", "result": { "result": false } } ], "condition/0/conditions/0/conditions/0": [ { "path": "condition/0/conditions/0/conditions/0", "timestamp": "2026-01-16T07:14:16.406864+00:00", "result": { "result": false } } ], "condition/0/conditions/1": [ { "path": "condition/0/conditions/1", "timestamp": "2026-01-16T07:14:16.406889+00:00", "result": { "result": false } } ], "condition/0/conditions/1/conditions/0": [ { "path": "condition/0/conditions/1/conditions/0", "timestamp": "2026-01-16T07:14:16.406905+00:00", "result": { "result": false } } ], "condition/0/conditions/2": [ { "path": "condition/0/conditions/2", "timestamp": "2026-01-16T07:14:16.406926+00:00", "result": { "result": false } } ], "condition/0/conditions/2/conditions/0": [ { "path": "condition/0/conditions/2/conditions/0", "timestamp": "2026-01-16T07:14:16.406941+00:00", "result": { "result": false } } ], "condition/0/conditions/3": [ { "path": "condition/0/conditions/3", "timestamp": "2026-01-16T07:14:16.406960+00:00", "result": { "result": false } } ], "condition/0/conditions/3/conditions/0": [ { "path": "condition/0/conditions/3/conditions/0", "timestamp": "2026-01-16T07:14:16.406975+00:00", "result": { "result": false } } ], "condition/0/conditions/4": [ { "path": "condition/0/conditions/4", "timestamp": "2026-01-16T07:14:16.406994+00:00", "result": { "result": false } } ], "condition/0/conditions/4/conditions/0": [ { "path": "condition/0/conditions/4/conditions/0", "timestamp": "2026-01-16T07:14:16.407009+00:00", "result": { "result": false } } ], "condition/0/conditions/5": [ { "path": "condition/0/conditions/5", "timestamp": "2026-01-16T07:14:16.407029+00:00", "result": { "result": false } } ], "condition/0/conditions/5/conditions/0": [ { "path": "condition/0/conditions/5/conditions/0", "timestamp": "2026-01-16T07:14:16.407044+00:00", "result": { "result": false } } ], "condition/0/conditions/6": [ { "path": "condition/0/conditions/6", "timestamp": "2026-01-16T07:14:16.407063+00:00", "result": { "result": false } } ], "condition/0/conditions/6/conditions/0": [ { "path": "condition/0/conditions/6/conditions/0", "timestamp": "2026-01-16T07:14:16.407078+00:00", "result": { "result": false } } ], "condition/0/conditions/7": [ { "path": "condition/0/conditions/7", "timestamp": "2026-01-16T07:14:16.407097+00:00", "result": { "result": false } } ], "condition/0/conditions/7/conditions/0": [ { "path": "condition/0/conditions/7/conditions/0", "timestamp": "2026-01-16T07:14:16.407111+00:00", "result": { "result": false } } ], "condition/0/conditions/8": [ { "path": "condition/0/conditions/8", "timestamp": "2026-01-16T07:14:16.407139+00:00", "result": { "result": false } } ], "condition/0/conditions/8/conditions/0": [ { "path": "condition/0/conditions/8/conditions/0", "timestamp": "2026-01-16T07:14:16.407154+00:00", "result": { "result": false } } ], "condition/0/conditions/9": [ { "path": "condition/0/conditions/9", "timestamp": "2026-01-16T07:14:16.407184+00:00", "result": { "result": false } } ], "condition/0/conditions/9/conditions/0": [ { "path": "condition/0/conditions/9/conditions/0", "timestamp": "2026-01-16T07:14:16.407199+00:00", "result": { "result": false } } ], "condition/0/conditions/10": [ { "path": "condition/0/conditions/10", "timestamp": "2026-01-16T07:14:16.407218+00:00", "result": { "result": false } } ], "condition/0/conditions/10/conditions/0": [ { "path": "condition/0/conditions/10/conditions/0", "timestamp": "2026-01-16T07:14:16.407233+00:00", "result": { "result": false } } ], "condition/0/conditions/11": [ { "path": "condition/0/conditions/11", "timestamp": "2026-01-16T07:14:16.407252+00:00", "result": { "result": false } } ], "condition/0/conditions/11/conditions/0": [ { "path": "condition/0/conditions/11/conditions/0", "timestamp": "2026-01-16T07:14:16.407267+00:00", "result": { "result": false } } ], "condition/0/conditions/12": [ { "path": "condition/0/conditions/12", "timestamp": "2026-01-16T07:14:16.407286+00:00", "result": { "result": false } } ], "condition/0/conditions/12/conditions/0": [ { "path": "condition/0/conditions/12/conditions/0", "timestamp": "2026-01-16T07:14:16.407301+00:00", "result": { "result": false } } ], "condition/0/conditions/13": [ { "path": "condition/0/conditions/13", "timestamp": "2026-01-16T07:14:16.407320+00:00", "result": { "result": false } } ], "condition/0/conditions/13/conditions/0": [ { "path": "condition/0/conditions/13/conditions/0", "timestamp": "2026-01-16T07:14:16.407334+00:00", "result": { "result": false } } ], "condition/0/conditions/14": [ { "path": "condition/0/conditions/14", "timestamp": "2026-01-16T07:14:16.407353+00:00", "result": { "result": false } } ], "condition/0/conditions/14/conditions/0": [ { "path": "condition/0/conditions/14/conditions/0", "timestamp": "2026-01-16T07:14:16.407368+00:00", "result": { "result": false } } ], "condition/0/conditions/15": [ { "path": "condition/0/conditions/15", "timestamp": "2026-01-16T07:14:16.407387+00:00", "result": { "result": false } } ], "condition/0/conditions/15/conditions/0": [ { "path": "condition/0/conditions/15/conditions/0", "timestamp": "2026-01-16T07:14:16.407401+00:00", "result": { "result": false } } ], "condition/0/conditions/16": [ { "path": "condition/0/conditions/16", "timestamp": "2026-01-16T07:14:16.407421+00:00", "result": { "result": false } } ], "condition/0/conditions/16/conditions/0": [ { "path": "condition/0/conditions/16/conditions/0", "timestamp": "2026-01-16T07:14:16.407435+00:00", "result": { "result": false } } ], "condition/0/conditions/17": [ { "path": "condition/0/conditions/17", "timestamp": "2026-01-16T07:14:16.407455+00:00", "result": { "result": false } } ], "condition/0/conditions/17/conditions/0": [ { "path": "condition/0/conditions/17/conditions/0", "timestamp": "2026-01-16T07:14:16.407470+00:00", "result": { "result": false } } ], "condition/0/conditions/18": [ { "path": "condition/0/conditions/18", "timestamp": "2026-01-16T07:14:16.407490+00:00", "result": { "result": false } } ], "condition/0/conditions/18/conditions/0": [ { "path": "condition/0/conditions/18/conditions/0", "timestamp": "2026-01-16T07:14:16.407504+00:00", "result": { "result": true } } ], "condition/0/conditions/18/conditions/1": [ { "path": "condition/0/conditions/18/conditions/1", "timestamp": "2026-01-16T07:14:16.407523+00:00", "result": { "result": true, "entities": [] } } ], "condition/0/conditions/18/conditions/2": [ { "path": "condition/0/conditions/18/conditions/2", "timestamp": "2026-01-16T07:14:16.407617+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/19": [ { "path": "condition/0/conditions/19", "timestamp": "2026-01-16T07:14:16.407701+00:00", "result": { "result": false } } ], "condition/0/conditions/19/conditions/0": [ { "path": "condition/0/conditions/19/conditions/0", "timestamp": "2026-01-16T07:14:16.407720+00:00", "result": { "result": false } } ], "condition/0/conditions/20": [ { "path": "condition/0/conditions/20", "timestamp": "2026-01-16T07:14:16.407741+00:00", "result": { "result": false } } ], "condition/0/conditions/20/conditions/0": [ { "path": "condition/0/conditions/20/conditions/0", "timestamp": "2026-01-16T07:14:16.407756+00:00", "result": { "result": false } } ], "condition/0/conditions/21": [ { "path": "condition/0/conditions/21", "timestamp": "2026-01-16T07:14:16.407777+00:00", "result": { "result": false } } ], "condition/0/conditions/21/conditions/0": [ { "path": "condition/0/conditions/21/conditions/0", "timestamp": "2026-01-16T07:14:16.407792+00:00", "result": { "result": false } } ], "condition/0/conditions/22": [ { "path": "condition/0/conditions/22", "timestamp": "2026-01-16T07:14:16.407813+00:00", "result": { "result": false } } ], "condition/0/conditions/22/conditions/0": [ { "path": "condition/0/conditions/22/conditions/0", "timestamp": "2026-01-16T07:14:16.407828+00:00", "result": { "result": false } } ], "condition/0/conditions/23": [ { "path": "condition/0/conditions/23", "timestamp": "2026-01-16T07:14:16.407850+00:00", "result": { "result": false } } ], "condition/0/conditions/23/conditions/0": [ { "path": "condition/0/conditions/23/conditions/0", "timestamp": "2026-01-16T07:14:16.407865+00:00", "result": { "result": false } } ], "condition/0/conditions/24": [ { "path": "condition/0/conditions/24", "timestamp": "2026-01-16T07:14:16.407885+00:00", "result": { "result": false } } ], "condition/0/conditions/24/conditions/0": [ { "path": "condition/0/conditions/24/conditions/0", "timestamp": "2026-01-16T07:14:16.407900+00:00", "result": { "result": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "motion_trigger": [ "binary_sensor.beweging_keuken_bezetting" ], "light_switch": { "entity_id": "light.lamp_keuken_main" }, "boolean_scenes_scripts": [], "end_scenes": [], "time_delay": 5, "include_light_control": [ "use_brightness" ], "light_brightness": 80, "light_transition_on": 1, "light_transition_off": 1, "include_light_colour_control": "disable_colour_control", "light_colour_temperature": 5000, "light_rgb_colour": [ 255, 255, 255 ], "light_rgbw_colour": [ 255, 255, 255, 255 ], "light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_dynamic_lighting": "enable_sun_elevation_colour_brightness", "dynamic_lighting_lux_sensor": [], "dynamic_lighting_max_lux": 400, "dynamic_lighting_min_lux": 40, "dynamic_lighting_max_brightness": 80, "dynamic_lighting_min_brightness": 42, "dynamic_lighting_boolean": [], "dynamic_lighting_max_colour_temp": 4200, "dynamic_lighting_min_colour_temp": 2500, "dynamic_lighting_sun_elevation_start_rising": -1.5, "dynamic_lighting_sun_elevation_end_rising": 15, "dynamic_lighting_sun_elevation_start_falling": 15, "dynamic_lighting_sun_elevation_end_falling": -4.0, "dynamic_lighting_time_start_morning": "06:00:00", "dynamic_lighting_time_end_morning": "09:00:00", "dynamic_lighting_time_start_evening": "17:00:00", "dynamic_lighting_time_end_evening": "19:00:00", "dynamic_lighting_heartbeat": 1, "dynamic_lighting_step_value": 4, "dynamic_lighting_dead_zone": 7, "dynamic_lighting_state_control": "disable_state_control", "dynamic_lighting_state_control_activation_state": "on", "dynamic_lighting_state_control_entity": [], "include_bypass": [], "motion_bypass_lights_on": [], "motion_bypass_lights_off": [], "motion_bypass_lights_stop": [], "bypass_time_delay": 0, "include_bypass_auto_off": [], "bypass_auto_off_delay": 60, "include_sun": "sun_enabled", "sun_elevation": -1.5, "sun_elevation_rising": -4.0, "include_ambient": "ambient_disabled", "ambient_light_sensor": [], "ambient_light_options": "ambient_light_option_disabled", "ambient_light_value": 20, "ambient_light_high_value": 80, "include_time": "time_disabled", "after_time": "18:00:00", "before_time": "09:00:00", "weekday_options": [ "mon", "tue", "wed", "thu", "fri", "sat", "sun" ], "include_state_control": "state_control_disabled", "state_control_activation_state": "off", "state_control_entity": [], "include_device_tracker": "device_tracker_disabled", "zone": [], "people": [], "include_night_lights": "night_lights_enabled", "night_lights_conditions": [ "time_enabled" ], "night_lights_entity_state": [], "night_lights_after_time": "20:30:00", "night_lights_before_time": "06:00:00", "night_lights_sun_elevation": -1.5, "night_lights_sun_elevation_rising": -4.0, "night_lights": { "entity_id": "light.lamp_keuken_kleur" }, "night_boolean_scenes_scripts": [], "night_time_delay": 5, "include_night_light_control": [ "use_brightness", "use_transition" ], "night_light_brightness": 100, "night_light_transition_on": 0, "night_light_transition_off": 10, "include_night_light_colour_control": "use_colour_temperature", "night_light_colour_temperature": 2700, "night_light_rgb_colour": [ 255, 255, 255 ], "night_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_night_glow": "night_glow_disabled", "night_glow_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_glow_light_control": [ "use_brightness" ], "night_glow_light_brightness": 20, "night_glow_light_transition_on": 1, "night_glow_light_transition_off": 1, "include_night_glow_light_colour_control": "use_colour_temperature", "night_glow_light_colour_temperature": 2000, "night_glow_light_rgb_colour": [ 255, 255, 255 ], "night_glow_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_glow_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "light_entities_off": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'light')\n | selectattr('state', 'eq', 'off')\n | map(attribute='entity_id')\n | list }}\n", "switch_entities_off": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'switch')\n | selectattr('state', 'eq', 'off')\n | map(attribute='entity_id')| list }}\n", "light_data": "{% set light = namespace(data={}) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': light_brightness }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}", "light_entities": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'light')\n | map(attribute='entity_id')\n | list }}\n", "switch_entities": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'switch')\n | map(attribute='entity_id')\n | list }}\n", "scene_entities": "{% set a = light_switch.entity_id %} {% if boolean_scenes_scripts == [] %}\n {{ expand(a) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% elif is_state(boolean_scenes_scripts, 'off') %}\n {{ expand(a) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "script_entities": "{% set a = light_switch.entity_id %} {% if boolean_scenes_scripts == [] %}\n {{ expand(a) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% elif is_state(boolean_scenes_scripts, 'off') %}\n {{ expand(a) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "boolean_scenes_scripts_helper": "{% if boolean_scenes_scripts | length > 0 and states(boolean_scenes_scripts) == 'off' %}\n {{ boolean_scenes_scripts }}\n{% else %}\n []\n{% endif %}", "end_scene_entities": "{{ end_scenes | select('match', '^scene\\..*') | list }}", "end_script_entities": "{{ end_scenes | select('match', '^script\\..*') | list }}", "night_light_entities_off": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'off') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_switch_entities_off": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'switch') | selectattr('state', 'eq', 'off') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_light_data": "{% set light = namespace(data={}) %} {% if 'use_transition' in include_night_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': night_light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_night_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': night_light_brightness }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': night_light_colour_temperature }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': night_light_rgb_colour }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': night_light_rgbw_colour }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': night_light_rgbww_colour }) %}\n{% endif %} {{ light.data }}", "night_light_entities": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_switch_entities": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_scene_entities": "{% set b = night_lights and night_lights.entity_id %} {% if night_boolean_scenes_scripts == [] %}\n {{ expand(b) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% elif is_state(night_boolean_scenes_scripts, 'off') %}\n {{ expand(b) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_script_entities": "{% set b = night_lights and night_lights.entity_id %} {% if night_boolean_scenes_scripts == [] %}\n {{ expand(b) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% elif is_state(night_boolean_scenes_scripts, 'off') %}\n {{ expand(b) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_boolean_scenes_scripts_helper": "{% if night_boolean_scenes_scripts | length > 0 and states(night_boolean_scenes_scripts) == 'off' %}\n {{ night_boolean_scenes_scripts }}\n{% else %}\n []\n{% endif %}", "night_glow_light_data": "{% set light = namespace(data={}) %} {% if 'use_transition' in include_night_glow_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': night_glow_light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_night_glow_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': night_glow_light_brightness }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': night_glow_light_colour_temperature }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': night_glow_light_rgb_colour }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': night_glow_light_rgbw_colour }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': night_glow_light_rgbww_colour }) %}\n{% endif %} {{ light.data }}", "night_glow_light_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_glow_switch_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_glow_scene_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_glow_script_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_glow_to_night_lights_light": "{% set a = night_lights and night_lights.entity_id %} {% set b = night_glow_lights and night_glow_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_glow_to_night_lights_switch": "{% set a = night_lights and night_lights.entity_id %} {% set b = night_glow_lights and night_glow_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_to_night_glow_light": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_to_night_glow_switch": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_to_night_glow_light": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = light_switch.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_to_night_glow_switch": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = light_switch.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_light": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(a) | reject('in', expand(b)) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_switch": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(a) | reject('in', expand(b)) | selectattr('domain', 'eq', 'switch') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_light_on": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_light": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_switch": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_light_on": "{% set a = light_switch.entity_id %} {% if a %}\n {{ expand(a) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "dynamic_lighting_state_control_activation_state_inv": "{% if dynamic_lighting_state_control_activation_state == 'on' %}\n off\n{% else %}\n on\n{% endif %}\n" }, "triggers": [ { "trigger": "state", "id": "t0", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "from": "off", "to": "on" }, { "trigger": "numeric_state", "id": "t1", "entity_id": "sun.sun", "attribute": "elevation", "below": -1.5 }, { "trigger": "numeric_state", "id": "t2", "entity_id": [], "below": 20 }, { "trigger": "time", "id": "t3", "at": "18:00:00" }, { "trigger": "state", "id": "t4", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "time", "id": "t5", "at": "20:30:00" }, { "trigger": "numeric_state", "id": "t6", "entity_id": "sun.sun", "attribute": "elevation", "below": -1.5 }, { "trigger": "state", "id": "t7_on", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t7_off", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t7_stop", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t8_on", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "state", "id": "t8_off", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "state", "id": "t8_stop", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "numeric_state", "id": "t9", "entity_id": "sun.sun", "attribute": "elevation", "above": -4.0 }, { "trigger": "numeric_state", "id": "t10", "entity_id": [], "above": 80 }, { "trigger": "time", "id": "t11", "at": "09:00:00" }, { "trigger": "state", "id": "t12", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "time", "id": "t13", "at": "06:00:00" }, { "trigger": "numeric_state", "id": "t14", "entity_id": "sun.sun", "attribute": "elevation", "above": -4.0 }, { "trigger": "state", "id": "t15", "entity_id": [], "to": "on" }, { "trigger": "state", "id": "t16", "entity_id": [], "from": "on" }, { "trigger": "state", "id": "t17", "entity_id": [], "to": "off" }, { "trigger": "state", "id": "t18", "entity_id": [], "from": "off" }, { "trigger": "homeassistant", "id": "t19", "event": "start" } ], "actions": [ { "choose": [ { "alias": "Check if night lights are enabled and within conditions", "conditions": [ { "condition": "and", "conditions": [ { "alias": "Check if night lights is enabled", "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_enabled' }}" }, { "alias": "Check if night lights entity state is enabled", "condition": "or", "conditions": [ "{{ ('time_enabled' in night_lights_conditions) and not ('entity_state_enabled' in night_lights_conditions) }}", "{{ ('sun_enabled' in night_lights_conditions) and not ('entity_state_enabled' in night_lights_conditions) }}", { "condition": "and", "conditions": [ "{{ 'entity_state_enabled' in night_lights_conditions }}", { "condition": "state", "entity_id": [], "state": "on", "match": "any" } ] } ] }, { "alias": "Check if night lights time is enabled", "condition": "or", "conditions": [ "{{ ('entity_state_enabled' in night_lights_conditions) and not ('time_enabled' in night_lights_conditions) }}", "{{ ('sun_enabled' in night_lights_conditions) and not ('time_enabled' in night_lights_conditions) }}", { "condition": "and", "conditions": [ "{{ 'time_enabled' in night_lights_conditions }}", { "condition": "time", "after": "20:30:00", "before": "06:00:00" } ] } ] }, { "alias": "Check if night lights sun is enabled", "condition": "or", "conditions": [ "{{ ('entity_state_enabled' in night_lights_conditions) and not ('sun_enabled' in night_lights_conditions) }}", "{{ ('time_enabled' in night_lights_conditions) and not ('sun_enabled' in night_lights_conditions) }}", "{{ ('sun_enabled' in night_lights_conditions) and (((is_state_attr('sun.sun', 'rising', false)) and (state_attr('sun.sun','elevation') <= night_lights_sun_elevation | float(90))) or ((is_state_attr('sun.sun', 'rising', true)) and (state_attr('sun.sun','elevation') <= night_lights_sun_elevation_rising | float(90)))) }}" ] } ] } ], "sequence": [ { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "By-pass is turned on & check by-pass option - Turn lights off", "conditions": [ { "condition": "trigger", "id": "t7_off" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] }, { "alias": "By-pass is turned on & check by-pass option - Keep the current lights state", "conditions": [ { "condition": "trigger", "id": "t7_stop" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & check if the motion trigger is off", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "all", "state": "off" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If night glow is disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] }, { "alias": "If night glow is enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn on the lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": "{{ night_glow_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn OFF crossover lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_to_night_glow_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" } }, { "alias": "Turn OFF crossover lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_to_night_glow_light }}" } } ] } ] }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_on }}" } }, { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}", "transition": "{{ night_glow_light_transition_on }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } }, { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn OFF crossover night switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_switch }}" } }, { "alias": "Turn OFF crossover light switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_to_night_glow_switch }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ night_glow_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Motion trigger is off and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "By-pass is turned off & check if the motion trigger is on", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] }, { "condition": "or", "conditions": [ "{{ (include_sun == 'sun_enabled') and (state_attr('sun.sun','elevation') >= sun_elevation | float(90)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_disabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (is_state(night_boolean_scenes_scripts, 'off')) }}", { "condition": "and", "conditions": [ "{{ include_time == 'time_enabled' }}", { "condition": "time", "after": "09:00:00", "before": "18:00:00" } ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "template", "value_template": "{% set opposite = 'off' if state_control_activation_state == 'on' else 'on' %} {{ is_state(state_control_entity, opposite) }}" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] }, { "alias": "Motion trigger is on and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned off & reset lights to the site conditions", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "choose": [ { "alias": "Check if normal lights Scenes & Scripts - Toggle Helper is on", "conditions": [ { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean normal lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ crossover_night_lights_light_on }}" }, "data": "{{ night_light_data }}" } ] } ] } ] } ] }, { "choose": [ { "alias": "Sun, ambient, time & state control above setting to turn off", "conditions": [ { "condition": "trigger", "id": [ "t9", "t10", "t11", "t18" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] }, { "alias": "Turn off normal lights when trigger by start night lights conditions", "conditions": [ { "condition": "trigger", "id": [ "t4", "t5", "t6" ] } ], "sequence": [ { "choose": [ { "alias": "light - switch - scene - script is ON", "conditions": [ { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "choose": [ { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the input boolean normal lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ crossover_night_lights_light_on }}" }, "data": "{{ night_light_data }}" } ] } ] } ] }, { "alias": "Turn on night glow lights if all lights are off", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" }, { "condition": "template", "value_template": "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (is_state(boolean_scenes_scripts, 'off')) }}\n" } ], "sequence": [ { "alias": "Turn on the lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": "{{ night_glow_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}", "transition": "{{ night_glow_light_transition_on }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ night_glow_script_entities }}" } }, { "stop": "Stop the automation" } ] }, { "alias": "If manage scripts is enabled", "conditions": [ "{{ 'manage_scripts_crossing_over' in include_night_light_control }}", "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (is_state(boolean_scenes_scripts, 'off')) }}" ], "sequence": [ { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Safe Guard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t19" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Small time delay required", "delay": { "seconds": 1 } } ] }, { "alias": "Check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass auto off is enabled and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "choose": [ { "alias": "If night glow is disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_disabled' }}" } ], "sequence": [ { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_light_entities_off }}" }, "data": "{{ night_light_data }}" }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ { "condition": "template", "value_template": "{% if boolean_scenes_scripts == [] %}\n false\n{% elif is_state(boolean_scenes_scripts, 'on') %}\n true\n{% else %}\n false\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": "{{ boolean_scenes_scripts }}" } }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ "{{ night_boolean_scenes_scripts != [] }}" ], "sequence": [ { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" }, "data": { "transition": "{{ night_light_transition_on }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] }, { "alias": "Turn on the night switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_switch_entities_off }}" } }, { "alias": "Turn on the night scripts", "action": "script.turn_on", "target": { "entity_id": "{{ night_script_entities }}" } } ] }, { "alias": "If night glow is enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" }, { "condition": "not", "conditions": [ { "condition": "trigger", "id": [ "t15", "t16" ] } ] } ], "sequence": [ { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_light_entities }}" }, "data": "{{ night_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night glow lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night glow lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ { "condition": "template", "value_template": "{% if boolean_scenes_scripts == [] %}\n false\n{% elif is_state(boolean_scenes_scripts, 'on') %}\n true\n{% else %}\n false\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": "{{ boolean_scenes_scripts }}" } }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ "{{ night_boolean_scenes_scripts != [] }}" ], "sequence": [ { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" }, "data": { "transition": "{{ night_light_transition_on }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] }, { "alias": "Turn on the night switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off crossover night glow switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } }, { "alias": "Turn on the night scripts", "action": "script.turn_on", "target": { "entity_id": "{{ night_script_entities }}" } } ] } ] }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - Turn lights on", "conditions": [ { "condition": "trigger", "id": "t7_on" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Check if the trigger is on and wait for it to go off", "conditions": [ { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" } ], "sequence": [ { "alias": "Wait until motion sensor is off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Wait the number of minutes set in the night lights time delay", "delay": { "minutes": 5 } }, { "choose": [ { "alias": "If night glow is disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] }, { "alias": "If night glow is enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn on the lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": "{{ night_glow_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" } } ] } ] }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}", "transition": "{{ night_glow_light_transition_on }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn OFF crossover night switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_switch }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ night_glow_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ], "default": [ { "choose": [ { "alias": "By-pass is turned on & check by-pass option - Turn lights off", "conditions": [ { "condition": "trigger", "id": "t7_off" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If night lights are disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] }, { "alias": "If night lights are enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] } ] }, { "alias": "By-pass is turned on & check by-pass option - Keep the current lights state", "conditions": [ { "condition": "trigger", "id": "t7_stop" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & check if the motion trigger is off", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "all", "state": "off" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If night lights are disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "If night lights are enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Motion trigger is off and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "By-pass is turned off & check if the motion trigger is on", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] }, { "condition": "or", "conditions": [ "{{ (include_sun == 'sun_enabled') and (state_attr('sun.sun','elevation') >= sun_elevation | float(90)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_disabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (is_state(boolean_scenes_scripts, 'off')) }}", { "condition": "and", "conditions": [ { "condition": "time", "after": "09:00:00", "before": "18:00:00" }, "{{ include_time == 'time_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "template", "value_template": "{% set opposite = 'off' if state_control_activation_state == 'on' else 'on' %} {{ is_state(state_control_entity, opposite) }}" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Motion trigger is on and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned off & reset lights to the site conditions", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] } ] } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "choose": [ { "alias": "Check if night lights scenes & scripts - toggle helper is on", "conditions": [ { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "Turn ON lights", "conditions": [ { "alias": "Check the dynamic lighting options", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'disable_dynamic_lighting' }}" }, { "alias": "Check that dynamic lighting is active and the state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "template", "value_template": "{{ states(dynamic_lighting_state_control_entity) == dynamic_lighting_state_control_activation_state_inv }}" } ] } ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ crossover_lights_light_on }}" }, "data": "{{ light_data }}" }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ] } ] } ] } ] } ] }, { "choose": [ { "alias": "Sun, ambient, time & state control above setting to turn off", "conditions": [ { "condition": "trigger", "id": [ "t9", "t10", "t11", "t18" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Turn off night lights when trigger by end night lights conditions", "conditions": [ { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "choose": [ { "alias": "If the night glow is enabled", "conditions": [ "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "off", "for": { "minutes": 5 } } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": { "transition": "{{ night_glow_light_transition_off}}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_glow_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_glow_light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "stop": "Stop the automation" } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or (is_state(night_boolean_scenes_scripts, 'on')) }}\n" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "choose": [ { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Turn ON lights", "conditions": [ { "alias": "Check the dynamic lighting options", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'disable_dynamic_lighting' }}" }, { "alias": "Check that dynamic lighting is active and the state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "template", "value_template": "{{ states(dynamic_lighting_state_control_entity) == dynamic_lighting_state_control_activation_state_inv }}" } ] } ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ crossover_lights_light_on }}" }, "data": "{{ light_data }}" } ] } ] } ] } ] } ] }, { "alias": "If manage scripts is enabled", "conditions": [ "{{ 'manage_scripts_crossing_over' in include_night_light_control }}", "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (is_state(night_boolean_scenes_scripts, 'off')) }}" ], "sequence": [ { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Safe Guard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t19" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Small time delay required", "delay": { "seconds": 1 } } ] }, { "alias": "Check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass auto off is enabled and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "alias": "Parallel actions for dynamic lighting and normal lights", "parallel": [ { "sequence": [ { "alias": "Check if the dynamic lighting is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "alias": "Check the dynamic lighting state control option", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'disable_state_control' }}" }, { "alias": "Check if the dynamic lighting state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "state", "entity_id": [], "state": "on" } ] } ] } ] }, { "choose": [ { "alias": "Dynamic Lighting - Input Boolean Helper", "conditions": [ { "condition": "template", "value_template": "{{ dynamic_lighting_boolean != [] }}" } ], "sequence": [ { "alias": "Turn on the boolean for dynamic lighting", "action": "input_boolean.turn_on", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "1 - Dynamic Lighting - Lux Controlled Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness'}}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n false\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "2 - Dynamic Lighting - Lux Controlled Brightness - Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness_inv'}}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting brightness inverted for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "3 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': light_brightness }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if elevation >= (dynamic_lighting_sun_elevation_start_rising - 2) and elevation <= (dynamic_lighting_sun_elevation_end_rising + 2) and is_state_attr('sun.sun', 'rising', true) %}\n false\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_falling + 2) and elevation >= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n false\n {% elif elevation >= (dynamic_lighting_sun_elevation_end_rising + 2) and elevation >= (dynamic_lighting_sun_elevation_start_falling - 2) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_rising - 2) and is_state_attr('sun.sun', 'rising', true) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n true\n {% else %}\n true\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If sun elevation is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "4 - Dynamic Lighting - Sun Elevation Lighting - Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "5 - Dynamic Lighting - Sun Elevation Lighting - Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness_inv' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness inverted for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "6 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "7 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness_inv' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "8 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Lux Controlled Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" } ], "sequence": [ { "alias": "Parallel actions for dynamic lighting", "parallel": [ { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_kelvin": "{% if expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 %}\n {% set elevation = state_attr('sun.sun', 'elevation') | float %}\n {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %}\n {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %}\n {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %}\n {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %}\n {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% endif %}\n {{ colour_temp_value | round(0) }}\n{% endif %}\n", "dynamic_light_off_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n false\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Check if the light is off", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Delay for parallel actions needed for when the light is off", "delay": { "milliseconds": 100 } } ] } ] }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" }, "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}" ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_off_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] }, { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if elevation >= (dynamic_lighting_sun_elevation_start_rising - 2) and elevation <= (dynamic_lighting_sun_elevation_end_rising + 2) and is_state_attr('sun.sun', 'rising', true) %}\n false\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_falling + 2) and elevation >= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n false\n {% elif elevation >= (dynamic_lighting_sun_elevation_end_rising + 2) and elevation >= (dynamic_lighting_sun_elevation_start_falling - 2) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_rising - 2) and is_state_attr('sun.sun', 'rising', true) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n true\n {% else %}\n true\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If sun elevation is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If the lights are OFF", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] } ] } ] }, { "choose": [ { "alias": "9 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Lux Controlled Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" } ], "sequence": [ { "alias": "Parallel actions for dynamic lighting", "parallel": [ { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_kelvin": "{% if expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 %}\n {% set elevation = state_attr('sun.sun', 'elevation') | float %}\n {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %}\n {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %}\n {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %}\n {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %}\n {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% endif %}\n {{ colour_temp_value | round(0) }}\n{% endif %}\n", "dynamic_light_off_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Check if the light is off", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Delay for parallel actions needed for when the light is off", "delay": { "milliseconds": 100 } } ] } ] }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" }, "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}" ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_off_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] }, { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if elevation >= (dynamic_lighting_sun_elevation_start_rising - 2) and elevation <= (dynamic_lighting_sun_elevation_end_rising + 2) and is_state_attr('sun.sun', 'rising', true) %}\n false\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_falling + 2) and elevation >= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n false\n {% elif elevation >= (dynamic_lighting_sun_elevation_end_rising + 2) and elevation >= (dynamic_lighting_sun_elevation_start_falling - 2) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_rising - 2) and is_state_attr('sun.sun', 'rising', true) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n true\n {% else %}\n true\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If sun elevation is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If the lights are OFF", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] } ] } ] }, { "choose": [ { "alias": "10 - Dynamic Lighting - Time Controlled - Colour Temp", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_colour_temp %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set colour_temp_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set colour_temp_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% elif current_time < start_time_morning %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% elif current_time > end_time_evening %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': light_brightness }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "11 - Dynamic Lighting - Time Controlled - Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_brightness %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set brightness_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set brightness_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% elif current_time < start_time_morning %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% elif current_time > end_time_evening %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "12 - Dynamic Lighting - Time Controlled - Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness_inv' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_max_brightness %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set brightness_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set brightness_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% elif current_time < start_time_morning %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% elif current_time > end_time_evening %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "13 - Dynamic Lighting - Time Controlled - Colour Temp & Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_brightness %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set brightness_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set brightness_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% elif current_time < start_time_morning %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% elif current_time > end_time_evening %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_kelvin": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_colour_temp %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set colour_temp_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set colour_temp_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% elif current_time < start_time_morning %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% elif current_time > end_time_evening %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "sequence": [ { "choose": [ { "alias": "Turn ON lights", "conditions": [ { "alias": "Check the dynamic lighting options", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'disable_dynamic_lighting' }}" }, { "alias": "Check that dynamic lighting is active and the state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "template", "value_template": "{{ states(dynamic_lighting_state_control_entity) == dynamic_lighting_state_control_activation_state_inv }}" } ] } ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities_off }}" }, "data": "{{ light_data }}" } ] } ] }, { "choose": [ { "alias": "Dynamic Lighting State Control Turning OFF", "conditions": [ { "condition": "trigger", "id": "t16" }, { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ light_data }}" }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts == [] %}\n false\n{% elif is_state(night_boolean_scenes_scripts, 'on') %}\n true\n{% else %}\n false\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": "{{ night_boolean_scenes_scripts }}" } }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ "{{ boolean_scenes_scripts != [] }}" ], "sequence": [ { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ boolean_scenes_scripts_helper }}" } } ] } ] } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ scene_entities }}" }, "data": { "transition": "{{ light_transition_on }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ boolean_scenes_scripts_helper }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ scene_entities }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ boolean_scenes_scripts_helper }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ switch_entities_off }}" } }, { "alias": "Turn on the scripts", "action": "script.turn_on", "target": { "entity_id": "{{ script_entities }}" } }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - Turn lights on", "conditions": [ { "condition": "trigger", "id": "t7_on" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Check if the trigger is on and wait for it to go off", "conditions": [ { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" } ], "sequence": [ { "alias": "Wait until motion sensor is off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Wait the number of minutes set in the normal lights time delay", "delay": { "minutes": 5 } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ], "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t0" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t1" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, "{{ include_sun == 'sun_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t2" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, "{{ include_ambient == 'ambient_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t3" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, "{{ include_time == 'time_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t4" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'entity_state_enabled' in night_lights_conditions }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t5" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'time_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t6" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'sun_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t7_on" }, "{{ 'bypass_enabled_turn_on' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t7_off" }, "{{ 'bypass_enabled_turn_off' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t7_stop" }, "{{ 'bypass_enabled_stop' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t8_on" }, "{{ 'bypass_enabled_turn_on' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t8_off" }, "{{ 'bypass_enabled_turn_off' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t8_stop" }, "{{ 'bypass_enabled_stop' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t9" }, "{{ include_sun == 'sun_enabled' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t10" }, "{{ include_ambient == 'ambient_enabled' }}", "{{ ambient_light_options == 'ambient_light_option_disabled' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t11" }, "{{ include_time == 'time_enabled' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t12" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'entity_state_enabled' in night_lights_conditions }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t13" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'time_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t14" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'sun_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t15", "t16" ] }, { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, "{{ dynamic_lighting_state_control == 'enable_state_control' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t17" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t18" }, { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t19" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t19" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t19" }, "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ] }, { "condition": "or", "conditions": [ "{{ include_bypass == [] }}", { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t19" ] } ] }, { "condition": "or", "conditions": [ "{{ include_sun == 'sun_disabled' }}", "{{ include_sun == 'sun_enabled_night_lights' }}", "{{ (include_sun == 'sun_enabled') and (is_state_attr('sun.sun', 'rising', false)) and (state_attr('sun.sun','elevation') <= sun_elevation | float(90)) }}", "{{ (include_sun == 'sun_enabled') and (is_state_attr('sun.sun', 'rising', true)) and (state_attr('sun.sun','elevation') <= sun_elevation_rising | float(90)) }}", { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t9" ] } ] }, { "condition": "or", "conditions": [ "{{ include_ambient == 'ambient_disabled' }}", "{{ ambient_light_sensor == [] }}", "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_value | int)) }}", "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) and ((include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) }}", { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ( ambient_light_options == 'ambient_light_option_enabled' ) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ( ambient_light_options == 'ambient_light_option_enabled' ) }}", { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t10" ] } ] }, { "condition": "or", "conditions": [ "{{ include_time == 'time_disabled' }}", { "condition": "and", "conditions": [ { "condition": "time", "after": "18:00:00", "before": "09:00:00", "weekday": [ "mon", "tue", "wed", "thu", "fri", "sat", "sun" ] }, "{{ include_time == 'time_enabled' }}" ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t11" ] } ] }, { "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_disabled' }}" }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t18" ] } ] }, { "condition": "or", "conditions": [ "{{ include_device_tracker == 'device_tracker_disabled' }}", { "condition": "and", "conditions": [ "{{ include_device_tracker == 'zone_enabled' }}", { "condition": "numeric_state", "entity_id": [], "above": 0 } ] }, { "condition": "and", "conditions": [ "{{ include_device_tracker == 'zone_people_enabled' }}", "{{ (state_attr(zone, 'persons') | list | select('in', people) | list | length) > 0 }}" ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop" ] } ] } ], "id": "1758055141945", "alias": "Beweging Keuken", "description": "" }, "blueprint_inputs": { "id": "1758055141945", "alias": "Beweging Keuken", "description": "", "use_blueprint": { "path": "Blackshome/sensor-light.yaml", "input": { "motion_trigger": [ "binary_sensor.beweging_keuken_bezetting" ], "light_switch": { "entity_id": "light.lamp_keuken_main" }, "include_light_control": [ "use_brightness" ], "light_brightness": 80, "include_sun": "sun_enabled", "night_lights_conditions": [ "time_enabled" ], "include_time": "time_disabled", "after_time": "18:00:00", "before_time": "09:00:00", "night_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_light_control": [ "use_brightness", "use_transition" ], "night_light_brightness": 100, "include_night_light_colour_control": "use_colour_temperature", "night_light_colour_temperature": 2700, "include_night_glow": "night_glow_disabled", "night_glow_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_glow_light_colour_control": "use_colour_temperature", "night_glow_light_colour_temperature": 2000, "include_night_glow_light_control": [ "use_brightness" ], "include_dynamic_lighting": "enable_sun_elevation_colour_brightness", "dynamic_lighting_min_colour_temp": 2500, "include_night_lights": "night_lights_enabled", "dynamic_lighting_max_colour_temp": 4200, "night_lights_after_time": "20:30:00", "dynamic_lighting_max_brightness": 80, "dynamic_lighting_min_brightness": 42, "night_lights_before_time": "06:00:00", "night_light_transition_on": 0, "night_light_transition_off": 10 } } }, "context": { "id": "01KF2TF8PKNAND1CT6WE9JBB5S", "parent_id": "01KF2TF8PEEKP0M3X8D38537S6", "user_id": null } }, "short_dict": { "last_step": "condition/0/conditions/24/conditions/0", "run_id": "a4a3fc96dc198a3303d29d78eb888775", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T07:14:16.403935+00:00", "finish": "2026-01-16T07:14:16.407924+00:00" }, "domain": "automation", "item_id": "1758055141945", "trigger": "numeric state of sun.sun" } }, { "extended_dict": { "last_step": "condition/0/conditions/24/conditions/0", "run_id": "7f3bdef3aeb901ed7a30592bab9a268b", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T08:00:00.202753+00:00", "finish": "2026-01-16T08:00:00.208126+00:00" }, "domain": "automation", "item_id": "1758055141945", "trigger": "time", "trace": { "trigger/15": [ { "path": "trigger/15", "timestamp": "2026-01-16T08:00:00.206965+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_keuken", "state": "on", "attributes": { "id": "1758055141945", "last_triggered": "2026-01-14T07:15:42.494411+00:00", "mode": "restart", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Keuken [BP]" }, "last_changed": "2026-01-15T08:04:17.790058+00:00", "last_reported": "2026-01-15T08:04:17.790058+00:00", "last_updated": "2026-01-15T08:04:17.790058+00:00", "context": { "id": "01KF0AY4QYBE01ZPZ9TKTK0DH5", "parent_id": null, "user_id": null } }, "trigger": { "id": "t11", "idx": "15", "alias": null, "platform": "time", "now": "2026-01-16T09:00:00.202570+01:00", "description": "time", "entity_id": null }, "motion_trigger": [ "binary_sensor.beweging_keuken_bezetting" ], "light_switch": { "entity_id": "light.lamp_keuken_main" }, "boolean_scenes_scripts": [], "end_scenes": [], "time_delay": 5, "include_light_control": [ "use_brightness" ], "light_brightness": 80, "light_transition_on": 1, "light_transition_off": 1, "include_light_colour_control": "disable_colour_control", "light_colour_temperature": 5000, "light_rgb_colour": [ 255, 255, 255 ], "light_rgbw_colour": [ 255, 255, 255, 255 ], "light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_dynamic_lighting": "enable_sun_elevation_colour_brightness", "dynamic_lighting_lux_sensor": [], "dynamic_lighting_max_lux": 400, "dynamic_lighting_min_lux": 40, "dynamic_lighting_max_brightness": 80, "dynamic_lighting_min_brightness": 42, "dynamic_lighting_boolean": [], "dynamic_lighting_max_colour_temp": 4200, "dynamic_lighting_min_colour_temp": 2500, "dynamic_lighting_sun_elevation_start_rising": -1.5, "dynamic_lighting_sun_elevation_end_rising": 15, "dynamic_lighting_sun_elevation_start_falling": 15, "dynamic_lighting_sun_elevation_end_falling": -4.0, "dynamic_lighting_time_start_morning": "06:00:00", "dynamic_lighting_time_end_morning": "09:00:00", "dynamic_lighting_time_start_evening": "17:00:00", "dynamic_lighting_time_end_evening": "19:00:00", "dynamic_lighting_heartbeat": 1, "dynamic_lighting_step_value": 4, "dynamic_lighting_dead_zone": 7, "dynamic_lighting_state_control": "disable_state_control", "dynamic_lighting_state_control_activation_state": "on", "dynamic_lighting_state_control_entity": [], "include_bypass": [], "motion_bypass_lights_on": [], "motion_bypass_lights_off": [], "motion_bypass_lights_stop": [], "bypass_time_delay": 0, "include_bypass_auto_off": [], "bypass_auto_off_delay": 60, "include_sun": "sun_enabled", "sun_elevation": -1.5, "sun_elevation_rising": -4.0, "include_ambient": "ambient_disabled", "ambient_light_sensor": [], "ambient_light_options": "ambient_light_option_disabled", "ambient_light_value": 20, "ambient_light_high_value": 80, "include_time": "time_disabled", "after_time": "18:00:00", "before_time": "09:00:00", "weekday_options": [ "mon", "tue", "wed", "thu", "fri", "sat", "sun" ], "include_state_control": "state_control_disabled", "state_control_activation_state": "off", "state_control_entity": [], "include_device_tracker": "device_tracker_disabled", "zone": [], "people": [], "include_night_lights": "night_lights_enabled", "night_lights_conditions": [ "time_enabled" ], "night_lights_entity_state": [], "night_lights_after_time": "20:30:00", "night_lights_before_time": "06:00:00", "night_lights_sun_elevation": -1.5, "night_lights_sun_elevation_rising": -4.0, "night_lights": { "entity_id": "light.lamp_keuken_kleur" }, "night_boolean_scenes_scripts": [], "night_time_delay": 5, "include_night_light_control": [ "use_brightness", "use_transition" ], "night_light_brightness": 100, "night_light_transition_on": 0, "night_light_transition_off": 10, "include_night_light_colour_control": "use_colour_temperature", "night_light_colour_temperature": 2700, "night_light_rgb_colour": [ 255, 255, 255 ], "night_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_night_glow": "night_glow_disabled", "night_glow_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_glow_light_control": [ "use_brightness" ], "night_glow_light_brightness": 20, "night_glow_light_transition_on": 1, "night_glow_light_transition_off": 1, "include_night_glow_light_colour_control": "use_colour_temperature", "night_glow_light_colour_temperature": 2000, "night_glow_light_rgb_colour": [ 255, 255, 255 ], "night_glow_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_glow_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "light_entities_off": [ "light.lamp_keuken_main" ], "switch_entities_off": [], "light_data": { "brightness_pct": 80 }, "light_entities": [ "light.lamp_keuken_main" ], "switch_entities": [], "scene_entities": [], "script_entities": [], "boolean_scenes_scripts_helper": [], "end_scene_entities": [], "end_script_entities": [], "night_light_entities_off": [ "light.lamp_keuken_kleur" ], "night_switch_entities_off": [], "night_light_data": { "transition": 0, "brightness_pct": 100, "color_temp_kelvin": 2700 }, "night_light_entities": [ "light.lamp_keuken_kleur" ], "night_switch_entities": [], "night_scene_entities": [], "night_script_entities": [], "night_boolean_scenes_scripts_helper": [], "night_glow_light_data": { "brightness_pct": 20, "color_temp_kelvin": 2000 }, "night_glow_light_entities": [ "light.lamp_keuken_kleur" ], "night_glow_switch_entities": [], "night_glow_scene_entities": [], "night_glow_script_entities": [], "crossover_night_glow_to_night_lights_light": [], "crossover_night_glow_to_night_lights_switch": [], "crossover_night_lights_to_night_glow_light": [], "crossover_night_lights_to_night_glow_switch": [], "crossover_lights_to_night_glow_light": [ "light.lamp_keuken_main" ], "crossover_lights_to_night_glow_switch": [], "crossover_lights_light": [], "crossover_lights_switch": [], "crossover_night_lights_light_on": [], "crossover_night_lights_light": [], "crossover_night_lights_switch": [], "crossover_lights_light_on": [], "dynamic_lighting_state_control_activation_state_inv": "off" } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-16T08:00:00.206998+00:00", "result": { "result": false } } ], "condition/0/conditions/0": [ { "path": "condition/0/conditions/0", "timestamp": "2026-01-16T08:00:00.207026+00:00", "result": { "result": false } } ], "condition/0/conditions/0/conditions/0": [ { "path": "condition/0/conditions/0/conditions/0", "timestamp": "2026-01-16T08:00:00.207044+00:00", "result": { "result": false } } ], "condition/0/conditions/1": [ { "path": "condition/0/conditions/1", "timestamp": "2026-01-16T08:00:00.207072+00:00", "result": { "result": false } } ], "condition/0/conditions/1/conditions/0": [ { "path": "condition/0/conditions/1/conditions/0", "timestamp": "2026-01-16T08:00:00.207089+00:00", "result": { "result": false } } ], "condition/0/conditions/2": [ { "path": "condition/0/conditions/2", "timestamp": "2026-01-16T08:00:00.207111+00:00", "result": { "result": false } } ], "condition/0/conditions/2/conditions/0": [ { "path": "condition/0/conditions/2/conditions/0", "timestamp": "2026-01-16T08:00:00.207127+00:00", "result": { "result": false } } ], "condition/0/conditions/3": [ { "path": "condition/0/conditions/3", "timestamp": "2026-01-16T08:00:00.207148+00:00", "result": { "result": false } } ], "condition/0/conditions/3/conditions/0": [ { "path": "condition/0/conditions/3/conditions/0", "timestamp": "2026-01-16T08:00:00.207163+00:00", "result": { "result": false } } ], "condition/0/conditions/4": [ { "path": "condition/0/conditions/4", "timestamp": "2026-01-16T08:00:00.207183+00:00", "result": { "result": false } } ], "condition/0/conditions/4/conditions/0": [ { "path": "condition/0/conditions/4/conditions/0", "timestamp": "2026-01-16T08:00:00.207211+00:00", "result": { "result": false } } ], "condition/0/conditions/5": [ { "path": "condition/0/conditions/5", "timestamp": "2026-01-16T08:00:00.207232+00:00", "result": { "result": false } } ], "condition/0/conditions/5/conditions/0": [ { "path": "condition/0/conditions/5/conditions/0", "timestamp": "2026-01-16T08:00:00.207247+00:00", "result": { "result": false } } ], "condition/0/conditions/6": [ { "path": "condition/0/conditions/6", "timestamp": "2026-01-16T08:00:00.207268+00:00", "result": { "result": false } } ], "condition/0/conditions/6/conditions/0": [ { "path": "condition/0/conditions/6/conditions/0", "timestamp": "2026-01-16T08:00:00.207284+00:00", "result": { "result": false } } ], "condition/0/conditions/7": [ { "path": "condition/0/conditions/7", "timestamp": "2026-01-16T08:00:00.207304+00:00", "result": { "result": false } } ], "condition/0/conditions/7/conditions/0": [ { "path": "condition/0/conditions/7/conditions/0", "timestamp": "2026-01-16T08:00:00.207320+00:00", "result": { "result": false } } ], "condition/0/conditions/8": [ { "path": "condition/0/conditions/8", "timestamp": "2026-01-16T08:00:00.207340+00:00", "result": { "result": false } } ], "condition/0/conditions/8/conditions/0": [ { "path": "condition/0/conditions/8/conditions/0", "timestamp": "2026-01-16T08:00:00.207359+00:00", "result": { "result": false } } ], "condition/0/conditions/9": [ { "path": "condition/0/conditions/9", "timestamp": "2026-01-16T08:00:00.207379+00:00", "result": { "result": false } } ], "condition/0/conditions/9/conditions/0": [ { "path": "condition/0/conditions/9/conditions/0", "timestamp": "2026-01-16T08:00:00.207394+00:00", "result": { "result": false } } ], "condition/0/conditions/10": [ { "path": "condition/0/conditions/10", "timestamp": "2026-01-16T08:00:00.207414+00:00", "result": { "result": false } } ], "condition/0/conditions/10/conditions/0": [ { "path": "condition/0/conditions/10/conditions/0", "timestamp": "2026-01-16T08:00:00.207430+00:00", "result": { "result": false } } ], "condition/0/conditions/11": [ { "path": "condition/0/conditions/11", "timestamp": "2026-01-16T08:00:00.207449+00:00", "result": { "result": false } } ], "condition/0/conditions/11/conditions/0": [ { "path": "condition/0/conditions/11/conditions/0", "timestamp": "2026-01-16T08:00:00.207464+00:00", "result": { "result": false } } ], "condition/0/conditions/12": [ { "path": "condition/0/conditions/12", "timestamp": "2026-01-16T08:00:00.207484+00:00", "result": { "result": false } } ], "condition/0/conditions/12/conditions/0": [ { "path": "condition/0/conditions/12/conditions/0", "timestamp": "2026-01-16T08:00:00.207499+00:00", "result": { "result": false } } ], "condition/0/conditions/13": [ { "path": "condition/0/conditions/13", "timestamp": "2026-01-16T08:00:00.207520+00:00", "result": { "result": false } } ], "condition/0/conditions/13/conditions/0": [ { "path": "condition/0/conditions/13/conditions/0", "timestamp": "2026-01-16T08:00:00.207536+00:00", "result": { "result": false } } ], "condition/0/conditions/14": [ { "path": "condition/0/conditions/14", "timestamp": "2026-01-16T08:00:00.207557+00:00", "result": { "result": false } } ], "condition/0/conditions/14/conditions/0": [ { "path": "condition/0/conditions/14/conditions/0", "timestamp": "2026-01-16T08:00:00.207573+00:00", "result": { "result": false } } ], "condition/0/conditions/15": [ { "path": "condition/0/conditions/15", "timestamp": "2026-01-16T08:00:00.207607+00:00", "result": { "result": false } } ], "condition/0/conditions/15/conditions/0": [ { "path": "condition/0/conditions/15/conditions/0", "timestamp": "2026-01-16T08:00:00.207644+00:00", "result": { "result": true } } ], "condition/0/conditions/15/conditions/1": [ { "path": "condition/0/conditions/15/conditions/1", "timestamp": "2026-01-16T08:00:00.207676+00:00", "result": { "result": false, "entities": [] } } ], "condition/0/conditions/16": [ { "path": "condition/0/conditions/16", "timestamp": "2026-01-16T08:00:00.207791+00:00", "result": { "result": false } } ], "condition/0/conditions/16/conditions/0": [ { "path": "condition/0/conditions/16/conditions/0", "timestamp": "2026-01-16T08:00:00.207809+00:00", "result": { "result": false } } ], "condition/0/conditions/17": [ { "path": "condition/0/conditions/17", "timestamp": "2026-01-16T08:00:00.207831+00:00", "result": { "result": false } } ], "condition/0/conditions/17/conditions/0": [ { "path": "condition/0/conditions/17/conditions/0", "timestamp": "2026-01-16T08:00:00.207847+00:00", "result": { "result": false } } ], "condition/0/conditions/18": [ { "path": "condition/0/conditions/18", "timestamp": "2026-01-16T08:00:00.207867+00:00", "result": { "result": false } } ], "condition/0/conditions/18/conditions/0": [ { "path": "condition/0/conditions/18/conditions/0", "timestamp": "2026-01-16T08:00:00.207883+00:00", "result": { "result": false } } ], "condition/0/conditions/19": [ { "path": "condition/0/conditions/19", "timestamp": "2026-01-16T08:00:00.207903+00:00", "result": { "result": false } } ], "condition/0/conditions/19/conditions/0": [ { "path": "condition/0/conditions/19/conditions/0", "timestamp": "2026-01-16T08:00:00.207919+00:00", "result": { "result": false } } ], "condition/0/conditions/20": [ { "path": "condition/0/conditions/20", "timestamp": "2026-01-16T08:00:00.207940+00:00", "result": { "result": false } } ], "condition/0/conditions/20/conditions/0": [ { "path": "condition/0/conditions/20/conditions/0", "timestamp": "2026-01-16T08:00:00.207956+00:00", "result": { "result": false } } ], "condition/0/conditions/21": [ { "path": "condition/0/conditions/21", "timestamp": "2026-01-16T08:00:00.207976+00:00", "result": { "result": false } } ], "condition/0/conditions/21/conditions/0": [ { "path": "condition/0/conditions/21/conditions/0", "timestamp": "2026-01-16T08:00:00.207991+00:00", "result": { "result": false } } ], "condition/0/conditions/22": [ { "path": "condition/0/conditions/22", "timestamp": "2026-01-16T08:00:00.208011+00:00", "result": { "result": false } } ], "condition/0/conditions/22/conditions/0": [ { "path": "condition/0/conditions/22/conditions/0", "timestamp": "2026-01-16T08:00:00.208027+00:00", "result": { "result": false } } ], "condition/0/conditions/23": [ { "path": "condition/0/conditions/23", "timestamp": "2026-01-16T08:00:00.208047+00:00", "result": { "result": false } } ], "condition/0/conditions/23/conditions/0": [ { "path": "condition/0/conditions/23/conditions/0", "timestamp": "2026-01-16T08:00:00.208063+00:00", "result": { "result": false } } ], "condition/0/conditions/24": [ { "path": "condition/0/conditions/24", "timestamp": "2026-01-16T08:00:00.208083+00:00", "result": { "result": false } } ], "condition/0/conditions/24/conditions/0": [ { "path": "condition/0/conditions/24/conditions/0", "timestamp": "2026-01-16T08:00:00.208099+00:00", "result": { "result": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "motion_trigger": [ "binary_sensor.beweging_keuken_bezetting" ], "light_switch": { "entity_id": "light.lamp_keuken_main" }, "boolean_scenes_scripts": [], "end_scenes": [], "time_delay": 5, "include_light_control": [ "use_brightness" ], "light_brightness": 80, "light_transition_on": 1, "light_transition_off": 1, "include_light_colour_control": "disable_colour_control", "light_colour_temperature": 5000, "light_rgb_colour": [ 255, 255, 255 ], "light_rgbw_colour": [ 255, 255, 255, 255 ], "light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_dynamic_lighting": "enable_sun_elevation_colour_brightness", "dynamic_lighting_lux_sensor": [], "dynamic_lighting_max_lux": 400, "dynamic_lighting_min_lux": 40, "dynamic_lighting_max_brightness": 80, "dynamic_lighting_min_brightness": 42, "dynamic_lighting_boolean": [], "dynamic_lighting_max_colour_temp": 4200, "dynamic_lighting_min_colour_temp": 2500, "dynamic_lighting_sun_elevation_start_rising": -1.5, "dynamic_lighting_sun_elevation_end_rising": 15, "dynamic_lighting_sun_elevation_start_falling": 15, "dynamic_lighting_sun_elevation_end_falling": -4.0, "dynamic_lighting_time_start_morning": "06:00:00", "dynamic_lighting_time_end_morning": "09:00:00", "dynamic_lighting_time_start_evening": "17:00:00", "dynamic_lighting_time_end_evening": "19:00:00", "dynamic_lighting_heartbeat": 1, "dynamic_lighting_step_value": 4, "dynamic_lighting_dead_zone": 7, "dynamic_lighting_state_control": "disable_state_control", "dynamic_lighting_state_control_activation_state": "on", "dynamic_lighting_state_control_entity": [], "include_bypass": [], "motion_bypass_lights_on": [], "motion_bypass_lights_off": [], "motion_bypass_lights_stop": [], "bypass_time_delay": 0, "include_bypass_auto_off": [], "bypass_auto_off_delay": 60, "include_sun": "sun_enabled", "sun_elevation": -1.5, "sun_elevation_rising": -4.0, "include_ambient": "ambient_disabled", "ambient_light_sensor": [], "ambient_light_options": "ambient_light_option_disabled", "ambient_light_value": 20, "ambient_light_high_value": 80, "include_time": "time_disabled", "after_time": "18:00:00", "before_time": "09:00:00", "weekday_options": [ "mon", "tue", "wed", "thu", "fri", "sat", "sun" ], "include_state_control": "state_control_disabled", "state_control_activation_state": "off", "state_control_entity": [], "include_device_tracker": "device_tracker_disabled", "zone": [], "people": [], "include_night_lights": "night_lights_enabled", "night_lights_conditions": [ "time_enabled" ], "night_lights_entity_state": [], "night_lights_after_time": "20:30:00", "night_lights_before_time": "06:00:00", "night_lights_sun_elevation": -1.5, "night_lights_sun_elevation_rising": -4.0, "night_lights": { "entity_id": "light.lamp_keuken_kleur" }, "night_boolean_scenes_scripts": [], "night_time_delay": 5, "include_night_light_control": [ "use_brightness", "use_transition" ], "night_light_brightness": 100, "night_light_transition_on": 0, "night_light_transition_off": 10, "include_night_light_colour_control": "use_colour_temperature", "night_light_colour_temperature": 2700, "night_light_rgb_colour": [ 255, 255, 255 ], "night_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_night_glow": "night_glow_disabled", "night_glow_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_glow_light_control": [ "use_brightness" ], "night_glow_light_brightness": 20, "night_glow_light_transition_on": 1, "night_glow_light_transition_off": 1, "include_night_glow_light_colour_control": "use_colour_temperature", "night_glow_light_colour_temperature": 2000, "night_glow_light_rgb_colour": [ 255, 255, 255 ], "night_glow_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_glow_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "light_entities_off": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'light')\n | selectattr('state', 'eq', 'off')\n | map(attribute='entity_id')\n | list }}\n", "switch_entities_off": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'switch')\n | selectattr('state', 'eq', 'off')\n | map(attribute='entity_id')| list }}\n", "light_data": "{% set light = namespace(data={}) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': light_brightness }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}", "light_entities": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'light')\n | map(attribute='entity_id')\n | list }}\n", "switch_entities": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'switch')\n | map(attribute='entity_id')\n | list }}\n", "scene_entities": "{% set a = light_switch.entity_id %} {% if boolean_scenes_scripts == [] %}\n {{ expand(a) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% elif is_state(boolean_scenes_scripts, 'off') %}\n {{ expand(a) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "script_entities": "{% set a = light_switch.entity_id %} {% if boolean_scenes_scripts == [] %}\n {{ expand(a) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% elif is_state(boolean_scenes_scripts, 'off') %}\n {{ expand(a) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "boolean_scenes_scripts_helper": "{% if boolean_scenes_scripts | length > 0 and states(boolean_scenes_scripts) == 'off' %}\n {{ boolean_scenes_scripts }}\n{% else %}\n []\n{% endif %}", "end_scene_entities": "{{ end_scenes | select('match', '^scene\\..*') | list }}", "end_script_entities": "{{ end_scenes | select('match', '^script\\..*') | list }}", "night_light_entities_off": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'off') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_switch_entities_off": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'switch') | selectattr('state', 'eq', 'off') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_light_data": "{% set light = namespace(data={}) %} {% if 'use_transition' in include_night_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': night_light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_night_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': night_light_brightness }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': night_light_colour_temperature }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': night_light_rgb_colour }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': night_light_rgbw_colour }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': night_light_rgbww_colour }) %}\n{% endif %} {{ light.data }}", "night_light_entities": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_switch_entities": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_scene_entities": "{% set b = night_lights and night_lights.entity_id %} {% if night_boolean_scenes_scripts == [] %}\n {{ expand(b) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% elif is_state(night_boolean_scenes_scripts, 'off') %}\n {{ expand(b) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_script_entities": "{% set b = night_lights and night_lights.entity_id %} {% if night_boolean_scenes_scripts == [] %}\n {{ expand(b) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% elif is_state(night_boolean_scenes_scripts, 'off') %}\n {{ expand(b) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_boolean_scenes_scripts_helper": "{% if night_boolean_scenes_scripts | length > 0 and states(night_boolean_scenes_scripts) == 'off' %}\n {{ night_boolean_scenes_scripts }}\n{% else %}\n []\n{% endif %}", "night_glow_light_data": "{% set light = namespace(data={}) %} {% if 'use_transition' in include_night_glow_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': night_glow_light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_night_glow_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': night_glow_light_brightness }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': night_glow_light_colour_temperature }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': night_glow_light_rgb_colour }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': night_glow_light_rgbw_colour }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': night_glow_light_rgbww_colour }) %}\n{% endif %} {{ light.data }}", "night_glow_light_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_glow_switch_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_glow_scene_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_glow_script_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_glow_to_night_lights_light": "{% set a = night_lights and night_lights.entity_id %} {% set b = night_glow_lights and night_glow_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_glow_to_night_lights_switch": "{% set a = night_lights and night_lights.entity_id %} {% set b = night_glow_lights and night_glow_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_to_night_glow_light": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_to_night_glow_switch": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_to_night_glow_light": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = light_switch.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_to_night_glow_switch": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = light_switch.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_light": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(a) | reject('in', expand(b)) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_switch": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(a) | reject('in', expand(b)) | selectattr('domain', 'eq', 'switch') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_light_on": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_light": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_switch": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_light_on": "{% set a = light_switch.entity_id %} {% if a %}\n {{ expand(a) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "dynamic_lighting_state_control_activation_state_inv": "{% if dynamic_lighting_state_control_activation_state == 'on' %}\n off\n{% else %}\n on\n{% endif %}\n" }, "triggers": [ { "trigger": "state", "id": "t0", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "from": "off", "to": "on" }, { "trigger": "numeric_state", "id": "t1", "entity_id": "sun.sun", "attribute": "elevation", "below": -1.5 }, { "trigger": "numeric_state", "id": "t2", "entity_id": [], "below": 20 }, { "trigger": "time", "id": "t3", "at": "18:00:00" }, { "trigger": "state", "id": "t4", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "time", "id": "t5", "at": "20:30:00" }, { "trigger": "numeric_state", "id": "t6", "entity_id": "sun.sun", "attribute": "elevation", "below": -1.5 }, { "trigger": "state", "id": "t7_on", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t7_off", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t7_stop", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t8_on", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "state", "id": "t8_off", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "state", "id": "t8_stop", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "numeric_state", "id": "t9", "entity_id": "sun.sun", "attribute": "elevation", "above": -4.0 }, { "trigger": "numeric_state", "id": "t10", "entity_id": [], "above": 80 }, { "trigger": "time", "id": "t11", "at": "09:00:00" }, { "trigger": "state", "id": "t12", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "time", "id": "t13", "at": "06:00:00" }, { "trigger": "numeric_state", "id": "t14", "entity_id": "sun.sun", "attribute": "elevation", "above": -4.0 }, { "trigger": "state", "id": "t15", "entity_id": [], "to": "on" }, { "trigger": "state", "id": "t16", "entity_id": [], "from": "on" }, { "trigger": "state", "id": "t17", "entity_id": [], "to": "off" }, { "trigger": "state", "id": "t18", "entity_id": [], "from": "off" }, { "trigger": "homeassistant", "id": "t19", "event": "start" } ], "actions": [ { "choose": [ { "alias": "Check if night lights are enabled and within conditions", "conditions": [ { "condition": "and", "conditions": [ { "alias": "Check if night lights is enabled", "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_enabled' }}" }, { "alias": "Check if night lights entity state is enabled", "condition": "or", "conditions": [ "{{ ('time_enabled' in night_lights_conditions) and not ('entity_state_enabled' in night_lights_conditions) }}", "{{ ('sun_enabled' in night_lights_conditions) and not ('entity_state_enabled' in night_lights_conditions) }}", { "condition": "and", "conditions": [ "{{ 'entity_state_enabled' in night_lights_conditions }}", { "condition": "state", "entity_id": [], "state": "on", "match": "any" } ] } ] }, { "alias": "Check if night lights time is enabled", "condition": "or", "conditions": [ "{{ ('entity_state_enabled' in night_lights_conditions) and not ('time_enabled' in night_lights_conditions) }}", "{{ ('sun_enabled' in night_lights_conditions) and not ('time_enabled' in night_lights_conditions) }}", { "condition": "and", "conditions": [ "{{ 'time_enabled' in night_lights_conditions }}", { "condition": "time", "after": "20:30:00", "before": "06:00:00" } ] } ] }, { "alias": "Check if night lights sun is enabled", "condition": "or", "conditions": [ "{{ ('entity_state_enabled' in night_lights_conditions) and not ('sun_enabled' in night_lights_conditions) }}", "{{ ('time_enabled' in night_lights_conditions) and not ('sun_enabled' in night_lights_conditions) }}", "{{ ('sun_enabled' in night_lights_conditions) and (((is_state_attr('sun.sun', 'rising', false)) and (state_attr('sun.sun','elevation') <= night_lights_sun_elevation | float(90))) or ((is_state_attr('sun.sun', 'rising', true)) and (state_attr('sun.sun','elevation') <= night_lights_sun_elevation_rising | float(90)))) }}" ] } ] } ], "sequence": [ { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "By-pass is turned on & check by-pass option - Turn lights off", "conditions": [ { "condition": "trigger", "id": "t7_off" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] }, { "alias": "By-pass is turned on & check by-pass option - Keep the current lights state", "conditions": [ { "condition": "trigger", "id": "t7_stop" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & check if the motion trigger is off", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "all", "state": "off" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If night glow is disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] }, { "alias": "If night glow is enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn on the lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": "{{ night_glow_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn OFF crossover lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_to_night_glow_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" } }, { "alias": "Turn OFF crossover lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_to_night_glow_light }}" } } ] } ] }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_on }}" } }, { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}", "transition": "{{ night_glow_light_transition_on }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } }, { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn OFF crossover night switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_switch }}" } }, { "alias": "Turn OFF crossover light switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_to_night_glow_switch }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ night_glow_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Motion trigger is off and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "By-pass is turned off & check if the motion trigger is on", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] }, { "condition": "or", "conditions": [ "{{ (include_sun == 'sun_enabled') and (state_attr('sun.sun','elevation') >= sun_elevation | float(90)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_disabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (is_state(night_boolean_scenes_scripts, 'off')) }}", { "condition": "and", "conditions": [ "{{ include_time == 'time_enabled' }}", { "condition": "time", "after": "09:00:00", "before": "18:00:00" } ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "template", "value_template": "{% set opposite = 'off' if state_control_activation_state == 'on' else 'on' %} {{ is_state(state_control_entity, opposite) }}" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] }, { "alias": "Motion trigger is on and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned off & reset lights to the site conditions", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "choose": [ { "alias": "Check if normal lights Scenes & Scripts - Toggle Helper is on", "conditions": [ { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean normal lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ crossover_night_lights_light_on }}" }, "data": "{{ night_light_data }}" } ] } ] } ] } ] }, { "choose": [ { "alias": "Sun, ambient, time & state control above setting to turn off", "conditions": [ { "condition": "trigger", "id": [ "t9", "t10", "t11", "t18" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] }, { "alias": "Turn off normal lights when trigger by start night lights conditions", "conditions": [ { "condition": "trigger", "id": [ "t4", "t5", "t6" ] } ], "sequence": [ { "choose": [ { "alias": "light - switch - scene - script is ON", "conditions": [ { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "choose": [ { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the input boolean normal lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ crossover_night_lights_light_on }}" }, "data": "{{ night_light_data }}" } ] } ] } ] }, { "alias": "Turn on night glow lights if all lights are off", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" }, { "condition": "template", "value_template": "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (is_state(boolean_scenes_scripts, 'off')) }}\n" } ], "sequence": [ { "alias": "Turn on the lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": "{{ night_glow_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}", "transition": "{{ night_glow_light_transition_on }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ night_glow_script_entities }}" } }, { "stop": "Stop the automation" } ] }, { "alias": "If manage scripts is enabled", "conditions": [ "{{ 'manage_scripts_crossing_over' in include_night_light_control }}", "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (is_state(boolean_scenes_scripts, 'off')) }}" ], "sequence": [ { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Safe Guard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t19" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Small time delay required", "delay": { "seconds": 1 } } ] }, { "alias": "Check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass auto off is enabled and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "choose": [ { "alias": "If night glow is disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_disabled' }}" } ], "sequence": [ { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_light_entities_off }}" }, "data": "{{ night_light_data }}" }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ { "condition": "template", "value_template": "{% if boolean_scenes_scripts == [] %}\n false\n{% elif is_state(boolean_scenes_scripts, 'on') %}\n true\n{% else %}\n false\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": "{{ boolean_scenes_scripts }}" } }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ "{{ night_boolean_scenes_scripts != [] }}" ], "sequence": [ { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" }, "data": { "transition": "{{ night_light_transition_on }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] }, { "alias": "Turn on the night switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_switch_entities_off }}" } }, { "alias": "Turn on the night scripts", "action": "script.turn_on", "target": { "entity_id": "{{ night_script_entities }}" } } ] }, { "alias": "If night glow is enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" }, { "condition": "not", "conditions": [ { "condition": "trigger", "id": [ "t15", "t16" ] } ] } ], "sequence": [ { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_light_entities }}" }, "data": "{{ night_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night glow lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night glow lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ { "condition": "template", "value_template": "{% if boolean_scenes_scripts == [] %}\n false\n{% elif is_state(boolean_scenes_scripts, 'on') %}\n true\n{% else %}\n false\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": "{{ boolean_scenes_scripts }}" } }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ "{{ night_boolean_scenes_scripts != [] }}" ], "sequence": [ { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" }, "data": { "transition": "{{ night_light_transition_on }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] }, { "alias": "Turn on the night switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off crossover night glow switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } }, { "alias": "Turn on the night scripts", "action": "script.turn_on", "target": { "entity_id": "{{ night_script_entities }}" } } ] } ] }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - Turn lights on", "conditions": [ { "condition": "trigger", "id": "t7_on" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Check if the trigger is on and wait for it to go off", "conditions": [ { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" } ], "sequence": [ { "alias": "Wait until motion sensor is off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Wait the number of minutes set in the night lights time delay", "delay": { "minutes": 5 } }, { "choose": [ { "alias": "If night glow is disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] }, { "alias": "If night glow is enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn on the lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": "{{ night_glow_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" } } ] } ] }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}", "transition": "{{ night_glow_light_transition_on }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn OFF crossover night switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_switch }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ night_glow_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ], "default": [ { "choose": [ { "alias": "By-pass is turned on & check by-pass option - Turn lights off", "conditions": [ { "condition": "trigger", "id": "t7_off" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If night lights are disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] }, { "alias": "If night lights are enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] } ] }, { "alias": "By-pass is turned on & check by-pass option - Keep the current lights state", "conditions": [ { "condition": "trigger", "id": "t7_stop" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & check if the motion trigger is off", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "all", "state": "off" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If night lights are disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "If night lights are enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Motion trigger is off and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "By-pass is turned off & check if the motion trigger is on", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] }, { "condition": "or", "conditions": [ "{{ (include_sun == 'sun_enabled') and (state_attr('sun.sun','elevation') >= sun_elevation | float(90)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_disabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (is_state(boolean_scenes_scripts, 'off')) }}", { "condition": "and", "conditions": [ { "condition": "time", "after": "09:00:00", "before": "18:00:00" }, "{{ include_time == 'time_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "template", "value_template": "{% set opposite = 'off' if state_control_activation_state == 'on' else 'on' %} {{ is_state(state_control_entity, opposite) }}" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Motion trigger is on and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned off & reset lights to the site conditions", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] } ] } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "choose": [ { "alias": "Check if night lights scenes & scripts - toggle helper is on", "conditions": [ { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "Turn ON lights", "conditions": [ { "alias": "Check the dynamic lighting options", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'disable_dynamic_lighting' }}" }, { "alias": "Check that dynamic lighting is active and the state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "template", "value_template": "{{ states(dynamic_lighting_state_control_entity) == dynamic_lighting_state_control_activation_state_inv }}" } ] } ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ crossover_lights_light_on }}" }, "data": "{{ light_data }}" }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ] } ] } ] } ] } ] }, { "choose": [ { "alias": "Sun, ambient, time & state control above setting to turn off", "conditions": [ { "condition": "trigger", "id": [ "t9", "t10", "t11", "t18" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Turn off night lights when trigger by end night lights conditions", "conditions": [ { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "choose": [ { "alias": "If the night glow is enabled", "conditions": [ "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "off", "for": { "minutes": 5 } } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": { "transition": "{{ night_glow_light_transition_off}}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_glow_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_glow_light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "stop": "Stop the automation" } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or (is_state(night_boolean_scenes_scripts, 'on')) }}\n" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "choose": [ { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Turn ON lights", "conditions": [ { "alias": "Check the dynamic lighting options", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'disable_dynamic_lighting' }}" }, { "alias": "Check that dynamic lighting is active and the state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "template", "value_template": "{{ states(dynamic_lighting_state_control_entity) == dynamic_lighting_state_control_activation_state_inv }}" } ] } ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ crossover_lights_light_on }}" }, "data": "{{ light_data }}" } ] } ] } ] } ] } ] }, { "alias": "If manage scripts is enabled", "conditions": [ "{{ 'manage_scripts_crossing_over' in include_night_light_control }}", "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (is_state(night_boolean_scenes_scripts, 'off')) }}" ], "sequence": [ { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Safe Guard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t19" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Small time delay required", "delay": { "seconds": 1 } } ] }, { "alias": "Check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass auto off is enabled and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "alias": "Parallel actions for dynamic lighting and normal lights", "parallel": [ { "sequence": [ { "alias": "Check if the dynamic lighting is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "alias": "Check the dynamic lighting state control option", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'disable_state_control' }}" }, { "alias": "Check if the dynamic lighting state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "state", "entity_id": [], "state": "on" } ] } ] } ] }, { "choose": [ { "alias": "Dynamic Lighting - Input Boolean Helper", "conditions": [ { "condition": "template", "value_template": "{{ dynamic_lighting_boolean != [] }}" } ], "sequence": [ { "alias": "Turn on the boolean for dynamic lighting", "action": "input_boolean.turn_on", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "1 - Dynamic Lighting - Lux Controlled Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness'}}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n false\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "2 - Dynamic Lighting - Lux Controlled Brightness - Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness_inv'}}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting brightness inverted for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "3 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': light_brightness }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if elevation >= (dynamic_lighting_sun_elevation_start_rising - 2) and elevation <= (dynamic_lighting_sun_elevation_end_rising + 2) and is_state_attr('sun.sun', 'rising', true) %}\n false\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_falling + 2) and elevation >= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n false\n {% elif elevation >= (dynamic_lighting_sun_elevation_end_rising + 2) and elevation >= (dynamic_lighting_sun_elevation_start_falling - 2) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_rising - 2) and is_state_attr('sun.sun', 'rising', true) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n true\n {% else %}\n true\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If sun elevation is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "4 - Dynamic Lighting - Sun Elevation Lighting - Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "5 - Dynamic Lighting - Sun Elevation Lighting - Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness_inv' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness inverted for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "6 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "7 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness_inv' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "8 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Lux Controlled Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" } ], "sequence": [ { "alias": "Parallel actions for dynamic lighting", "parallel": [ { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_kelvin": "{% if expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 %}\n {% set elevation = state_attr('sun.sun', 'elevation') | float %}\n {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %}\n {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %}\n {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %}\n {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %}\n {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% endif %}\n {{ colour_temp_value | round(0) }}\n{% endif %}\n", "dynamic_light_off_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n false\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Check if the light is off", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Delay for parallel actions needed for when the light is off", "delay": { "milliseconds": 100 } } ] } ] }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" }, "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}" ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_off_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] }, { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if elevation >= (dynamic_lighting_sun_elevation_start_rising - 2) and elevation <= (dynamic_lighting_sun_elevation_end_rising + 2) and is_state_attr('sun.sun', 'rising', true) %}\n false\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_falling + 2) and elevation >= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n false\n {% elif elevation >= (dynamic_lighting_sun_elevation_end_rising + 2) and elevation >= (dynamic_lighting_sun_elevation_start_falling - 2) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_rising - 2) and is_state_attr('sun.sun', 'rising', true) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n true\n {% else %}\n true\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If sun elevation is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If the lights are OFF", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] } ] } ] }, { "choose": [ { "alias": "9 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Lux Controlled Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" } ], "sequence": [ { "alias": "Parallel actions for dynamic lighting", "parallel": [ { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_kelvin": "{% if expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 %}\n {% set elevation = state_attr('sun.sun', 'elevation') | float %}\n {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %}\n {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %}\n {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %}\n {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %}\n {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% endif %}\n {{ colour_temp_value | round(0) }}\n{% endif %}\n", "dynamic_light_off_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Check if the light is off", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Delay for parallel actions needed for when the light is off", "delay": { "milliseconds": 100 } } ] } ] }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" }, "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}" ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_off_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] }, { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if elevation >= (dynamic_lighting_sun_elevation_start_rising - 2) and elevation <= (dynamic_lighting_sun_elevation_end_rising + 2) and is_state_attr('sun.sun', 'rising', true) %}\n false\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_falling + 2) and elevation >= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n false\n {% elif elevation >= (dynamic_lighting_sun_elevation_end_rising + 2) and elevation >= (dynamic_lighting_sun_elevation_start_falling - 2) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_rising - 2) and is_state_attr('sun.sun', 'rising', true) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n true\n {% else %}\n true\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If sun elevation is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If the lights are OFF", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] } ] } ] }, { "choose": [ { "alias": "10 - Dynamic Lighting - Time Controlled - Colour Temp", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_colour_temp %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set colour_temp_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set colour_temp_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% elif current_time < start_time_morning %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% elif current_time > end_time_evening %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': light_brightness }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "11 - Dynamic Lighting - Time Controlled - Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_brightness %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set brightness_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set brightness_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% elif current_time < start_time_morning %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% elif current_time > end_time_evening %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "12 - Dynamic Lighting - Time Controlled - Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness_inv' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_max_brightness %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set brightness_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set brightness_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% elif current_time < start_time_morning %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% elif current_time > end_time_evening %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "13 - Dynamic Lighting - Time Controlled - Colour Temp & Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_brightness %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set brightness_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set brightness_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% elif current_time < start_time_morning %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% elif current_time > end_time_evening %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_kelvin": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_colour_temp %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set colour_temp_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set colour_temp_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% elif current_time < start_time_morning %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% elif current_time > end_time_evening %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "sequence": [ { "choose": [ { "alias": "Turn ON lights", "conditions": [ { "alias": "Check the dynamic lighting options", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'disable_dynamic_lighting' }}" }, { "alias": "Check that dynamic lighting is active and the state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "template", "value_template": "{{ states(dynamic_lighting_state_control_entity) == dynamic_lighting_state_control_activation_state_inv }}" } ] } ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities_off }}" }, "data": "{{ light_data }}" } ] } ] }, { "choose": [ { "alias": "Dynamic Lighting State Control Turning OFF", "conditions": [ { "condition": "trigger", "id": "t16" }, { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ light_data }}" }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts == [] %}\n false\n{% elif is_state(night_boolean_scenes_scripts, 'on') %}\n true\n{% else %}\n false\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": "{{ night_boolean_scenes_scripts }}" } }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ "{{ boolean_scenes_scripts != [] }}" ], "sequence": [ { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ boolean_scenes_scripts_helper }}" } } ] } ] } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ scene_entities }}" }, "data": { "transition": "{{ light_transition_on }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ boolean_scenes_scripts_helper }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ scene_entities }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ boolean_scenes_scripts_helper }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ switch_entities_off }}" } }, { "alias": "Turn on the scripts", "action": "script.turn_on", "target": { "entity_id": "{{ script_entities }}" } }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - Turn lights on", "conditions": [ { "condition": "trigger", "id": "t7_on" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Check if the trigger is on and wait for it to go off", "conditions": [ { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" } ], "sequence": [ { "alias": "Wait until motion sensor is off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Wait the number of minutes set in the normal lights time delay", "delay": { "minutes": 5 } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ], "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t0" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t1" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, "{{ include_sun == 'sun_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t2" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, "{{ include_ambient == 'ambient_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t3" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, "{{ include_time == 'time_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t4" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'entity_state_enabled' in night_lights_conditions }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t5" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'time_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t6" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'sun_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t7_on" }, "{{ 'bypass_enabled_turn_on' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t7_off" }, "{{ 'bypass_enabled_turn_off' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t7_stop" }, "{{ 'bypass_enabled_stop' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t8_on" }, "{{ 'bypass_enabled_turn_on' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t8_off" }, "{{ 'bypass_enabled_turn_off' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t8_stop" }, "{{ 'bypass_enabled_stop' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t9" }, "{{ include_sun == 'sun_enabled' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t10" }, "{{ include_ambient == 'ambient_enabled' }}", "{{ ambient_light_options == 'ambient_light_option_disabled' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t11" }, "{{ include_time == 'time_enabled' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t12" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'entity_state_enabled' in night_lights_conditions }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t13" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'time_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t14" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'sun_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t15", "t16" ] }, { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, "{{ dynamic_lighting_state_control == 'enable_state_control' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t17" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t18" }, { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t19" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t19" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t19" }, "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ] }, { "condition": "or", "conditions": [ "{{ include_bypass == [] }}", { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t19" ] } ] }, { "condition": "or", "conditions": [ "{{ include_sun == 'sun_disabled' }}", "{{ include_sun == 'sun_enabled_night_lights' }}", "{{ (include_sun == 'sun_enabled') and (is_state_attr('sun.sun', 'rising', false)) and (state_attr('sun.sun','elevation') <= sun_elevation | float(90)) }}", "{{ (include_sun == 'sun_enabled') and (is_state_attr('sun.sun', 'rising', true)) and (state_attr('sun.sun','elevation') <= sun_elevation_rising | float(90)) }}", { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t9" ] } ] }, { "condition": "or", "conditions": [ "{{ include_ambient == 'ambient_disabled' }}", "{{ ambient_light_sensor == [] }}", "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_value | int)) }}", "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) and ((include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) }}", { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ( ambient_light_options == 'ambient_light_option_enabled' ) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ( ambient_light_options == 'ambient_light_option_enabled' ) }}", { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t10" ] } ] }, { "condition": "or", "conditions": [ "{{ include_time == 'time_disabled' }}", { "condition": "and", "conditions": [ { "condition": "time", "after": "18:00:00", "before": "09:00:00", "weekday": [ "mon", "tue", "wed", "thu", "fri", "sat", "sun" ] }, "{{ include_time == 'time_enabled' }}" ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t11" ] } ] }, { "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_disabled' }}" }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t18" ] } ] }, { "condition": "or", "conditions": [ "{{ include_device_tracker == 'device_tracker_disabled' }}", { "condition": "and", "conditions": [ "{{ include_device_tracker == 'zone_enabled' }}", { "condition": "numeric_state", "entity_id": [], "above": 0 } ] }, { "condition": "and", "conditions": [ "{{ include_device_tracker == 'zone_people_enabled' }}", "{{ (state_attr(zone, 'persons') | list | select('in', people) | list | length) > 0 }}" ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop" ] } ] } ], "id": "1758055141945", "alias": "Beweging Keuken", "description": "" }, "blueprint_inputs": { "id": "1758055141945", "alias": "Beweging Keuken", "description": "", "use_blueprint": { "path": "Blackshome/sensor-light.yaml", "input": { "motion_trigger": [ "binary_sensor.beweging_keuken_bezetting" ], "light_switch": { "entity_id": "light.lamp_keuken_main" }, "include_light_control": [ "use_brightness" ], "light_brightness": 80, "include_sun": "sun_enabled", "night_lights_conditions": [ "time_enabled" ], "include_time": "time_disabled", "after_time": "18:00:00", "before_time": "09:00:00", "night_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_light_control": [ "use_brightness", "use_transition" ], "night_light_brightness": 100, "include_night_light_colour_control": "use_colour_temperature", "night_light_colour_temperature": 2700, "include_night_glow": "night_glow_disabled", "night_glow_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_glow_light_colour_control": "use_colour_temperature", "night_glow_light_colour_temperature": 2000, "include_night_glow_light_control": [ "use_brightness" ], "include_dynamic_lighting": "enable_sun_elevation_colour_brightness", "dynamic_lighting_min_colour_temp": 2500, "include_night_lights": "night_lights_enabled", "dynamic_lighting_max_colour_temp": 4200, "night_lights_after_time": "20:30:00", "dynamic_lighting_max_brightness": 80, "dynamic_lighting_min_brightness": 42, "night_lights_before_time": "06:00:00", "night_light_transition_on": 0, "night_light_transition_off": 10 } } }, "context": { "id": "01KF2X306AXCKQR9V6P3FQ32ND", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "condition/0/conditions/24/conditions/0", "run_id": "7f3bdef3aeb901ed7a30592bab9a268b", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T08:00:00.202753+00:00", "finish": "2026-01-16T08:00:00.208126+00:00" }, "domain": "automation", "item_id": "1758055141945", "trigger": "time" } }, { "extended_dict": { "last_step": "condition/2/conditions/4", "run_id": "86caf6651e8e2a2a3269f8f9956eae03", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T08:47:31.351471+00:00", "finish": "2026-01-16T08:47:31.355997+00:00" }, "domain": "automation", "item_id": "1758055141945", "trigger": "state of binary_sensor.beweging_keuken_bezetting", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-16T08:47:31.355257+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_keuken", "state": "on", "attributes": { "id": "1758055141945", "last_triggered": "2026-01-14T07:15:42.494411+00:00", "mode": "restart", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Keuken [BP]" }, "last_changed": "2026-01-15T08:04:17.790058+00:00", "last_reported": "2026-01-15T08:04:17.790058+00:00", "last_updated": "2026-01-15T08:04:17.790058+00:00", "context": { "id": "01KF0AY4QYBE01ZPZ9TKTK0DH5", "parent_id": null, "user_id": null } }, "trigger": { "id": "t0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_keuken_bezetting", "from_state": { "entity_id": "binary_sensor.beweging_keuken_bezetting", "state": "off", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging keuken Bezetting" }, "last_changed": "2026-01-15T08:04:16.908905+00:00", "last_reported": "2026-01-15T08:04:16.908905+00:00", "last_updated": "2026-01-15T08:04:16.908905+00:00", "context": { "id": "01KF0AY3WC1D4YRGJMDAASKHN2", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_keuken_bezetting", "state": "on", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging keuken Bezetting" }, "last_changed": "2026-01-16T08:47:31.348310+00:00", "last_reported": "2026-01-16T08:47:31.348310+00:00", "last_updated": "2026-01-16T08:47:31.348310+00:00", "context": { "id": "01KF2ZT0GM13A8CX4Y7GRZ60D0", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_keuken_bezetting" }, "motion_trigger": [ "binary_sensor.beweging_keuken_bezetting" ], "light_switch": { "entity_id": "light.lamp_keuken_main" }, "boolean_scenes_scripts": [], "end_scenes": [], "time_delay": 5, "include_light_control": [ "use_brightness" ], "light_brightness": 80, "light_transition_on": 1, "light_transition_off": 1, "include_light_colour_control": "disable_colour_control", "light_colour_temperature": 5000, "light_rgb_colour": [ 255, 255, 255 ], "light_rgbw_colour": [ 255, 255, 255, 255 ], "light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_dynamic_lighting": "enable_sun_elevation_colour_brightness", "dynamic_lighting_lux_sensor": [], "dynamic_lighting_max_lux": 400, "dynamic_lighting_min_lux": 40, "dynamic_lighting_max_brightness": 80, "dynamic_lighting_min_brightness": 42, "dynamic_lighting_boolean": [], "dynamic_lighting_max_colour_temp": 4200, "dynamic_lighting_min_colour_temp": 2500, "dynamic_lighting_sun_elevation_start_rising": -1.5, "dynamic_lighting_sun_elevation_end_rising": 15, "dynamic_lighting_sun_elevation_start_falling": 15, "dynamic_lighting_sun_elevation_end_falling": -4.0, "dynamic_lighting_time_start_morning": "06:00:00", "dynamic_lighting_time_end_morning": "09:00:00", "dynamic_lighting_time_start_evening": "17:00:00", "dynamic_lighting_time_end_evening": "19:00:00", "dynamic_lighting_heartbeat": 1, "dynamic_lighting_step_value": 4, "dynamic_lighting_dead_zone": 7, "dynamic_lighting_state_control": "disable_state_control", "dynamic_lighting_state_control_activation_state": "on", "dynamic_lighting_state_control_entity": [], "include_bypass": [], "motion_bypass_lights_on": [], "motion_bypass_lights_off": [], "motion_bypass_lights_stop": [], "bypass_time_delay": 0, "include_bypass_auto_off": [], "bypass_auto_off_delay": 60, "include_sun": "sun_enabled", "sun_elevation": -1.5, "sun_elevation_rising": -4.0, "include_ambient": "ambient_disabled", "ambient_light_sensor": [], "ambient_light_options": "ambient_light_option_disabled", "ambient_light_value": 20, "ambient_light_high_value": 80, "include_time": "time_disabled", "after_time": "18:00:00", "before_time": "09:00:00", "weekday_options": [ "mon", "tue", "wed", "thu", "fri", "sat", "sun" ], "include_state_control": "state_control_disabled", "state_control_activation_state": "off", "state_control_entity": [], "include_device_tracker": "device_tracker_disabled", "zone": [], "people": [], "include_night_lights": "night_lights_enabled", "night_lights_conditions": [ "time_enabled" ], "night_lights_entity_state": [], "night_lights_after_time": "20:30:00", "night_lights_before_time": "06:00:00", "night_lights_sun_elevation": -1.5, "night_lights_sun_elevation_rising": -4.0, "night_lights": { "entity_id": "light.lamp_keuken_kleur" }, "night_boolean_scenes_scripts": [], "night_time_delay": 5, "include_night_light_control": [ "use_brightness", "use_transition" ], "night_light_brightness": 100, "night_light_transition_on": 0, "night_light_transition_off": 10, "include_night_light_colour_control": "use_colour_temperature", "night_light_colour_temperature": 2700, "night_light_rgb_colour": [ 255, 255, 255 ], "night_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_night_glow": "night_glow_disabled", "night_glow_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_glow_light_control": [ "use_brightness" ], "night_glow_light_brightness": 20, "night_glow_light_transition_on": 1, "night_glow_light_transition_off": 1, "include_night_glow_light_colour_control": "use_colour_temperature", "night_glow_light_colour_temperature": 2000, "night_glow_light_rgb_colour": [ 255, 255, 255 ], "night_glow_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_glow_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "light_entities_off": [ "light.lamp_keuken_main" ], "switch_entities_off": [], "light_data": { "brightness_pct": 80 }, "light_entities": [ "light.lamp_keuken_main" ], "switch_entities": [], "scene_entities": [], "script_entities": [], "boolean_scenes_scripts_helper": [], "end_scene_entities": [], "end_script_entities": [], "night_light_entities_off": [ "light.lamp_keuken_kleur" ], "night_switch_entities_off": [], "night_light_data": { "transition": 0, "brightness_pct": 100, "color_temp_kelvin": 2700 }, "night_light_entities": [ "light.lamp_keuken_kleur" ], "night_switch_entities": [], "night_scene_entities": [], "night_script_entities": [], "night_boolean_scenes_scripts_helper": [], "night_glow_light_data": { "brightness_pct": 20, "color_temp_kelvin": 2000 }, "night_glow_light_entities": [ "light.lamp_keuken_kleur" ], "night_glow_switch_entities": [], "night_glow_scene_entities": [], "night_glow_script_entities": [], "crossover_night_glow_to_night_lights_light": [], "crossover_night_glow_to_night_lights_switch": [], "crossover_night_lights_to_night_glow_light": [], "crossover_night_lights_to_night_glow_switch": [], "crossover_lights_to_night_glow_light": [ "light.lamp_keuken_main" ], "crossover_lights_to_night_glow_switch": [], "crossover_lights_light": [], "crossover_lights_switch": [], "crossover_night_lights_light_on": [], "crossover_night_lights_light": [], "crossover_night_lights_switch": [], "crossover_lights_light_on": [], "dynamic_lighting_state_control_activation_state_inv": "off" } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-16T08:47:31.355290+00:00", "result": { "result": true } } ], "condition/0/conditions/0": [ { "path": "condition/0/conditions/0", "timestamp": "2026-01-16T08:47:31.355316+00:00", "result": { "result": true } } ], "condition/0/conditions/0/conditions/0": [ { "path": "condition/0/conditions/0/conditions/0", "timestamp": "2026-01-16T08:47:31.355336+00:00", "result": { "result": true } } ], "condition/0/conditions/0/conditions/1": [ { "path": "condition/0/conditions/0/conditions/1", "timestamp": "2026-01-16T08:47:31.355361+00:00", "result": { "result": true } } ], "condition/0/conditions/0/conditions/1/entity_id/0": [ { "path": "condition/0/conditions/0/conditions/1/entity_id/0", "timestamp": "2026-01-16T08:47:31.355380+00:00", "result": { "result": true, "state": "on", "wanted_state": "on" } } ], "condition/1": [ { "path": "condition/1", "timestamp": "2026-01-16T08:47:31.355414+00:00", "result": { "result": true } } ], "condition/1/conditions/0": [ { "path": "condition/1/conditions/0", "timestamp": "2026-01-16T08:47:31.355431+00:00", "result": { "result": true, "entities": [] } } ], "condition/2": [ { "path": "condition/2", "timestamp": "2026-01-16T08:47:31.355538+00:00", "result": { "result": false } } ], "condition/2/conditions/0": [ { "path": "condition/2/conditions/0", "timestamp": "2026-01-16T08:47:31.355557+00:00", "result": { "result": false, "entities": [] } } ], "condition/2/conditions/1": [ { "path": "condition/2/conditions/1", "timestamp": "2026-01-16T08:47:31.355688+00:00", "result": { "result": false, "entities": [] } } ], "condition/2/conditions/2": [ { "path": "condition/2/conditions/2", "timestamp": "2026-01-16T08:47:31.355768+00:00", "result": { "result": false, "entities": [ "sun.sun" ] } } ], "condition/2/conditions/3": [ { "path": "condition/2/conditions/3", "timestamp": "2026-01-16T08:47:31.355873+00:00", "result": { "result": false, "entities": [ "sun.sun" ] } } ], "condition/2/conditions/4": [ { "path": "condition/2/conditions/4", "timestamp": "2026-01-16T08:47:31.355969+00:00", "result": { "result": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "motion_trigger": [ "binary_sensor.beweging_keuken_bezetting" ], "light_switch": { "entity_id": "light.lamp_keuken_main" }, "boolean_scenes_scripts": [], "end_scenes": [], "time_delay": 5, "include_light_control": [ "use_brightness" ], "light_brightness": 80, "light_transition_on": 1, "light_transition_off": 1, "include_light_colour_control": "disable_colour_control", "light_colour_temperature": 5000, "light_rgb_colour": [ 255, 255, 255 ], "light_rgbw_colour": [ 255, 255, 255, 255 ], "light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_dynamic_lighting": "enable_sun_elevation_colour_brightness", "dynamic_lighting_lux_sensor": [], "dynamic_lighting_max_lux": 400, "dynamic_lighting_min_lux": 40, "dynamic_lighting_max_brightness": 80, "dynamic_lighting_min_brightness": 42, "dynamic_lighting_boolean": [], "dynamic_lighting_max_colour_temp": 4200, "dynamic_lighting_min_colour_temp": 2500, "dynamic_lighting_sun_elevation_start_rising": -1.5, "dynamic_lighting_sun_elevation_end_rising": 15, "dynamic_lighting_sun_elevation_start_falling": 15, "dynamic_lighting_sun_elevation_end_falling": -4.0, "dynamic_lighting_time_start_morning": "06:00:00", "dynamic_lighting_time_end_morning": "09:00:00", "dynamic_lighting_time_start_evening": "17:00:00", "dynamic_lighting_time_end_evening": "19:00:00", "dynamic_lighting_heartbeat": 1, "dynamic_lighting_step_value": 4, "dynamic_lighting_dead_zone": 7, "dynamic_lighting_state_control": "disable_state_control", "dynamic_lighting_state_control_activation_state": "on", "dynamic_lighting_state_control_entity": [], "include_bypass": [], "motion_bypass_lights_on": [], "motion_bypass_lights_off": [], "motion_bypass_lights_stop": [], "bypass_time_delay": 0, "include_bypass_auto_off": [], "bypass_auto_off_delay": 60, "include_sun": "sun_enabled", "sun_elevation": -1.5, "sun_elevation_rising": -4.0, "include_ambient": "ambient_disabled", "ambient_light_sensor": [], "ambient_light_options": "ambient_light_option_disabled", "ambient_light_value": 20, "ambient_light_high_value": 80, "include_time": "time_disabled", "after_time": "18:00:00", "before_time": "09:00:00", "weekday_options": [ "mon", "tue", "wed", "thu", "fri", "sat", "sun" ], "include_state_control": "state_control_disabled", "state_control_activation_state": "off", "state_control_entity": [], "include_device_tracker": "device_tracker_disabled", "zone": [], "people": [], "include_night_lights": "night_lights_enabled", "night_lights_conditions": [ "time_enabled" ], "night_lights_entity_state": [], "night_lights_after_time": "20:30:00", "night_lights_before_time": "06:00:00", "night_lights_sun_elevation": -1.5, "night_lights_sun_elevation_rising": -4.0, "night_lights": { "entity_id": "light.lamp_keuken_kleur" }, "night_boolean_scenes_scripts": [], "night_time_delay": 5, "include_night_light_control": [ "use_brightness", "use_transition" ], "night_light_brightness": 100, "night_light_transition_on": 0, "night_light_transition_off": 10, "include_night_light_colour_control": "use_colour_temperature", "night_light_colour_temperature": 2700, "night_light_rgb_colour": [ 255, 255, 255 ], "night_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "include_night_glow": "night_glow_disabled", "night_glow_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_glow_light_control": [ "use_brightness" ], "night_glow_light_brightness": 20, "night_glow_light_transition_on": 1, "night_glow_light_transition_off": 1, "include_night_glow_light_colour_control": "use_colour_temperature", "night_glow_light_colour_temperature": 2000, "night_glow_light_rgb_colour": [ 255, 255, 255 ], "night_glow_light_rgbw_colour": [ 255, 255, 255, 255 ], "night_glow_light_rgbww_colour": [ 255, 255, 255, 255, 255 ], "light_entities_off": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'light')\n | selectattr('state', 'eq', 'off')\n | map(attribute='entity_id')\n | list }}\n", "switch_entities_off": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'switch')\n | selectattr('state', 'eq', 'off')\n | map(attribute='entity_id')| list }}\n", "light_data": "{% set light = namespace(data={}) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': light_brightness }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}", "light_entities": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'light')\n | map(attribute='entity_id')\n | list }}\n", "switch_entities": "{{ expand(light_switch.entity_id)\n | selectattr('domain', 'eq', 'switch')\n | map(attribute='entity_id')\n | list }}\n", "scene_entities": "{% set a = light_switch.entity_id %} {% if boolean_scenes_scripts == [] %}\n {{ expand(a) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% elif is_state(boolean_scenes_scripts, 'off') %}\n {{ expand(a) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "script_entities": "{% set a = light_switch.entity_id %} {% if boolean_scenes_scripts == [] %}\n {{ expand(a) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% elif is_state(boolean_scenes_scripts, 'off') %}\n {{ expand(a) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "boolean_scenes_scripts_helper": "{% if boolean_scenes_scripts | length > 0 and states(boolean_scenes_scripts) == 'off' %}\n {{ boolean_scenes_scripts }}\n{% else %}\n []\n{% endif %}", "end_scene_entities": "{{ end_scenes | select('match', '^scene\\..*') | list }}", "end_script_entities": "{{ end_scenes | select('match', '^script\\..*') | list }}", "night_light_entities_off": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'off') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_switch_entities_off": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'switch') | selectattr('state', 'eq', 'off') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_light_data": "{% set light = namespace(data={}) %} {% if 'use_transition' in include_night_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': night_light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_night_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': night_light_brightness }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': night_light_colour_temperature }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': night_light_rgb_colour }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': night_light_rgbw_colour }) %}\n{% endif %} {% if include_night_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': night_light_rgbww_colour }) %}\n{% endif %} {{ light.data }}", "night_light_entities": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_switch_entities": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_scene_entities": "{% set b = night_lights and night_lights.entity_id %} {% if night_boolean_scenes_scripts == [] %}\n {{ expand(b) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% elif is_state(night_boolean_scenes_scripts, 'off') %}\n {{ expand(b) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_script_entities": "{% set b = night_lights and night_lights.entity_id %} {% if night_boolean_scenes_scripts == [] %}\n {{ expand(b) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% elif is_state(night_boolean_scenes_scripts, 'off') %}\n {{ expand(b) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_boolean_scenes_scripts_helper": "{% if night_boolean_scenes_scripts | length > 0 and states(night_boolean_scenes_scripts) == 'off' %}\n {{ night_boolean_scenes_scripts }}\n{% else %}\n []\n{% endif %}", "night_glow_light_data": "{% set light = namespace(data={}) %} {% if 'use_transition' in include_night_glow_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': night_glow_light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_night_glow_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': night_glow_light_brightness }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': night_glow_light_colour_temperature }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': night_glow_light_rgb_colour }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': night_glow_light_rgbw_colour }) %}\n{% endif %} {% if include_night_glow_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': night_glow_light_rgbww_colour }) %}\n{% endif %} {{ light.data }}", "night_glow_light_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_glow_switch_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_glow_scene_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'scene') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "night_glow_script_entities": "{% set b = night_glow_lights and night_glow_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'script') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_glow_to_night_lights_light": "{% set a = night_lights and night_lights.entity_id %} {% set b = night_glow_lights and night_glow_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_glow_to_night_lights_switch": "{% set a = night_lights and night_lights.entity_id %} {% set b = night_glow_lights and night_glow_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_to_night_glow_light": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_to_night_glow_switch": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_to_night_glow_light": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = light_switch.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_to_night_glow_switch": "{% set a = night_glow_lights and night_glow_lights.entity_id %} {% set b = light_switch.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_light": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(a) | reject('in', expand(b)) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_switch": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(a) | reject('in', expand(b)) | selectattr('domain', 'eq', 'switch') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_light_on": "{% set b = night_lights and night_lights.entity_id %} {% if b %}\n {{ expand(b) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_light": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_night_lights_switch": "{% set a = light_switch.entity_id %} {% set b = night_lights and night_lights.entity_id %} {% if a and b %}\n {{ expand(b) | reject('in', expand(a)) | selectattr('domain', 'eq', 'switch') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "crossover_lights_light_on": "{% set a = light_switch.entity_id %} {% if a %}\n {{ expand(a) | selectattr('domain', 'eq', 'light') | selectattr('state', 'eq', 'on') | map(attribute='entity_id') | list }}\n{% else %}\n []\n{% endif %}", "dynamic_lighting_state_control_activation_state_inv": "{% if dynamic_lighting_state_control_activation_state == 'on' %}\n off\n{% else %}\n on\n{% endif %}\n" }, "triggers": [ { "trigger": "state", "id": "t0", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "from": "off", "to": "on" }, { "trigger": "numeric_state", "id": "t1", "entity_id": "sun.sun", "attribute": "elevation", "below": -1.5 }, { "trigger": "numeric_state", "id": "t2", "entity_id": [], "below": 20 }, { "trigger": "time", "id": "t3", "at": "18:00:00" }, { "trigger": "state", "id": "t4", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "time", "id": "t5", "at": "20:30:00" }, { "trigger": "numeric_state", "id": "t6", "entity_id": "sun.sun", "attribute": "elevation", "below": -1.5 }, { "trigger": "state", "id": "t7_on", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t7_off", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t7_stop", "entity_id": [], "from": "off", "to": "on" }, { "trigger": "state", "id": "t8_on", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "state", "id": "t8_off", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "state", "id": "t8_stop", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "numeric_state", "id": "t9", "entity_id": "sun.sun", "attribute": "elevation", "above": -4.0 }, { "trigger": "numeric_state", "id": "t10", "entity_id": [], "above": 80 }, { "trigger": "time", "id": "t11", "at": "09:00:00" }, { "trigger": "state", "id": "t12", "entity_id": [], "from": "on", "to": "off" }, { "trigger": "time", "id": "t13", "at": "06:00:00" }, { "trigger": "numeric_state", "id": "t14", "entity_id": "sun.sun", "attribute": "elevation", "above": -4.0 }, { "trigger": "state", "id": "t15", "entity_id": [], "to": "on" }, { "trigger": "state", "id": "t16", "entity_id": [], "from": "on" }, { "trigger": "state", "id": "t17", "entity_id": [], "to": "off" }, { "trigger": "state", "id": "t18", "entity_id": [], "from": "off" }, { "trigger": "homeassistant", "id": "t19", "event": "start" } ], "actions": [ { "choose": [ { "alias": "Check if night lights are enabled and within conditions", "conditions": [ { "condition": "and", "conditions": [ { "alias": "Check if night lights is enabled", "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_enabled' }}" }, { "alias": "Check if night lights entity state is enabled", "condition": "or", "conditions": [ "{{ ('time_enabled' in night_lights_conditions) and not ('entity_state_enabled' in night_lights_conditions) }}", "{{ ('sun_enabled' in night_lights_conditions) and not ('entity_state_enabled' in night_lights_conditions) }}", { "condition": "and", "conditions": [ "{{ 'entity_state_enabled' in night_lights_conditions }}", { "condition": "state", "entity_id": [], "state": "on", "match": "any" } ] } ] }, { "alias": "Check if night lights time is enabled", "condition": "or", "conditions": [ "{{ ('entity_state_enabled' in night_lights_conditions) and not ('time_enabled' in night_lights_conditions) }}", "{{ ('sun_enabled' in night_lights_conditions) and not ('time_enabled' in night_lights_conditions) }}", { "condition": "and", "conditions": [ "{{ 'time_enabled' in night_lights_conditions }}", { "condition": "time", "after": "20:30:00", "before": "06:00:00" } ] } ] }, { "alias": "Check if night lights sun is enabled", "condition": "or", "conditions": [ "{{ ('entity_state_enabled' in night_lights_conditions) and not ('sun_enabled' in night_lights_conditions) }}", "{{ ('time_enabled' in night_lights_conditions) and not ('sun_enabled' in night_lights_conditions) }}", "{{ ('sun_enabled' in night_lights_conditions) and (((is_state_attr('sun.sun', 'rising', false)) and (state_attr('sun.sun','elevation') <= night_lights_sun_elevation | float(90))) or ((is_state_attr('sun.sun', 'rising', true)) and (state_attr('sun.sun','elevation') <= night_lights_sun_elevation_rising | float(90)))) }}" ] } ] } ], "sequence": [ { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "By-pass is turned on & check by-pass option - Turn lights off", "conditions": [ { "condition": "trigger", "id": "t7_off" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] }, { "alias": "By-pass is turned on & check by-pass option - Keep the current lights state", "conditions": [ { "condition": "trigger", "id": "t7_stop" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & check if the motion trigger is off", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "all", "state": "off" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If night glow is disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] }, { "alias": "If night glow is enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn on the lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": "{{ night_glow_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn OFF crossover lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_to_night_glow_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" } }, { "alias": "Turn OFF crossover lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_to_night_glow_light }}" } } ] } ] }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_on }}" } }, { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}", "transition": "{{ night_glow_light_transition_on }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } }, { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn OFF crossover night switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_switch }}" } }, { "alias": "Turn OFF crossover light switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_to_night_glow_switch }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ night_glow_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Motion trigger is off and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "By-pass is turned off & check if the motion trigger is on", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] }, { "condition": "or", "conditions": [ "{{ (include_sun == 'sun_enabled') and (state_attr('sun.sun','elevation') >= sun_elevation | float(90)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_disabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (is_state(night_boolean_scenes_scripts, 'off')) }}", { "condition": "and", "conditions": [ "{{ include_time == 'time_enabled' }}", { "condition": "time", "after": "09:00:00", "before": "18:00:00" } ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "template", "value_template": "{% set opposite = 'off' if state_control_activation_state == 'on' else 'on' %} {{ is_state(state_control_entity, opposite) }}" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] }, { "alias": "Motion trigger is on and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned off & reset lights to the site conditions", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "choose": [ { "alias": "Check if normal lights Scenes & Scripts - Toggle Helper is on", "conditions": [ { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean normal lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ crossover_night_lights_light_on }}" }, "data": "{{ night_light_data }}" } ] } ] } ] } ] }, { "choose": [ { "alias": "Sun, ambient, time & state control above setting to turn off", "conditions": [ { "condition": "trigger", "id": [ "t9", "t10", "t11", "t18" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "stop": "Stop the automation" } ] }, { "alias": "Turn off normal lights when trigger by start night lights conditions", "conditions": [ { "condition": "trigger", "id": [ "t4", "t5", "t6" ] } ], "sequence": [ { "choose": [ { "alias": "light - switch - scene - script is ON", "conditions": [ { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_lights_light }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_lights_switch }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "choose": [ { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the input boolean normal lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ crossover_night_lights_light_on }}" }, "data": "{{ night_light_data }}" } ] } ] } ] }, { "alias": "Turn on night glow lights if all lights are off", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" }, { "condition": "template", "value_template": "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (is_state(boolean_scenes_scripts, 'off')) }}\n" } ], "sequence": [ { "alias": "Turn on the lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": "{{ night_glow_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}", "transition": "{{ night_glow_light_transition_on }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ night_glow_script_entities }}" } }, { "stop": "Stop the automation" } ] }, { "alias": "If manage scripts is enabled", "conditions": [ "{{ 'manage_scripts_crossing_over' in include_night_light_control }}", "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (is_state(boolean_scenes_scripts, 'off')) }}" ], "sequence": [ { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Safe Guard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t19" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Small time delay required", "delay": { "seconds": 1 } } ] }, { "alias": "Check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass auto off is enabled and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "choose": [ { "alias": "If night glow is disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_disabled' }}" } ], "sequence": [ { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_light_entities_off }}" }, "data": "{{ night_light_data }}" }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ { "condition": "template", "value_template": "{% if boolean_scenes_scripts == [] %}\n false\n{% elif is_state(boolean_scenes_scripts, 'on') %}\n true\n{% else %}\n false\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": "{{ boolean_scenes_scripts }}" } }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ "{{ night_boolean_scenes_scripts != [] }}" ], "sequence": [ { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" }, "data": { "transition": "{{ night_light_transition_on }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] }, { "alias": "Turn on the night switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_switch_entities_off }}" } }, { "alias": "Turn on the night scripts", "action": "script.turn_on", "target": { "entity_id": "{{ night_script_entities }}" } } ] }, { "alias": "If night glow is enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" }, { "condition": "not", "conditions": [ { "condition": "trigger", "id": [ "t15", "t16" ] } ] } ], "sequence": [ { "alias": "Turn ON lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_light_entities }}" }, "data": "{{ night_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night glow lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night glow lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ { "condition": "template", "value_template": "{% if boolean_scenes_scripts == [] %}\n false\n{% elif is_state(boolean_scenes_scripts, 'on') %}\n true\n{% else %}\n false\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": "{{ boolean_scenes_scripts }}" } }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ "{{ night_boolean_scenes_scripts != [] }}" ], "sequence": [ { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" }, "data": { "transition": "{{ night_light_transition_on }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the night scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ night_scene_entities }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ night_boolean_scenes_scripts_helper }}" } } ] } ] }, { "alias": "Turn on the night switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off crossover night glow switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } }, { "alias": "Turn on the night scripts", "action": "script.turn_on", "target": { "entity_id": "{{ night_script_entities }}" } } ] } ] }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - Turn lights on", "conditions": [ { "condition": "trigger", "id": "t7_on" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Check if the trigger is on and wait for it to go off", "conditions": [ { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" } ], "sequence": [ { "alias": "Wait until motion sensor is off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Wait the number of minutes set in the night lights time delay", "delay": { "minutes": 5 } }, { "choose": [ { "alias": "If night glow is disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] }, { "alias": "If night glow is enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn on the lights", "action": "light.turn_on", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": "{{ night_glow_light_data }}" }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn OFF crossover night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_light }}" } } ] } ] }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}", "transition": "{{ night_glow_light_transition_on }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ night_glow_scene_entities }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn OFF crossover night switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_to_night_glow_switch }}" } }, { "alias": "Turn on the script", "action": "script.turn_on", "data": { "entity_id": "{{ night_glow_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ], "default": [ { "choose": [ { "alias": "By-pass is turned on & check by-pass option - Turn lights off", "conditions": [ { "condition": "trigger", "id": "t7_off" } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If night lights are disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] }, { "alias": "If night lights are enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] } ] }, { "alias": "By-pass is turned on & check by-pass option - Keep the current lights state", "conditions": [ { "condition": "trigger", "id": "t7_stop" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "By-pass is turned off & check if the motion trigger is off", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "all", "state": "off" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If night lights are disabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_disabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "If night lights are enabled", "conditions": [ { "condition": "template", "value_template": "{{ include_night_lights == 'night_lights_enabled' }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the night lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ light_transition_off }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Motion trigger is off and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "By-pass is turned off & check if the motion trigger is on", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] }, { "condition": "or", "conditions": [ "{{ (include_sun == 'sun_enabled') and (state_attr('sun.sun','elevation') >= sun_elevation | float(90)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_disabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((states(ambient_light_sensor) | int) > (ambient_light_value | int)) and (is_state(boolean_scenes_scripts, 'off')) }}", { "condition": "and", "conditions": [ { "condition": "time", "after": "09:00:00", "before": "18:00:00" }, "{{ include_time == 'time_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "template", "value_template": "{% set opposite = 'off' if state_control_activation_state == 'on' else 'on' %} {{ is_state(state_control_entity, opposite) }}" } ] } ] } ], "sequence": [ { "alias": "Wait the number of minutes set in the by-pass time delay", "delay": { "minutes": 0 } }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Motion trigger is on and check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "By-pass is turned off & reset lights to the site conditions", "conditions": [ { "condition": "trigger", "id": [ "t8_on", "t8_off", "t8_stop" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" }, "data": { "transition": "{{ night_glow_light_transition_off }}" } } ] } ] } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_light }}" } } ] } ] } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "choose": [ { "alias": "If night glow is selected", "conditions": [ { "condition": "template", "value_template": "{{ include_night_glow == 'night_glow_enabled' }}" } ], "sequence": [ { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_glow_to_night_lights_switch }}" } } ] } ] }, { "choose": [ { "alias": "Check if night lights scenes & scripts - toggle helper is on", "conditions": [ { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "Turn ON lights", "conditions": [ { "alias": "Check the dynamic lighting options", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'disable_dynamic_lighting' }}" }, { "alias": "Check that dynamic lighting is active and the state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "template", "value_template": "{{ states(dynamic_lighting_state_control_entity) == dynamic_lighting_state_control_activation_state_inv }}" } ] } ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ crossover_lights_light_on }}" }, "data": "{{ light_data }}" }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ] } ] } ] } ] } ] }, { "choose": [ { "alias": "Sun, ambient, time & state control above setting to turn off", "conditions": [ { "condition": "trigger", "id": [ "t9", "t10", "t11", "t18" ] } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "alias": "Turn off night lights when trigger by end night lights conditions", "conditions": [ { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "choose": [ { "alias": "If the night glow is enabled", "conditions": [ "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "off", "for": { "minutes": 5 } } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_glow_light_entities }}" }, "data": { "transition": "{{ night_glow_light_transition_off}}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_glow_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_glow_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ night_glow_light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ night_glow_switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "stop": "Stop the automation" } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) or (is_state(night_boolean_scenes_scripts, 'on')) }}\n" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" }, "data": { "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ crossover_night_lights_light }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ crossover_night_lights_switch }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "choose": [ { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" } ], "sequence": [ { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ night_light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_night_light_control }}" } ], "sequence": [ { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the input boolean night lights", "action": "input_boolean.turn_off", "data": { "entity_id": [] } }, { "choose": [ { "alias": "Turn ON lights", "conditions": [ { "alias": "Check the dynamic lighting options", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'disable_dynamic_lighting' }}" }, { "alias": "Check that dynamic lighting is active and the state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "template", "value_template": "{{ states(dynamic_lighting_state_control_entity) == dynamic_lighting_state_control_activation_state_inv }}" } ] } ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ crossover_lights_light_on }}" }, "data": "{{ light_data }}" } ] } ] } ] } ] } ] }, { "alias": "If manage scripts is enabled", "conditions": [ "{{ 'manage_scripts_crossing_over' in include_night_light_control }}", "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (expand(night_lights.entity_id) | selectattr('state', '==', 'off') | list | count > 0) or (is_state(night_boolean_scenes_scripts, 'off')) }}" ], "sequence": [ { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "stop": "Stop the automation" } ] } ] } ] }, { "alias": "Safe Guard when HA restarts", "conditions": [ { "condition": "trigger", "id": "t19" } ], "sequence": [ { "choose": [ { "alias": "Check all by-pass are off and check conditions if enabled", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] } ] } ], "sequence": [ { "alias": "Small time delay required", "delay": { "seconds": 1 } } ] }, { "alias": "Check if any by-passes are on", "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ], "sequence": [ { "alias": "Check by-pass auto off is enabled and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ] } ] } ] } ] }, { "alias": "Parallel actions for dynamic lighting and normal lights", "parallel": [ { "sequence": [ { "alias": "Check if the dynamic lighting is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "alias": "Check the dynamic lighting state control option", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'disable_state_control' }}" }, { "alias": "Check if the dynamic lighting state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "state", "entity_id": [], "state": "on" } ] } ] } ] }, { "choose": [ { "alias": "Dynamic Lighting - Input Boolean Helper", "conditions": [ { "condition": "template", "value_template": "{{ dynamic_lighting_boolean != [] }}" } ], "sequence": [ { "alias": "Turn on the boolean for dynamic lighting", "action": "input_boolean.turn_on", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "1 - Dynamic Lighting - Lux Controlled Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness'}}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n false\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "2 - Dynamic Lighting - Lux Controlled Brightness - Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness_inv'}}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting brightness inverted for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_lux_controled_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "3 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': light_brightness }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if elevation >= (dynamic_lighting_sun_elevation_start_rising - 2) and elevation <= (dynamic_lighting_sun_elevation_end_rising + 2) and is_state_attr('sun.sun', 'rising', true) %}\n false\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_falling + 2) and elevation >= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n false\n {% elif elevation >= (dynamic_lighting_sun_elevation_end_rising + 2) and elevation >= (dynamic_lighting_sun_elevation_start_falling - 2) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_rising - 2) and is_state_attr('sun.sun', 'rising', true) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n true\n {% else %}\n true\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If sun elevation is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "4 - Dynamic Lighting - Sun Elevation Lighting - Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "5 - Dynamic Lighting - Sun Elevation Lighting - Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness_inv' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness inverted for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "6 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_brightness %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "7 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness_inv' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_brightness_pct": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_max_brightness %} {% if elevation > -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n {% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n {% endif %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if (brightness_value >= (lp * 0.99) and brightness_value <= (lp * 1.01)) %}\n true\n {% else %}\n false\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If lights are ON and the lights are within 1% of the actual brightness", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set dynamic sun elevation lighting brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "8 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Lux Controlled Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" } ], "sequence": [ { "alias": "Parallel actions for dynamic lighting", "parallel": [ { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_kelvin": "{% if expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 %}\n {% set elevation = state_attr('sun.sun', 'elevation') | float %}\n {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %}\n {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %}\n {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %}\n {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %}\n {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% endif %}\n {{ colour_temp_value | round(0) }}\n{% endif %}\n", "dynamic_light_off_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_max_lux - dynamic_lighting_min_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_max_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n false\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Check if the light is off", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Delay for parallel actions needed for when the light is off", "delay": { "milliseconds": 100 } } ] } ] }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" }, "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}" ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_off_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] }, { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if elevation >= (dynamic_lighting_sun_elevation_start_rising - 2) and elevation <= (dynamic_lighting_sun_elevation_end_rising + 2) and is_state_attr('sun.sun', 'rising', true) %}\n false\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_falling + 2) and elevation >= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n false\n {% elif elevation >= (dynamic_lighting_sun_elevation_end_rising + 2) and elevation >= (dynamic_lighting_sun_elevation_start_falling - 2) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_rising - 2) and is_state_attr('sun.sun', 'rising', true) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n true\n {% else %}\n true\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If sun elevation is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If the lights are OFF", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] } ] } ] }, { "choose": [ { "alias": "9 - Dynamic Lighting - Sun Elevation Lighting - Colour Temp + Lux Controlled Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" } ], "sequence": [ { "alias": "Parallel actions for dynamic lighting", "parallel": [ { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if lp <= 0 %}\n {% set bv = bv %}\n{% elif (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif (bv > lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif (lp > bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n {% set bv = lp %}\n{% elif bv > (lp + dynamic_lighting_step_value) %}\n {% set bv = lp + dynamic_lighting_step_value %}\n{% elif bv < (lp - dynamic_lighting_step_value) %}\n {% set bv = lp - dynamic_lighting_step_value %}\n{% endif %} {{ bv | round(0) }}\n", "dynamic_kelvin": "{% if expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 %}\n {% set elevation = state_attr('sun.sun', 'elevation') | float %}\n {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %}\n {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %}\n {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %}\n {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %}\n {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% endif %}\n {{ colour_temp_value | round(0) }}\n{% endif %}\n", "dynamic_light_off_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "in_dead_zone": "{% set lux = states(dynamic_lighting_lux_sensor) | float %} {% set slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (dynamic_lighting_min_lux - dynamic_lighting_max_lux) %} {% set ak = (( slope * dynamic_lighting_min_lux) * -1) + dynamic_lighting_min_brightness %} {% set le = light_entities %} {% set lec = expand(le) | map(attribute='entity_id') | list | length %} {% set lp = (expand(le) | map(attribute='attributes.brightness') | reject('equalto', None) | sum | float(default=255) / 255 * 100 / lec) | round(0) %} {% if lux <= dynamic_lighting_min_lux %}\n {% set bv = dynamic_lighting_min_brightness %}\n{% elif lux >= dynamic_lighting_max_lux %}\n {% set bv = dynamic_lighting_max_brightness %}\n{% else %}\n {% set bv = ((slope * lux) + ak) | round(1) %}\n{% endif %} {% if (bv > lp) and (dynamic_lighting_max_brightness - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp > bv) and (lp - dynamic_lighting_min_brightness) <= dynamic_lighting_dead_zone %}\n false\n{% elif (bv >= lp) and (bv - lp) <= dynamic_lighting_dead_zone %}\n true\n{% elif (lp >= bv) and (lp - bv) <= dynamic_lighting_dead_zone %}\n true\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Check if the light is off", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Delay for parallel actions needed for when the light is off", "delay": { "milliseconds": 100 } } ] } ] }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "alias": "Delay for parallel actions needed for when the light is on", "delay": { "milliseconds": 100 } }, { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If dynamic lighting brightness is in the dead zone", "conditions": [ { "condition": "template", "value_template": "{{ in_dead_zone }}" }, { "condition": "template", "value_template": "{{ repeat.index != 1 }}" } ], "sequence": [ { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness and dynamic sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" }, "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}" ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_off_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Set dynamic lighting lux brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] }, { "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_start_rising - dynamic_lighting_sun_elevation_end_rising) %} {% set start_ak = (( start_slope * dynamic_lighting_sun_elevation_end_rising) * -1) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (dynamic_lighting_sun_elevation_end_falling - dynamic_lighting_sun_elevation_start_falling) %} {% set end_ak = (( end_slope * dynamic_lighting_sun_elevation_end_falling) * -1) + dynamic_lighting_min_colour_temp %} {% if elevation >= -10 %}\n {% if elevation >= dynamic_lighting_sun_elevation_start_rising and elevation <= dynamic_lighting_sun_elevation_end_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = ((start_slope * elevation) + start_ak) | round(1) %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_falling and elevation >= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = ((end_slope * elevation) + end_ak) | round(1) %}\n {% elif elevation >= dynamic_lighting_sun_elevation_end_rising and elevation >= dynamic_lighting_sun_elevation_start_falling %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_start_rising and is_state_attr('sun.sun', 'rising', true) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% elif elevation <= dynamic_lighting_sun_elevation_end_falling and is_state_attr('sun.sun', 'rising', false) %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n {% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n {% endif %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set elevation = state_attr('sun.sun', 'elevation') | float %} {% if expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %}\n {% if elevation >= (dynamic_lighting_sun_elevation_start_rising - 2) and elevation <= (dynamic_lighting_sun_elevation_end_rising + 2) and is_state_attr('sun.sun', 'rising', true) %}\n false\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_falling + 2) and elevation >= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n false\n {% elif elevation >= (dynamic_lighting_sun_elevation_end_rising + 2) and elevation >= (dynamic_lighting_sun_elevation_start_falling - 2) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_start_rising - 2) and is_state_attr('sun.sun', 'rising', true) %}\n true\n {% elif elevation <= (dynamic_lighting_sun_elevation_end_falling - 2) and is_state_attr('sun.sun', 'rising', false) %}\n true\n {% else %}\n true\n {% endif %}\n{% else %}\n false\n{% endif %}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If sun elevation is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "If the lights are OFF", "conditions": "{{ expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0 }}", "sequence": [ { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] }, { "alias": "Set sun elevation colour temperature for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_sun_elevation_colour_lux_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Wait for sun elevation to change", "wait_for_trigger": [ { "trigger": "state", "entity_id": "sun.sun", "attribute": "elevation" } ] } ] } ] } ] } } ] } ] } ] } ] }, { "choose": [ { "alias": "10 - Dynamic Lighting - Time Controlled - Colour Temp", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_kelvin": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_colour_temp %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set colour_temp_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set colour_temp_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% elif current_time < start_time_morning %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% elif current_time > end_time_evening %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if 'use_brightness' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'brightness_pct': light_brightness }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "11 - Dynamic Lighting - Time Controlled - Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_brightness %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set brightness_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set brightness_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% elif current_time < start_time_morning %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% elif current_time > end_time_evening %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "12 - Dynamic Lighting - Time Controlled - Brightness Inverted", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness_inv' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_min_brightness %} {% set end_slope = (dynamic_lighting_max_brightness - dynamic_lighting_min_brightness) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_max_brightness %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set brightness_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set brightness_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% elif current_time < start_time_morning %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% elif current_time > end_time_evening %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% else %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {% if include_light_colour_control == 'use_colour_temperature' %}\n {% set light.data = dict(light.data, **{ 'color_temp_kelvin': light_colour_temperature }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgb_colour' %}\n {% set light.data = dict(light.data, **{ 'rgb_color': light_rgb_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbw_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbw_color': light_rgbw_colour }) %}\n{% endif %} {% if include_light_colour_control == 'use_rgbww_colour' %}\n {% set light.data = dict(light.data, **{ 'rgbww_color': light_rgbww_colour }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_brightness_inv' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "choose": [ { "alias": "13 - Dynamic Lighting - Time Controlled - Colour Temp & Brightness", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour_brightness' }}" } ], "sequence": [ { "alias": "Dynamic Lighting Control", "repeat": { "until": "{{ ((dynamic_lighting_boolean == []) and (expand(light_entities) | selectattr('state', '==', 'off') | list | count > 0)) or ((dynamic_lighting_boolean != []) and (is_state(dynamic_lighting_boolean, 'off'))) }}", "sequence": [ { "variables": { "dynamic_brightness_pct": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_brightness %} {% set end_slope = (dynamic_lighting_min_brightness - dynamic_lighting_max_brightness) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_brightness %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set brightness_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set brightness_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% elif current_time < start_time_morning %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% elif current_time > end_time_evening %}\n {% set brightness_value = dynamic_lighting_min_brightness %}\n{% else %}\n {% set brightness_value = dynamic_lighting_max_brightness %}\n{% endif %} {{ brightness_value | round(0) }}\n", "dynamic_kelvin": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set start_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (start_time_morning - end_time_morning) %} {% set start_ak = (start_slope * (-end_time_morning)) + dynamic_lighting_max_colour_temp %} {% set end_slope = (dynamic_lighting_min_colour_temp - dynamic_lighting_max_colour_temp) / (end_time_evening - start_time_evening) %} {% set end_ak = (end_slope * (-end_time_evening)) + dynamic_lighting_min_colour_temp %} {% if current_time >= start_time_morning and current_time <= end_time_morning %}\n {% set colour_temp_value = (start_slope * current_time + start_ak) | round(1) %}\n{% elif current_time >= start_time_evening and current_time <= end_time_evening %}\n {% set colour_temp_value = (end_slope * current_time + end_ak) | round(1) %}\n{% elif current_time > end_time_morning and current_time < start_time_evening %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% elif current_time < start_time_morning %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% elif current_time > end_time_evening %}\n {% set colour_temp_value = dynamic_lighting_min_colour_temp %}\n{% else %}\n {% set colour_temp_value = dynamic_lighting_max_colour_temp %}\n{% endif %} {{ colour_temp_value | round(0) }}\n", "dynamic_light_data": "{% set light = namespace(data={}) %} {% set light.data = dict(light.data, **{ 'color_temp_kelvin': dynamic_kelvin }) %} {% set light.data = dict(light.data, **{ 'brightness_pct': dynamic_brightness_pct }) %} {% if 'use_transition' in include_light_control %}\n {% set light.data = dict(light.data, **{ 'transition': light_transition_on }) %}\n{% endif %} {{ light.data }}\n", "should_wait": "{% set current_time = now().hour + (now().minute / 60) %} {% set start_time_morning = dynamic_lighting_time_start_morning.split(':')[0] | int + (dynamic_lighting_time_start_morning.split(':')[1] | int / 60) %} {% set end_time_morning = dynamic_lighting_time_end_morning.split(':')[0] | int + (dynamic_lighting_time_end_morning.split(':')[1] | int / 60) %} {% set start_time_evening = dynamic_lighting_time_start_evening.split(':')[0] | int + (dynamic_lighting_time_start_evening.split(':')[1] | int / 60) %} {% set end_time_evening = dynamic_lighting_time_end_evening.split(':')[0] | int + (dynamic_lighting_time_end_evening.split(':')[1] | int / 60) %} {% if end_time_morning < start_time_morning %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_morning = end_time_morning + 24 %}\n {% set start_time_evening = start_time_evening + 24 %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% if end_time_evening < start_time_evening %}\n {% if current_time < end_time_evening %}\n {% set current_time = current_time + 24 %}\n {% endif %}\n {% set end_time_evening = end_time_evening + 24 %}\n{% endif %} {% set lights_on = expand(light_entities) | selectattr('state', '==', 'on') | list | count > 0 %} {% set in_morning = start_time_morning <= current_time <= end_time_morning %} {% set in_evening = start_time_evening <= current_time <= end_time_evening %} {{ lights_on and not (in_morning or in_evening) }}\n" } }, { "choose": [ { "alias": "Stop when crossing over", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' not in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "stop": "Stop the automation" } ] }, { "alias": "Adjust the lights settings when crossing over if lights are ON is selected in night light control", "conditions": [ { "condition": "template", "value_template": "{{ 'if_lights_are_on_adjust_when_crossing_over' in include_night_light_control }}" }, { "condition": "trigger", "id": [ "t12", "t13", "t14" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "Adjust the light settings when all bypasses are off or state control is enabled, and the entity is turned ON", "conditions": [ { "condition": "trigger", "id": [ "t15", "t8_on", "t8_off", "t8_stop" ] }, { "condition": "template", "value_template": "{{ repeat.index == 1 }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] }, { "alias": "If time is outside the adjustment zone and the lights are ON", "conditions": "{{ should_wait }}", "sequence": [ { "choose": [ { "conditions": [ { "condition": "time", "after": "09:00:00", "before": "17:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "17:00:00" } ] } ] }, { "conditions": [ { "condition": "time", "after": "19:00:00", "before": "06:00:00" } ], "sequence": [ { "wait_for_trigger": [ { "trigger": "time", "at": "06:00:00" } ] } ] } ] } ] }, { "alias": "Set the dynamic lighting brightness for the normal lights", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'enable_time_controled_colour_brightness' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ dynamic_light_data }}" }, { "alias": "Dynamic lighting heartbeat", "delay": { "minutes": 1 } } ] } ] } ] } } ] } ] }, { "stop": "Stop the automation" } ] }, { "sequence": [ { "choose": [ { "alias": "Turn ON lights", "conditions": [ { "alias": "Check the dynamic lighting options", "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting == 'disable_dynamic_lighting' }}" }, { "alias": "Check that dynamic lighting is active and the state control option is enabled", "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{{ dynamic_lighting_state_control == 'enable_state_control' }}" }, { "condition": "template", "value_template": "{{ states(dynamic_lighting_state_control_entity) == dynamic_lighting_state_control_activation_state_inv }}" } ] } ] } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities_off }}" }, "data": "{{ light_data }}" } ] } ] }, { "choose": [ { "alias": "Dynamic Lighting State Control Turning OFF", "conditions": [ { "condition": "trigger", "id": "t16" }, { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "{{ light_entities }}" }, "data": "{{ light_data }}" }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ] }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts == [] %}\n false\n{% elif is_state(night_boolean_scenes_scripts, 'on') %}\n true\n{% else %}\n false\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": "{{ night_boolean_scenes_scripts }}" } }, { "choose": [ { "alias": "Check if normal lights scenes or scripts helper is on - This is for scenes only when crossing over", "conditions": [ "{{ boolean_scenes_scripts != [] }}" ], "sequence": [ { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ boolean_scenes_scripts_helper }}" } } ] } ] } ] }, { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ scene_entities }}" }, "data": { "transition": "{{ light_transition_on }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ boolean_scenes_scripts_helper }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn on the scenes", "action": "scene.turn_on", "target": { "entity_id": "{{ scene_entities }}" } }, { "alias": "Turn on the boolean for scenes and scripts", "action": "input_boolean.turn_on", "data": { "entity_id": "{{ boolean_scenes_scripts_helper }}" } } ] } ] }, { "alias": "Turn on the switches", "action": "switch.turn_on", "target": { "entity_id": "{{ switch_entities_off }}" } }, { "alias": "Turn on the scripts", "action": "script.turn_on", "target": { "entity_id": "{{ script_entities }}" } }, { "choose": [ { "alias": "By-pass is enabled & check by-pass option - Turn lights on", "conditions": [ { "condition": "trigger", "id": "t7_on" } ], "sequence": [ { "alias": "Check by-pass settings and preform the correct action", "if": [ { "alias": "Check if the by-pass auto off is enabled", "condition": "template", "value_template": "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "then": [ { "alias": "Wait the number of minutes set in the by-pass auto off time delay", "delay": { "minutes": 60 } }, { "alias": "Parallel Actions for the by-pass auto off", "parallel": [ { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_auto_off_enabled_on' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_turn_off' in include_bypass) and ('bypass_auto_off_enabled_off' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] }, { "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ ('bypass_enabled_stop' in include_bypass) and ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}" } ], "sequence": [ { "alias": "Turn off the by-pass", "action": "homeassistant.turn_off", "entity_id": [] } ] } ] } ] } ] }, { "stop": "Stop the automation" } ], "else": [ { "stop": "Stop the automation" } ] } ] } ] }, { "choose": [ { "alias": "Check if the trigger is on and wait for it to go off", "conditions": [ { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" } ], "sequence": [ { "alias": "Wait until motion sensor is off", "wait_for_trigger": [ { "trigger": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "from": "on", "to": "off" } ] } ] } ] }, { "alias": "Wait the number of minutes set in the normal lights time delay", "delay": { "minutes": 5 } }, { "choose": [ { "alias": "Dynamic Lighting - Check if Input Boolean Helper is ON", "conditions": [ { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ], "sequence": [ { "alias": "Turn off the boolean for dynamic lighting", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] }, { "choose": [ { "alias": "If transition is selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" }, "data": { "transition": "{{ light_transition_off }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}", "transition": "{{ light_transition_off }}" } } ] }, { "alias": "If transition is not selected", "conditions": [ { "condition": "template", "value_template": "{{ 'use_transition' not in include_light_control }}" } ], "sequence": [ { "alias": "Turn off the lights", "action": "light.turn_off", "target": { "entity_id": "{{ light_entities }}" } }, { "alias": "Turn off the scenes", "action": "scene.turn_on", "data": { "entity_id": "{{ end_scene_entities }}" } } ] } ] }, { "alias": "Turn off the switches", "action": "switch.turn_off", "target": { "entity_id": "{{ switch_entities }}" } }, { "alias": "Turn off the script", "action": "script.turn_on", "data": { "entity_id": "{{ end_script_entities }}" } }, { "alias": "Turn off the boolean for scenes and scripts", "action": "input_boolean.turn_off", "data": { "entity_id": [] } } ] } ] } ] } ], "conditions": [ { "condition": "or", "conditions": [ { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t0" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t1" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, "{{ include_sun == 'sun_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t2" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, "{{ include_ambient == 'ambient_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t3" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, "{{ include_time == 'time_enabled' }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t4" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'entity_state_enabled' in night_lights_conditions }}", { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t5" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'time_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t6" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'sun_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ include_night_glow == 'night_glow_enabled' }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t7_on" }, "{{ 'bypass_enabled_turn_on' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t7_off" }, "{{ 'bypass_enabled_turn_off' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t7_stop" }, "{{ 'bypass_enabled_stop' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t8_on" }, "{{ 'bypass_enabled_turn_on' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t8_off" }, "{{ 'bypass_enabled_turn_off' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t8_stop" }, "{{ 'bypass_enabled_stop' in include_bypass }}" ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t9" }, "{{ include_sun == 'sun_enabled' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t10" }, "{{ include_ambient == 'ambient_enabled' }}", "{{ ambient_light_options == 'ambient_light_option_disabled' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t11" }, "{{ include_time == 'time_enabled' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t12" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'entity_state_enabled' in night_lights_conditions }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t13" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'time_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t14" }, "{{ include_night_lights == 'night_lights_enabled' }}", "{{ 'sun_enabled' in night_lights_conditions }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{{ 'manage_scripts_crossing_over' in include_night_light_control }}" }, { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": [ "t15", "t16" ] }, { "condition": "template", "value_template": "{{ include_dynamic_lighting != 'disable_dynamic_lighting' }}" }, "{{ dynamic_lighting_state_control == 'enable_state_control' }}", { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t17" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "state": "on", "match": "any" }, { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t18" }, { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (include_night_glow == 'night_glow_enabled') and (expand(night_glow_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t19" }, { "condition": "or", "conditions": [ "{{ (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" }, { "condition": "template", "value_template": "{% if dynamic_lighting_boolean != [] %}\n {{ is_state(dynamic_lighting_boolean, 'on') }}\n{% endif %}" } ] } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t19" }, { "condition": "state", "entity_id": [ "binary_sensor.beweging_keuken_bezetting" ], "match": "any", "state": "on" } ] }, { "condition": "and", "conditions": [ { "condition": "trigger", "id": "t19" }, "{{ ('bypass_auto_off_enabled_on' in include_bypass_auto_off) or ('bypass_auto_off_enabled_off' in include_bypass_auto_off) or ('bypass_auto_off_enabled_stop' in include_bypass_auto_off) }}", { "condition": "or", "conditions": [ { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" }, { "condition": "state", "entity_id": [], "match": "any", "state": "on" } ] } ] } ] }, { "condition": "or", "conditions": [ "{{ include_bypass == [] }}", { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' in include_bypass) and ('bypass_enabled_stop' not in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "and", "conditions": [ "{{ ('bypass_enabled_turn_on' not in include_bypass) and ('bypass_enabled_turn_off' not in include_bypass) and ('bypass_enabled_stop' in include_bypass) }}", { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t19" ] } ] }, { "condition": "or", "conditions": [ "{{ include_sun == 'sun_disabled' }}", "{{ include_sun == 'sun_enabled_night_lights' }}", "{{ (include_sun == 'sun_enabled') and (is_state_attr('sun.sun', 'rising', false)) and (state_attr('sun.sun','elevation') <= sun_elevation | float(90)) }}", "{{ (include_sun == 'sun_enabled') and (is_state_attr('sun.sun', 'rising', true)) and (state_attr('sun.sun','elevation') <= sun_elevation_rising | float(90)) }}", { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t9" ] } ] }, { "condition": "or", "conditions": [ "{{ include_ambient == 'ambient_disabled' }}", "{{ ambient_light_sensor == [] }}", "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_value | int)) }}", "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) and ((include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and (expand(light_switch.entity_id) | selectattr('state', '==', 'on') | list | count > 0) }}", "{{ (include_ambient == 'ambient_enabled') and (ambient_light_options == 'ambient_light_option_enabled') and ((include_night_lights == 'night_lights_enabled') and (expand(night_lights.entity_id) | selectattr('state', '==', 'on') | list | count > 0)) }}", { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ((states(ambient_light_sensor) | int) < (ambient_light_high_value | int)) }}", { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ( ambient_light_options == 'ambient_light_option_enabled' ) }}", { "condition": "template", "value_template": "{% if boolean_scenes_scripts != [] %}\n {{ is_state(boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "and", "conditions": [ "{{ (include_ambient == 'ambient_enabled') and ( ambient_light_options == 'ambient_light_option_enabled' ) }}", { "condition": "template", "value_template": "{% if night_boolean_scenes_scripts != [] %}\n {{ is_state(night_boolean_scenes_scripts, 'on') }}\n{% endif %}" } ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t10" ] } ] }, { "condition": "or", "conditions": [ "{{ include_time == 'time_disabled' }}", { "condition": "and", "conditions": [ { "condition": "time", "after": "18:00:00", "before": "09:00:00", "weekday": [ "mon", "tue", "wed", "thu", "fri", "sat", "sun" ] }, "{{ include_time == 'time_enabled' }}" ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t11" ] } ] }, { "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_disabled' }}" }, { "condition": "and", "conditions": [ { "condition": "template", "value_template": "{{ include_state_control == 'state_control_enabled' }}" }, { "condition": "state", "entity_id": [], "state": "off" } ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop", "t18" ] } ] }, { "condition": "or", "conditions": [ "{{ include_device_tracker == 'device_tracker_disabled' }}", { "condition": "and", "conditions": [ "{{ include_device_tracker == 'zone_enabled' }}", { "condition": "numeric_state", "entity_id": [], "above": 0 } ] }, { "condition": "and", "conditions": [ "{{ include_device_tracker == 'zone_people_enabled' }}", "{{ (state_attr(zone, 'persons') | list | select('in', people) | list | length) > 0 }}" ] }, { "condition": "trigger", "id": [ "t7_on", "t7_off", "t7_stop", "t8_on", "t8_off", "t8_stop" ] } ] } ], "id": "1758055141945", "alias": "Beweging Keuken", "description": "" }, "blueprint_inputs": { "id": "1758055141945", "alias": "Beweging Keuken", "description": "", "use_blueprint": { "path": "Blackshome/sensor-light.yaml", "input": { "motion_trigger": [ "binary_sensor.beweging_keuken_bezetting" ], "light_switch": { "entity_id": "light.lamp_keuken_main" }, "include_light_control": [ "use_brightness" ], "light_brightness": 80, "include_sun": "sun_enabled", "night_lights_conditions": [ "time_enabled" ], "include_time": "time_disabled", "after_time": "18:00:00", "before_time": "09:00:00", "night_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_light_control": [ "use_brightness", "use_transition" ], "night_light_brightness": 100, "include_night_light_colour_control": "use_colour_temperature", "night_light_colour_temperature": 2700, "include_night_glow": "night_glow_disabled", "night_glow_lights": { "entity_id": "light.lamp_keuken_kleur" }, "include_night_glow_light_colour_control": "use_colour_temperature", "night_glow_light_colour_temperature": 2000, "include_night_glow_light_control": [ "use_brightness" ], "include_dynamic_lighting": "enable_sun_elevation_colour_brightness", "dynamic_lighting_min_colour_temp": 2500, "include_night_lights": "night_lights_enabled", "dynamic_lighting_max_colour_temp": 4200, "night_lights_after_time": "20:30:00", "dynamic_lighting_max_brightness": 80, "dynamic_lighting_min_brightness": 42, "night_lights_before_time": "06:00:00", "night_light_transition_on": 0, "night_light_transition_off": 10 } } }, "context": { "id": "01KF2ZT0GQ587CJJEJ2MEG53MY", "parent_id": "01KF2ZT0GM13A8CX4Y7GRZ60D0", "user_id": null } }, "short_dict": { "last_step": "condition/2/conditions/4", "run_id": "86caf6651e8e2a2a3269f8f9956eae03", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T08:47:31.351471+00:00", "finish": "2026-01-16T08:47:31.355997+00:00" }, "domain": "automation", "item_id": "1758055141945", "trigger": "state of binary_sensor.beweging_keuken_bezetting" } } ], "script.toggle_boiler": [ { "extended_dict": { "last_step": "sequence/0/choose/2/sequence/0", "run_id": "bb67ba7a49fc7c1e6b9ea7fa1e6ae9a6", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T13:36:21.137148+00:00", "finish": "2026-01-13T13:36:21.247421+00:00" }, "domain": "script", "item_id": "toggle_boiler", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-13T13:36:21.137429+00:00", "changed_variables": { "this": { "entity_id": "script.toggle_boiler", "state": "off", "attributes": { "last_triggered": "2026-01-13T13:36:19.451189+00:00", "mode": "single", "current": 0, "icon": "mdi:water-boiler-auto", "friendly_name": "Toggle Boiler" }, "last_changed": "2026-01-13T13:36:19.559149+00:00", "last_reported": "2026-01-13T13:36:19.559149+00:00", "last_updated": "2026-01-13T13:36:19.559149+00:00", "context": { "id": "01KEVS4NFT06NDPG9P4JZMBPKB", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "context": { "id": "01KEVS4Q4H9HJBKRR8BFH1NCV1", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "result": { "choice": 2 } } ], "sequence/0/choose/0": [ { "path": "sequence/0/choose/0", "timestamp": "2026-01-13T13:36:21.137481+00:00", "result": { "result": false } } ], "sequence/0/choose/0/conditions/0": [ { "path": "sequence/0/choose/0/conditions/0", "timestamp": "2026-01-13T13:36:21.137507+00:00", "result": { "result": false } } ], "sequence/0/choose/0/conditions/0/entity_id/0": [ { "path": "sequence/0/choose/0/conditions/0/entity_id/0", "timestamp": "2026-01-13T13:36:21.137524+00:00", "result": { "result": false, "state": "eco", "wanted_state": "off" } } ], "sequence/0/choose/1": [ { "path": "sequence/0/choose/1", "timestamp": "2026-01-13T13:36:21.137570+00:00", "result": { "result": false } } ], "sequence/0/choose/1/conditions/0": [ { "path": "sequence/0/choose/1/conditions/0", "timestamp": "2026-01-13T13:36:21.137587+00:00", "result": { "result": false } } ], "sequence/0/choose/1/conditions/0/entity_id/0": [ { "path": "sequence/0/choose/1/conditions/0/entity_id/0", "timestamp": "2026-01-13T13:36:21.137601+00:00", "result": { "result": false, "state": "eco", "wanted_state": "electric" } } ], "sequence/0/choose/2": [ { "path": "sequence/0/choose/2", "timestamp": "2026-01-13T13:36:21.137633+00:00", "result": { "result": true } } ], "sequence/0/choose/2/conditions/0": [ { "path": "sequence/0/choose/2/conditions/0", "timestamp": "2026-01-13T13:36:21.137647+00:00", "result": { "result": true } } ], "sequence/0/choose/2/conditions/0/entity_id/0": [ { "path": "sequence/0/choose/2/conditions/0/entity_id/0", "timestamp": "2026-01-13T13:36:21.137661+00:00", "result": { "result": true, "state": "eco", "wanted_state": "eco" } } ], "sequence/0/choose/2/sequence/0": [ { "path": "sequence/0/choose/2/sequence/0", "timestamp": "2026-01-13T13:36:21.137745+00:00", "result": { "params": { "domain": "water_heater", "service": "set_operation_mode", "service_data": { "operation_mode": "high_demand", "device_id": [ "0db7dd89cc13b1dee2490abad9450ca3" ] }, "target": { "device_id": [ "0db7dd89cc13b1dee2490abad9450ca3" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "choose": [ { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": "off" } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "electric" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] }, { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": [ "electric" ] } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "eco" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] }, { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": [ "eco" ] } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "high_demand" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] }, { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": [ "high_demand" ] } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "off" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] } ] } ], "alias": "Toggle Boiler", "description": "", "icon": "mdi:water-boiler-auto" }, "blueprint_inputs": null, "context": { "id": "01KEVS4Q4H9HJBKRR8BFH1NCV1", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "short_dict": { "last_step": "sequence/0/choose/2/sequence/0", "run_id": "bb67ba7a49fc7c1e6b9ea7fa1e6ae9a6", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T13:36:21.137148+00:00", "finish": "2026-01-13T13:36:21.247421+00:00" }, "domain": "script", "item_id": "toggle_boiler" } }, { "extended_dict": { "last_step": "sequence/0/choose/3/sequence/0", "run_id": "1b8c5f9c8802c5059b78b1d4e72f12d6", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T13:36:25.891778+00:00", "finish": "2026-01-13T13:36:25.997203+00:00" }, "domain": "script", "item_id": "toggle_boiler", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-13T13:36:25.892083+00:00", "changed_variables": { "this": { "entity_id": "script.toggle_boiler", "state": "off", "attributes": { "last_triggered": "2026-01-13T13:36:21.137226+00:00", "mode": "single", "current": 0, "icon": "mdi:water-boiler-auto", "friendly_name": "Toggle Boiler" }, "last_changed": "2026-01-13T13:36:21.245734+00:00", "last_reported": "2026-01-13T13:36:21.245734+00:00", "last_updated": "2026-01-13T13:36:21.245734+00:00", "context": { "id": "01KEVS4Q4H9HJBKRR8BFH1NCV1", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "context": { "id": "01KEVS4VS3VVKMBTFHM7R9PFXF", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "result": { "choice": 3 } } ], "sequence/0/choose/0": [ { "path": "sequence/0/choose/0", "timestamp": "2026-01-13T13:36:25.892136+00:00", "result": { "result": false } } ], "sequence/0/choose/0/conditions/0": [ { "path": "sequence/0/choose/0/conditions/0", "timestamp": "2026-01-13T13:36:25.892160+00:00", "result": { "result": false } } ], "sequence/0/choose/0/conditions/0/entity_id/0": [ { "path": "sequence/0/choose/0/conditions/0/entity_id/0", "timestamp": "2026-01-13T13:36:25.892175+00:00", "result": { "result": false, "state": "high_demand", "wanted_state": "off" } } ], "sequence/0/choose/1": [ { "path": "sequence/0/choose/1", "timestamp": "2026-01-13T13:36:25.892235+00:00", "result": { "result": false } } ], "sequence/0/choose/1/conditions/0": [ { "path": "sequence/0/choose/1/conditions/0", "timestamp": "2026-01-13T13:36:25.892251+00:00", "result": { "result": false } } ], "sequence/0/choose/1/conditions/0/entity_id/0": [ { "path": "sequence/0/choose/1/conditions/0/entity_id/0", "timestamp": "2026-01-13T13:36:25.892264+00:00", "result": { "result": false, "state": "high_demand", "wanted_state": "electric" } } ], "sequence/0/choose/2": [ { "path": "sequence/0/choose/2", "timestamp": "2026-01-13T13:36:25.892293+00:00", "result": { "result": false } } ], "sequence/0/choose/2/conditions/0": [ { "path": "sequence/0/choose/2/conditions/0", "timestamp": "2026-01-13T13:36:25.892307+00:00", "result": { "result": false } } ], "sequence/0/choose/2/conditions/0/entity_id/0": [ { "path": "sequence/0/choose/2/conditions/0/entity_id/0", "timestamp": "2026-01-13T13:36:25.892320+00:00", "result": { "result": false, "state": "high_demand", "wanted_state": "eco" } } ], "sequence/0/choose/3": [ { "path": "sequence/0/choose/3", "timestamp": "2026-01-13T13:36:25.892346+00:00", "result": { "result": true } } ], "sequence/0/choose/3/conditions/0": [ { "path": "sequence/0/choose/3/conditions/0", "timestamp": "2026-01-13T13:36:25.892360+00:00", "result": { "result": true } } ], "sequence/0/choose/3/conditions/0/entity_id/0": [ { "path": "sequence/0/choose/3/conditions/0/entity_id/0", "timestamp": "2026-01-13T13:36:25.892371+00:00", "result": { "result": true, "state": "high_demand", "wanted_state": "high_demand" } } ], "sequence/0/choose/3/sequence/0": [ { "path": "sequence/0/choose/3/sequence/0", "timestamp": "2026-01-13T13:36:25.892457+00:00", "result": { "params": { "domain": "water_heater", "service": "set_operation_mode", "service_data": { "operation_mode": "off", "device_id": [ "0db7dd89cc13b1dee2490abad9450ca3" ] }, "target": { "device_id": [ "0db7dd89cc13b1dee2490abad9450ca3" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "choose": [ { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": "off" } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "electric" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] }, { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": [ "electric" ] } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "eco" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] }, { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": [ "eco" ] } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "high_demand" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] }, { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": [ "high_demand" ] } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "off" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] } ] } ], "alias": "Toggle Boiler", "description": "", "icon": "mdi:water-boiler-auto" }, "blueprint_inputs": null, "context": { "id": "01KEVS4VS3VVKMBTFHM7R9PFXF", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "short_dict": { "last_step": "sequence/0/choose/3/sequence/0", "run_id": "1b8c5f9c8802c5059b78b1d4e72f12d6", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T13:36:25.891778+00:00", "finish": "2026-01-13T13:36:25.997203+00:00" }, "domain": "script", "item_id": "toggle_boiler" } }, { "extended_dict": { "last_step": "sequence/0/choose/0/sequence/0", "run_id": "353e8f1b0ad9d08863e78b5ae8d17160", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T13:36:26.942181+00:00", "finish": "2026-01-13T13:36:27.060818+00:00" }, "domain": "script", "item_id": "toggle_boiler", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-13T13:36:26.942523+00:00", "changed_variables": { "this": { "entity_id": "script.toggle_boiler", "state": "off", "attributes": { "last_triggered": "2026-01-13T13:36:25.891835+00:00", "mode": "single", "current": 0, "icon": "mdi:water-boiler-auto", "friendly_name": "Toggle Boiler" }, "last_changed": "2026-01-13T13:36:25.995643+00:00", "last_reported": "2026-01-13T13:36:25.995643+00:00", "last_updated": "2026-01-13T13:36:25.995643+00:00", "context": { "id": "01KEVS4VS3VVKMBTFHM7R9PFXF", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "context": { "id": "01KEVS4WSY3FMK961R2610G5DN", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "result": { "choice": 0 } } ], "sequence/0/choose/0": [ { "path": "sequence/0/choose/0", "timestamp": "2026-01-13T13:36:26.942593+00:00", "result": { "result": true } } ], "sequence/0/choose/0/conditions/0": [ { "path": "sequence/0/choose/0/conditions/0", "timestamp": "2026-01-13T13:36:26.942633+00:00", "result": { "result": true } } ], "sequence/0/choose/0/conditions/0/entity_id/0": [ { "path": "sequence/0/choose/0/conditions/0/entity_id/0", "timestamp": "2026-01-13T13:36:26.942668+00:00", "result": { "result": true, "state": "off", "wanted_state": "off" } } ], "sequence/0/choose/0/sequence/0": [ { "path": "sequence/0/choose/0/sequence/0", "timestamp": "2026-01-13T13:36:26.942799+00:00", "result": { "params": { "domain": "water_heater", "service": "set_operation_mode", "service_data": { "operation_mode": "electric", "device_id": [ "0db7dd89cc13b1dee2490abad9450ca3" ] }, "target": { "device_id": [ "0db7dd89cc13b1dee2490abad9450ca3" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "choose": [ { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": "off" } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "electric" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] }, { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": [ "electric" ] } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "eco" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] }, { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": [ "eco" ] } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "high_demand" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] }, { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": [ "high_demand" ] } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "off" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] } ] } ], "alias": "Toggle Boiler", "description": "", "icon": "mdi:water-boiler-auto" }, "blueprint_inputs": null, "context": { "id": "01KEVS4WSY3FMK961R2610G5DN", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "short_dict": { "last_step": "sequence/0/choose/0/sequence/0", "run_id": "353e8f1b0ad9d08863e78b5ae8d17160", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T13:36:26.942181+00:00", "finish": "2026-01-13T13:36:27.060818+00:00" }, "domain": "script", "item_id": "toggle_boiler" } }, { "extended_dict": { "last_step": "sequence/0/choose/2/sequence/0", "run_id": "1bf3082815574e71b0af8d29985bf854", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T14:25:52.290319+00:00", "finish": "2026-01-13T14:25:52.536974+00:00" }, "domain": "script", "item_id": "toggle_boiler", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-13T14:25:52.290589+00:00", "changed_variables": { "this": { "entity_id": "script.toggle_boiler", "state": "off", "attributes": { "last_triggered": "2026-01-13T13:36:26.942252+00:00", "mode": "single", "current": 0, "icon": "mdi:water-boiler-auto", "friendly_name": "Toggle Boiler" }, "last_changed": "2026-01-13T13:36:27.058974+00:00", "last_reported": "2026-01-13T13:36:27.058974+00:00", "last_updated": "2026-01-13T13:36:27.058974+00:00", "context": { "id": "01KEVS4WSY3FMK961R2610G5DN", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "context": { "id": "01KEVVZCN2FGSEHMQ9Y8XRVMR1", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "result": { "choice": 2 } } ], "sequence/0/choose/0": [ { "path": "sequence/0/choose/0", "timestamp": "2026-01-13T14:25:52.290643+00:00", "result": { "result": false } } ], "sequence/0/choose/0/conditions/0": [ { "path": "sequence/0/choose/0/conditions/0", "timestamp": "2026-01-13T14:25:52.290667+00:00", "result": { "result": false } } ], "sequence/0/choose/0/conditions/0/entity_id/0": [ { "path": "sequence/0/choose/0/conditions/0/entity_id/0", "timestamp": "2026-01-13T14:25:52.290683+00:00", "result": { "result": false, "state": "eco", "wanted_state": "off" } } ], "sequence/0/choose/1": [ { "path": "sequence/0/choose/1", "timestamp": "2026-01-13T14:25:52.290726+00:00", "result": { "result": false } } ], "sequence/0/choose/1/conditions/0": [ { "path": "sequence/0/choose/1/conditions/0", "timestamp": "2026-01-13T14:25:52.290741+00:00", "result": { "result": false } } ], "sequence/0/choose/1/conditions/0/entity_id/0": [ { "path": "sequence/0/choose/1/conditions/0/entity_id/0", "timestamp": "2026-01-13T14:25:52.290754+00:00", "result": { "result": false, "state": "eco", "wanted_state": "electric" } } ], "sequence/0/choose/2": [ { "path": "sequence/0/choose/2", "timestamp": "2026-01-13T14:25:52.290783+00:00", "result": { "result": true } } ], "sequence/0/choose/2/conditions/0": [ { "path": "sequence/0/choose/2/conditions/0", "timestamp": "2026-01-13T14:25:52.290797+00:00", "result": { "result": true } } ], "sequence/0/choose/2/conditions/0/entity_id/0": [ { "path": "sequence/0/choose/2/conditions/0/entity_id/0", "timestamp": "2026-01-13T14:25:52.290810+00:00", "result": { "result": true, "state": "eco", "wanted_state": "eco" } } ], "sequence/0/choose/2/sequence/0": [ { "path": "sequence/0/choose/2/sequence/0", "timestamp": "2026-01-13T14:25:52.290881+00:00", "result": { "params": { "domain": "water_heater", "service": "set_operation_mode", "service_data": { "operation_mode": "high_demand", "device_id": [ "0db7dd89cc13b1dee2490abad9450ca3" ] }, "target": { "device_id": [ "0db7dd89cc13b1dee2490abad9450ca3" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "choose": [ { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": "off" } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "electric" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] }, { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": [ "electric" ] } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "eco" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] }, { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": [ "eco" ] } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "high_demand" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] }, { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": [ "high_demand" ] } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "off" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] } ] } ], "alias": "Toggle Boiler", "description": "", "icon": "mdi:water-boiler-auto" }, "blueprint_inputs": null, "context": { "id": "01KEVVZCN2FGSEHMQ9Y8XRVMR1", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "short_dict": { "last_step": "sequence/0/choose/2/sequence/0", "run_id": "1bf3082815574e71b0af8d29985bf854", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T14:25:52.290319+00:00", "finish": "2026-01-13T14:25:52.536974+00:00" }, "domain": "script", "item_id": "toggle_boiler" } }, { "extended_dict": { "last_step": "sequence/0/choose/3/sequence/0", "run_id": "262bdb0dfbdef61ba31412d4c5134b31", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T14:25:54.445629+00:00", "finish": "2026-01-13T14:25:54.553852+00:00" }, "domain": "script", "item_id": "toggle_boiler", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-13T14:25:54.445893+00:00", "changed_variables": { "this": { "entity_id": "script.toggle_boiler", "state": "off", "attributes": { "last_triggered": "2026-01-13T14:25:52.290396+00:00", "mode": "single", "current": 0, "icon": "mdi:water-boiler-auto", "friendly_name": "Toggle Boiler" }, "last_changed": "2026-01-13T14:25:52.535337+00:00", "last_reported": "2026-01-13T14:25:52.535337+00:00", "last_updated": "2026-01-13T14:25:52.535337+00:00", "context": { "id": "01KEVVZCN2FGSEHMQ9Y8XRVMR1", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "context": { "id": "01KEVVZERDQZJQQN44A1WD4N7T", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "result": { "choice": 3 } } ], "sequence/0/choose/0": [ { "path": "sequence/0/choose/0", "timestamp": "2026-01-13T14:25:54.445957+00:00", "result": { "result": false } } ], "sequence/0/choose/0/conditions/0": [ { "path": "sequence/0/choose/0/conditions/0", "timestamp": "2026-01-13T14:25:54.445982+00:00", "result": { "result": false } } ], "sequence/0/choose/0/conditions/0/entity_id/0": [ { "path": "sequence/0/choose/0/conditions/0/entity_id/0", "timestamp": "2026-01-13T14:25:54.445999+00:00", "result": { "result": false, "state": "high_demand", "wanted_state": "off" } } ], "sequence/0/choose/1": [ { "path": "sequence/0/choose/1", "timestamp": "2026-01-13T14:25:54.446043+00:00", "result": { "result": false } } ], "sequence/0/choose/1/conditions/0": [ { "path": "sequence/0/choose/1/conditions/0", "timestamp": "2026-01-13T14:25:54.446078+00:00", "result": { "result": false } } ], "sequence/0/choose/1/conditions/0/entity_id/0": [ { "path": "sequence/0/choose/1/conditions/0/entity_id/0", "timestamp": "2026-01-13T14:25:54.446101+00:00", "result": { "result": false, "state": "high_demand", "wanted_state": "electric" } } ], "sequence/0/choose/2": [ { "path": "sequence/0/choose/2", "timestamp": "2026-01-13T14:25:54.446157+00:00", "result": { "result": false } } ], "sequence/0/choose/2/conditions/0": [ { "path": "sequence/0/choose/2/conditions/0", "timestamp": "2026-01-13T14:25:54.446212+00:00", "result": { "result": false } } ], "sequence/0/choose/2/conditions/0/entity_id/0": [ { "path": "sequence/0/choose/2/conditions/0/entity_id/0", "timestamp": "2026-01-13T14:25:54.446228+00:00", "result": { "result": false, "state": "high_demand", "wanted_state": "eco" } } ], "sequence/0/choose/3": [ { "path": "sequence/0/choose/3", "timestamp": "2026-01-13T14:25:54.446262+00:00", "result": { "result": true } } ], "sequence/0/choose/3/conditions/0": [ { "path": "sequence/0/choose/3/conditions/0", "timestamp": "2026-01-13T14:25:54.446278+00:00", "result": { "result": true } } ], "sequence/0/choose/3/conditions/0/entity_id/0": [ { "path": "sequence/0/choose/3/conditions/0/entity_id/0", "timestamp": "2026-01-13T14:25:54.446291+00:00", "result": { "result": true, "state": "high_demand", "wanted_state": "high_demand" } } ], "sequence/0/choose/3/sequence/0": [ { "path": "sequence/0/choose/3/sequence/0", "timestamp": "2026-01-13T14:25:54.446375+00:00", "result": { "params": { "domain": "water_heater", "service": "set_operation_mode", "service_data": { "operation_mode": "off", "device_id": [ "0db7dd89cc13b1dee2490abad9450ca3" ] }, "target": { "device_id": [ "0db7dd89cc13b1dee2490abad9450ca3" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "choose": [ { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": "off" } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "electric" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] }, { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": [ "electric" ] } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "eco" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] }, { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": [ "eco" ] } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "high_demand" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] }, { "conditions": [ { "condition": "state", "entity_id": "water_heater.smart_boiler_77cb", "attribute": "operation_mode", "state": [ "high_demand" ] } ], "sequence": [ { "action": "water_heater.set_operation_mode", "metadata": {}, "data": { "operation_mode": "off" }, "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } } ] } ] } ], "alias": "Toggle Boiler", "description": "", "icon": "mdi:water-boiler-auto" }, "blueprint_inputs": null, "context": { "id": "01KEVVZERDQZJQQN44A1WD4N7T", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "short_dict": { "last_step": "sequence/0/choose/3/sequence/0", "run_id": "262bdb0dfbdef61ba31412d4c5134b31", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T14:25:54.445629+00:00", "finish": "2026-01-13T14:25:54.553852+00:00" }, "domain": "script", "item_id": "toggle_boiler" } } ], "automation.1754287559178": [ { "extended_dict": { "last_step": "action/0/choose/0/sequence/6", "run_id": "5a6d861e598d5091ac66d200375d6316", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-13T17:55:29.948849+00:00", "finish": "2026-01-13T17:55:33.631506+00:00" }, "domain": "automation", "item_id": "1754287559178", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "trigger": "state of binary_sensor.beweging_thuis", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-13T17:55:29.948881+00:00", "changed_variables": { "this": { "entity_id": "automation.willem_niet_thuis", "state": "on", "attributes": { "id": "1754287559178", "last_triggered": "2026-01-13T15:11:10.552065+00:00", "mode": "single", "current": 0, "friendly_name": "Auto Away & Thuis Boiler" }, "last_changed": "2026-01-13T12:10:27.677971+00:00", "last_reported": "2026-01-13T15:11:10.552623+00:00", "last_updated": "2026-01-13T15:11:10.552623+00:00", "context": { "id": "01KEVYJB6Q1SHX0EQVGDFRD14R", "parent_id": "01KEVYJB6QAC90EPT8D4NPN35V", "user_id": null } }, "trigger": { "id": "Niemand_thuis", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_thuis", "from_state": { "entity_id": "binary_sensor.beweging_thuis", "state": "on", "attributes": { "entity_id": [ "binary_sensor.beweging_toilet", "binary_sensor.beweging_zolder_ep_lite_occupancy", "binary_sensor.everything_presence_one_7f7364_mmwave", "binary_sensor.beweging_badkamer2_bezetting", "binary_sensor.beweging_keuken_bezetting" ], "device_class": "motion", "friendly_name": "Beweging thuis" }, "last_changed": "2026-01-13T15:43:52.303852+00:00", "last_reported": "2026-01-13T15:43:52.303852+00:00", "last_updated": "2026-01-13T15:43:52.303852+00:00", "context": { "id": "01KEW0E6ZFW76TQ91JX33CT2FE", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_thuis", "state": "off", "attributes": { "entity_id": [ "binary_sensor.beweging_toilet", "binary_sensor.beweging_zolder_ep_lite_occupancy", "binary_sensor.everything_presence_one_7f7364_mmwave", "binary_sensor.beweging_badkamer2_bezetting", "binary_sensor.beweging_keuken_bezetting" ], "device_class": "motion", "friendly_name": "Beweging thuis" }, "last_changed": "2026-01-13T15:55:29.945610+00:00", "last_reported": "2026-01-13T15:55:29.945610+00:00", "last_updated": "2026-01-13T15:55:29.945610+00:00", "context": { "id": "01KEW13G8RFA9THQW4XGYC6XNW", "parent_id": null, "user_id": null } }, "for": { "__type": "", "total_seconds": 7200.0 }, "attribute": null, "description": "state of binary_sensor.beweging_thuis" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-13T17:55:29.949150+00:00", "changed_variables": { "context": { "id": "01KEW7Z7GWMD61ZJDZJAMVYNY8", "parent_id": "01KEW13G8RFA9THQW4XGYC6XNW", "user_id": null } }, "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-13T17:55:29.949218+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-13T17:55:29.949245+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/1": [ { "path": "action/0/choose/0/conditions/1", "timestamp": "2026-01-13T17:55:29.949271+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/1/entity_id/0": [ { "path": "action/0/choose/0/conditions/1/entity_id/0", "timestamp": "2026-01-13T17:55:29.949288+00:00", "result": { "result": true, "state": "not_home", "wanted_state": "not_home" } } ], "action/0/choose/0/conditions/2": [ { "path": "action/0/choose/0/conditions/2", "timestamp": "2026-01-13T17:55:29.949316+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/2/entity_id/0": [ { "path": "action/0/choose/0/conditions/2/entity_id/0", "timestamp": "2026-01-13T17:55:29.949330+00:00", "result": { "result": true, "state": "off", "wanted_state": "off" } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-13T17:55:29.949415+00:00", "result": { "params": { "domain": "switch", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "switch.boiler_2" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/1": [ { "path": "action/0/choose/0/sequence/1", "timestamp": "2026-01-13T17:55:30.016934+00:00", "child_id": { "domain": "script", "item_id": "speakers_woonkamer_standby", "run_id": "508b69a37f0f606586e6f0cacde85acc" }, "result": { "params": { "domain": "script", "service": "speakers_woonkamer_standby", "service_data": {}, "target": {} }, "running_script": true } } ], "action/0/choose/0/sequence/2": [ { "path": "action/0/choose/0/sequence/2", "timestamp": "2026-01-13T17:55:30.082345+00:00", "child_id": { "domain": "script", "item_id": "voicebal_standby", "run_id": "308a7eca337e796029bc2daa31ff378a" }, "result": { "params": { "domain": "script", "service": "voicebal_standby", "service_data": {}, "target": {} }, "running_script": true } } ], "action/0/choose/0/sequence/3": [ { "path": "action/0/choose/0/sequence/3", "timestamp": "2026-01-13T17:55:30.091724+00:00", "result": { "params": { "domain": "water_heater", "service": "set_operation_mode", "service_data": { "operation_mode": "off", "device_id": [ "0db7dd89cc13b1dee2490abad9450ca3" ] }, "target": { "device_id": [ "0db7dd89cc13b1dee2490abad9450ca3" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/4": [ { "path": "action/0/choose/0/sequence/4", "timestamp": "2026-01-13T17:55:30.493714+00:00", "result": { "params": { "domain": "input_boolean", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "input_boolean.iemand_thuis" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/5": [ { "path": "action/0/choose/0/sequence/5", "timestamp": "2026-01-13T17:55:30.494187+00:00", "result": { "params": { "domain": "switch", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "switch.boiler_2" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/6": [ { "path": "action/0/choose/0/sequence/6", "timestamp": "2026-01-13T17:55:30.571519+00:00", "child_id": { "domain": "script", "item_id": "verwarming_eco_2", "run_id": "74349cc1d5d9217f6a8026805a84555e" }, "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "result": { "params": { "domain": "script", "service": "verwarming_eco_2", "service_data": {}, "target": {} }, "running_script": true } } ] }, "config": { "id": "1754287559178", "alias": "Auto Away & Thuis Boiler", "description": "Boiler en apparaten automatisch uit bij afwezigheid en aan bij thuiskomst", "triggers": [ { "trigger": "state", "entity_id": "binary_sensor.beweging_thuis", "from": "on", "to": "off", "for": "02:00:00", "id": "Niemand_thuis" }, { "trigger": "state", "entity_id": [ "device_tracker.iphone16_willem_irk_irk" ], "from": "not_home", "to": "home", "id": "Thuis" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "Niemand_thuis" ] }, { "condition": "state", "entity_id": "device_tracker.iphone16_willem_irk_irk", "state": "not_home" }, { "condition": "state", "entity_id": "input_boolean.verwarming_gastmodus", "state": "off" } ], "sequence": [ { "action": "switch.turn_off", "data": {}, "target": { "entity_id": "switch.boiler_2" } }, { "action": "script.speakers_woonkamer_standby" }, { "action": "script.voicebal_standby" }, { "data": { "operation_mode": "off" }, "action": "water_heater.set_operation_mode", "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } }, { "target": { "entity_id": "input_boolean.iemand_thuis" }, "action": "input_boolean.turn_off" }, { "action": "switch.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": "switch.boiler_2" } }, { "action": "script.verwarming_eco_2", "metadata": {}, "data": {} }, { "data": { "message": "Away modus ingeschakeld (boiler en verwarming uit)" }, "action": "notify.mobile_app_iphone_van_willem" }, { "action": "script.alle_lampen_uit", "metadata": {}, "data": {} } ] }, { "conditions": [ { "condition": "trigger", "id": "Thuis" } ], "sequence": [ { "condition": "state", "entity_id": "input_boolean.iemand_thuis", "state": "off" }, { "data": { "message": "Welkom thuis" }, "action": "notify.mobile_app_iphone_van_willem" }, { "data": { "operation_mode": "eco" }, "action": "water_heater.set_operation_mode", "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } }, { "target": { "entity_id": "input_boolean.iemand_thuis" }, "action": "input_boolean.turn_on" }, { "action": "switch.turn_on", "metadata": {}, "data": {}, "target": { "entity_id": "switch.boiler_2" } } ] } ] }, { "condition": "state", "entity_id": "input_boolean.verwarming_gastmodus", "state": "on" }, { "data": { "message": "Gastmodus staat aan" }, "action": "notify.mobile_app_iphone_van_willem" } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEW7Z7GWMD61ZJDZJAMVYNY8", "parent_id": "01KEW13G8RFA9THQW4XGYC6XNW", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/6", "run_id": "5a6d861e598d5091ac66d200375d6316", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-13T17:55:29.948849+00:00", "finish": "2026-01-13T17:55:33.631506+00:00" }, "domain": "automation", "item_id": "1754287559178", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "trigger": "state of binary_sensor.beweging_thuis" } }, { "extended_dict": { "last_step": "action/1/entity_id/0", "run_id": "0e9944a6cf88603b456794e9cc369bc6", "state": "stopped", "script_execution": "aborted", "timestamp": { "start": "2026-01-13T22:34:16.517609+00:00", "finish": "2026-01-13T22:34:17.081467+00:00" }, "domain": "automation", "item_id": "1754287559178", "trigger": "state of device_tracker.iphone16_willem_irk_irk", "trace": { "trigger/1": [ { "path": "trigger/1", "timestamp": "2026-01-13T22:34:16.517640+00:00", "changed_variables": { "this": { "entity_id": "automation.willem_niet_thuis", "state": "on", "attributes": { "id": "1754287559178", "last_triggered": "2026-01-13T17:55:29.948943+00:00", "mode": "single", "current": 0, "friendly_name": "Auto Away & Thuis Boiler" }, "last_changed": "2026-01-13T12:10:27.677971+00:00", "last_reported": "2026-01-13T17:55:33.630601+00:00", "last_updated": "2026-01-13T17:55:33.630601+00:00", "context": { "id": "01KEW7Z7GWMD61ZJDZJAMVYNY8", "parent_id": "01KEW13G8RFA9THQW4XGYC6XNW", "user_id": null } }, "trigger": { "id": "Thuis", "idx": "1", "alias": null, "platform": "state", "entity_id": "device_tracker.iphone16_willem_irk_irk", "from_state": { "entity_id": "device_tracker.iphone16_willem_irk_irk", "state": "not_home", "attributes": { "source_type": "bluetooth_le", "friendly_name": "Iphone16_Willem_irk" }, "last_changed": "2026-01-13T15:58:43.570150+00:00", "last_reported": "2026-01-13T15:58:43.570150+00:00", "last_updated": "2026-01-13T15:58:43.570150+00:00", "context": { "id": "01KEW19DBJWRZP33X5V7FC9DJQ", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "device_tracker.iphone16_willem_irk_irk", "state": "home", "attributes": { "source_type": "bluetooth_le", "current_address": "6D:9D:6E:9D:C2:21", "source": "88:13:BF:20:94:6E", "friendly_name": "Iphone16_Willem_irk" }, "last_changed": "2026-01-13T22:34:16.517019+00:00", "last_reported": "2026-01-13T22:34:16.517019+00:00", "last_updated": "2026-01-13T22:34:16.517019+00:00", "context": { "id": "01KEWQXP256RY7K1AAHCH69XPR", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of device_tracker.iphone16_willem_irk_irk" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-13T22:34:16.517841+00:00", "changed_variables": { "context": { "id": "01KEWQXP25J522AGEP12DSBHCX", "parent_id": "01KEWQXP256RY7K1AAHCH69XPR", "user_id": null } }, "result": { "choice": 1 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-13T22:34:16.517896+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-13T22:34:16.517923+00:00", "result": { "result": false } } ], "action/0/choose/1": [ { "path": "action/0/choose/1", "timestamp": "2026-01-13T22:34:16.517961+00:00", "result": { "result": true } } ], "action/0/choose/1/conditions/0": [ { "path": "action/0/choose/1/conditions/0", "timestamp": "2026-01-13T22:34:16.517988+00:00", "result": { "result": true } } ], "action/0/choose/1/sequence/0": [ { "path": "action/0/choose/1/sequence/0", "timestamp": "2026-01-13T22:34:16.518060+00:00", "result": { "result": true } } ], "action/0/choose/1/sequence/0/entity_id/0": [ { "path": "action/0/choose/1/sequence/0/entity_id/0", "timestamp": "2026-01-13T22:34:16.518093+00:00", "result": { "result": true, "state": "off", "wanted_state": "off" } } ], "action/0/choose/1/sequence/1": [ { "path": "action/0/choose/1/sequence/1", "timestamp": "2026-01-13T22:34:16.518143+00:00", "result": { "params": { "domain": "notify", "service": "mobile_app_iphone_van_willem", "service_data": { "message": "Welkom thuis" }, "target": {} }, "running_script": false } } ], "action/0/choose/1/sequence/2": [ { "path": "action/0/choose/1/sequence/2", "timestamp": "2026-01-13T22:34:16.763020+00:00", "result": { "params": { "domain": "water_heater", "service": "set_operation_mode", "service_data": { "operation_mode": "eco", "device_id": [ "0db7dd89cc13b1dee2490abad9450ca3" ] }, "target": { "device_id": [ "0db7dd89cc13b1dee2490abad9450ca3" ] } }, "running_script": false } } ], "action/0/choose/1/sequence/3": [ { "path": "action/0/choose/1/sequence/3", "timestamp": "2026-01-13T22:34:17.012652+00:00", "result": { "params": { "domain": "input_boolean", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "input_boolean.iemand_thuis" ] } }, "running_script": false } } ], "action/0/choose/1/sequence/4": [ { "path": "action/0/choose/1/sequence/4", "timestamp": "2026-01-13T22:34:17.013124+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.boiler_2" ] } }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-13T22:34:17.080431+00:00", "result": { "result": false } } ], "action/1/entity_id/0": [ { "path": "action/1/entity_id/0", "timestamp": "2026-01-13T22:34:17.080489+00:00", "result": { "result": false, "state": "off", "wanted_state": "on" } } ] }, "config": { "id": "1754287559178", "alias": "Auto Away & Thuis Boiler", "description": "Boiler en apparaten automatisch uit bij afwezigheid en aan bij thuiskomst", "triggers": [ { "trigger": "state", "entity_id": "binary_sensor.beweging_thuis", "from": "on", "to": "off", "for": "02:00:00", "id": "Niemand_thuis" }, { "trigger": "state", "entity_id": [ "device_tracker.iphone16_willem_irk_irk" ], "from": "not_home", "to": "home", "id": "Thuis" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "Niemand_thuis" ] }, { "condition": "state", "entity_id": "device_tracker.iphone16_willem_irk_irk", "state": "not_home" }, { "condition": "state", "entity_id": "input_boolean.verwarming_gastmodus", "state": "off" } ], "sequence": [ { "action": "switch.turn_off", "data": {}, "target": { "entity_id": "switch.boiler_2" } }, { "action": "script.speakers_woonkamer_standby" }, { "action": "script.voicebal_standby" }, { "data": { "operation_mode": "off" }, "action": "water_heater.set_operation_mode", "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } }, { "target": { "entity_id": "input_boolean.iemand_thuis" }, "action": "input_boolean.turn_off" }, { "action": "switch.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": "switch.boiler_2" } }, { "action": "script.verwarming_eco_2", "metadata": {}, "data": {} }, { "data": { "message": "Away modus ingeschakeld (boiler en verwarming uit)" }, "action": "notify.mobile_app_iphone_van_willem" }, { "action": "script.alle_lampen_uit", "metadata": {}, "data": {} } ] }, { "conditions": [ { "condition": "trigger", "id": "Thuis" } ], "sequence": [ { "condition": "state", "entity_id": "input_boolean.iemand_thuis", "state": "off" }, { "data": { "message": "Welkom thuis" }, "action": "notify.mobile_app_iphone_van_willem" }, { "data": { "operation_mode": "eco" }, "action": "water_heater.set_operation_mode", "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } }, { "target": { "entity_id": "input_boolean.iemand_thuis" }, "action": "input_boolean.turn_on" }, { "action": "switch.turn_on", "metadata": {}, "data": {}, "target": { "entity_id": "switch.boiler_2" } } ] } ] }, { "condition": "state", "entity_id": "input_boolean.verwarming_gastmodus", "state": "on" }, { "data": { "message": "Gastmodus staat aan" }, "action": "notify.mobile_app_iphone_van_willem" } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEWQXP25J522AGEP12DSBHCX", "parent_id": "01KEWQXP256RY7K1AAHCH69XPR", "user_id": null } }, "short_dict": { "last_step": "action/1/entity_id/0", "run_id": "0e9944a6cf88603b456794e9cc369bc6", "state": "stopped", "script_execution": "aborted", "timestamp": { "start": "2026-01-13T22:34:16.517609+00:00", "finish": "2026-01-13T22:34:17.081467+00:00" }, "domain": "automation", "item_id": "1754287559178", "trigger": "state of device_tracker.iphone16_willem_irk_irk" } }, { "extended_dict": { "last_step": "action/1/entity_id/0", "run_id": "d7bc870120187c277eaa8a5b2caf25be", "state": "stopped", "script_execution": "aborted", "timestamp": { "start": "2026-01-14T01:17:45.326816+00:00", "finish": "2026-01-14T01:17:45.327590+00:00" }, "domain": "automation", "item_id": "1754287559178", "trigger": "state of binary_sensor.beweging_thuis", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T01:17:45.326853+00:00", "changed_variables": { "this": { "entity_id": "automation.willem_niet_thuis", "state": "on", "attributes": { "id": "1754287559178", "last_triggered": "2026-01-13T22:34:16.517706+00:00", "mode": "single", "current": 0, "friendly_name": "Auto Away & Thuis Boiler" }, "last_changed": "2026-01-13T12:10:27.677971+00:00", "last_reported": "2026-01-13T22:34:17.080627+00:00", "last_updated": "2026-01-13T22:34:17.080627+00:00", "context": { "id": "01KEWQXP25J522AGEP12DSBHCX", "parent_id": "01KEWQXP256RY7K1AAHCH69XPR", "user_id": null } }, "trigger": { "id": "Niemand_thuis", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_thuis", "from_state": { "entity_id": "binary_sensor.beweging_thuis", "state": "on", "attributes": { "entity_id": [ "binary_sensor.beweging_toilet", "binary_sensor.beweging_zolder_ep_lite_occupancy", "binary_sensor.everything_presence_one_7f7364_mmwave", "binary_sensor.beweging_badkamer2_bezetting", "binary_sensor.beweging_keuken_bezetting" ], "device_class": "motion", "friendly_name": "Beweging thuis" }, "last_changed": "2026-01-13T23:16:44.998531+00:00", "last_reported": "2026-01-13T23:16:44.998531+00:00", "last_updated": "2026-01-13T23:16:44.998531+00:00", "context": { "id": "01KEWTBET5B0KJZJS38R65RMCN", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_thuis", "state": "off", "attributes": { "entity_id": [ "binary_sensor.beweging_toilet", "binary_sensor.beweging_zolder_ep_lite_occupancy", "binary_sensor.everything_presence_one_7f7364_mmwave", "binary_sensor.beweging_badkamer2_bezetting", "binary_sensor.beweging_keuken_bezetting" ], "device_class": "motion", "friendly_name": "Beweging thuis" }, "last_changed": "2026-01-13T23:17:45.324992+00:00", "last_reported": "2026-01-13T23:17:45.324992+00:00", "last_updated": "2026-01-13T23:17:45.324992+00:00", "context": { "id": "01KEWTD9QCQMCWH4GR077WR8AF", "parent_id": null, "user_id": null } }, "for": { "__type": "", "total_seconds": 7200.0 }, "attribute": null, "description": "state of binary_sensor.beweging_thuis" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T01:17:45.327141+00:00", "changed_variables": { "context": { "id": "01KEX190ZEFPR847C9ZNR82ZPM", "parent_id": "01KEWTD9QCQMCWH4GR077WR8AF", "user_id": null } } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T01:17:45.327230+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T01:17:45.327262+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/1": [ { "path": "action/0/choose/0/conditions/1", "timestamp": "2026-01-14T01:17:45.327290+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/1/entity_id/0": [ { "path": "action/0/choose/0/conditions/1/entity_id/0", "timestamp": "2026-01-14T01:17:45.327308+00:00", "result": { "result": false, "state": "home", "wanted_state": "not_home" } } ], "action/0/choose/1": [ { "path": "action/0/choose/1", "timestamp": "2026-01-14T01:17:45.327347+00:00", "result": { "result": false } } ], "action/0/choose/1/conditions/0": [ { "path": "action/0/choose/1/conditions/0", "timestamp": "2026-01-14T01:17:45.327364+00:00", "result": { "result": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-14T01:17:45.327405+00:00", "result": { "result": false } } ], "action/1/entity_id/0": [ { "path": "action/1/entity_id/0", "timestamp": "2026-01-14T01:17:45.327434+00:00", "result": { "result": false, "state": "off", "wanted_state": "on" } } ] }, "config": { "id": "1754287559178", "alias": "Auto Away & Thuis Boiler", "description": "Boiler en apparaten automatisch uit bij afwezigheid en aan bij thuiskomst", "triggers": [ { "trigger": "state", "entity_id": "binary_sensor.beweging_thuis", "from": "on", "to": "off", "for": "02:00:00", "id": "Niemand_thuis" }, { "trigger": "state", "entity_id": [ "device_tracker.iphone16_willem_irk_irk" ], "from": "not_home", "to": "home", "id": "Thuis" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "Niemand_thuis" ] }, { "condition": "state", "entity_id": "device_tracker.iphone16_willem_irk_irk", "state": "not_home" }, { "condition": "state", "entity_id": "input_boolean.verwarming_gastmodus", "state": "off" } ], "sequence": [ { "action": "switch.turn_off", "data": {}, "target": { "entity_id": "switch.boiler_2" } }, { "action": "script.speakers_woonkamer_standby" }, { "action": "script.voicebal_standby" }, { "data": { "operation_mode": "off" }, "action": "water_heater.set_operation_mode", "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } }, { "target": { "entity_id": "input_boolean.iemand_thuis" }, "action": "input_boolean.turn_off" }, { "action": "switch.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": "switch.boiler_2" } }, { "action": "script.verwarming_eco_2", "metadata": {}, "data": {} }, { "data": { "message": "Away modus ingeschakeld (boiler en verwarming uit)" }, "action": "notify.mobile_app_iphone_van_willem" }, { "action": "script.alle_lampen_uit", "metadata": {}, "data": {} } ] }, { "conditions": [ { "condition": "trigger", "id": "Thuis" } ], "sequence": [ { "condition": "state", "entity_id": "input_boolean.iemand_thuis", "state": "off" }, { "data": { "message": "Welkom thuis" }, "action": "notify.mobile_app_iphone_van_willem" }, { "data": { "operation_mode": "eco" }, "action": "water_heater.set_operation_mode", "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } }, { "target": { "entity_id": "input_boolean.iemand_thuis" }, "action": "input_boolean.turn_on" }, { "action": "switch.turn_on", "metadata": {}, "data": {}, "target": { "entity_id": "switch.boiler_2" } } ] } ] }, { "condition": "state", "entity_id": "input_boolean.verwarming_gastmodus", "state": "on" }, { "data": { "message": "Gastmodus staat aan" }, "action": "notify.mobile_app_iphone_van_willem" } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEX190ZEFPR847C9ZNR82ZPM", "parent_id": "01KEWTD9QCQMCWH4GR077WR8AF", "user_id": null } }, "short_dict": { "last_step": "action/1/entity_id/0", "run_id": "d7bc870120187c277eaa8a5b2caf25be", "state": "stopped", "script_execution": "aborted", "timestamp": { "start": "2026-01-14T01:17:45.326816+00:00", "finish": "2026-01-14T01:17:45.327590+00:00" }, "domain": "automation", "item_id": "1754287559178", "trigger": "state of binary_sensor.beweging_thuis" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/6", "run_id": "85520f5705fbbe7e079ba61b9ee2f67e", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-14T18:04:11.338449+00:00", "finish": "2026-01-14T18:04:14.560232+00:00" }, "domain": "automation", "item_id": "1754287559178", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "trigger": "state of binary_sensor.beweging_thuis", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T18:04:11.338514+00:00", "changed_variables": { "this": { "entity_id": "automation.willem_niet_thuis", "state": "on", "attributes": { "id": "1754287559178", "last_triggered": "2026-01-14T01:17:45.326929+00:00", "mode": "single", "current": 0, "friendly_name": "Auto Away & Thuis Boiler" }, "last_changed": "2026-01-14T15:48:56.985874+00:00", "last_reported": "2026-01-14T15:48:56.985874+00:00", "last_updated": "2026-01-14T15:48:56.985874+00:00", "context": { "id": "01KEYK47GSHNBS979A5NTDXG44", "parent_id": null, "user_id": null } }, "trigger": { "id": "Niemand_thuis", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_thuis", "from_state": { "entity_id": "binary_sensor.beweging_thuis", "state": "on", "attributes": { "entity_id": [ "binary_sensor.beweging_toilet", "binary_sensor.beweging_zolder_ep_lite_occupancy", "binary_sensor.everything_presence_one_7f7364_mmwave", "binary_sensor.beweging_badkamer2_bezetting", "binary_sensor.beweging_keuken_bezetting" ], "device_class": "motion", "friendly_name": "Beweging thuis" }, "last_changed": "2026-01-14T15:58:58.913501+00:00", "last_reported": "2026-01-14T15:58:58.913501+00:00", "last_updated": "2026-01-14T15:58:58.913501+00:00", "context": { "id": "01KEYKPKB1HCK4Z4N5FCN89AE8", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_thuis", "state": "off", "attributes": { "entity_id": [ "binary_sensor.beweging_toilet", "binary_sensor.beweging_zolder_ep_lite_occupancy", "binary_sensor.everything_presence_one_7f7364_mmwave", "binary_sensor.beweging_badkamer2_bezetting", "binary_sensor.beweging_keuken_bezetting" ], "device_class": "motion", "friendly_name": "Beweging thuis" }, "last_changed": "2026-01-14T16:04:11.334127+00:00", "last_reported": "2026-01-14T16:04:11.334127+00:00", "last_updated": "2026-01-14T16:04:11.334127+00:00", "context": { "id": "01KEYM04E5WG7G8A50JEKRNMHF", "parent_id": null, "user_id": null } }, "for": { "__type": "", "total_seconds": 7200.0 }, "attribute": null, "description": "state of binary_sensor.beweging_thuis" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T18:04:11.338876+00:00", "changed_variables": { "context": { "id": "01KEYTVVPA30Q9BJV5EZTN21DG", "parent_id": "01KEYM04E5WG7G8A50JEKRNMHF", "user_id": null } }, "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T18:04:11.339076+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T18:04:11.339122+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/1": [ { "path": "action/0/choose/0/conditions/1", "timestamp": "2026-01-14T18:04:11.339168+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/1/entity_id/0": [ { "path": "action/0/choose/0/conditions/1/entity_id/0", "timestamp": "2026-01-14T18:04:11.339223+00:00", "result": { "result": true, "state": "not_home", "wanted_state": "not_home" } } ], "action/0/choose/0/conditions/2": [ { "path": "action/0/choose/0/conditions/2", "timestamp": "2026-01-14T18:04:11.339276+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/2/entity_id/0": [ { "path": "action/0/choose/0/conditions/2/entity_id/0", "timestamp": "2026-01-14T18:04:11.339307+00:00", "result": { "result": true, "state": "off", "wanted_state": "off" } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-14T18:04:11.339430+00:00", "result": { "params": { "domain": "switch", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "switch.boiler_2" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/1": [ { "path": "action/0/choose/0/sequence/1", "timestamp": "2026-01-14T18:04:11.390109+00:00", "child_id": { "domain": "script", "item_id": "speakers_woonkamer_standby", "run_id": "3453eb9730553fb00ce6bebbfb619ab9" }, "result": { "params": { "domain": "script", "service": "speakers_woonkamer_standby", "service_data": {}, "target": {} }, "running_script": true } } ], "action/0/choose/0/sequence/2": [ { "path": "action/0/choose/0/sequence/2", "timestamp": "2026-01-14T18:04:11.477479+00:00", "child_id": { "domain": "script", "item_id": "voicebal_standby", "run_id": "6ac417a0d927e23f94fdd89da20e83a0" }, "result": { "params": { "domain": "script", "service": "voicebal_standby", "service_data": {}, "target": {} }, "running_script": true } } ], "action/0/choose/0/sequence/3": [ { "path": "action/0/choose/0/sequence/3", "timestamp": "2026-01-14T18:04:11.478983+00:00", "result": { "params": { "domain": "water_heater", "service": "set_operation_mode", "service_data": { "operation_mode": "off", "device_id": [ "0db7dd89cc13b1dee2490abad9450ca3" ] }, "target": { "device_id": [ "0db7dd89cc13b1dee2490abad9450ca3" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/4": [ { "path": "action/0/choose/0/sequence/4", "timestamp": "2026-01-14T18:04:12.420617+00:00", "result": { "params": { "domain": "input_boolean", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "input_boolean.iemand_thuis" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/5": [ { "path": "action/0/choose/0/sequence/5", "timestamp": "2026-01-14T18:04:12.421098+00:00", "result": { "params": { "domain": "switch", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "switch.boiler_2" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/6": [ { "path": "action/0/choose/0/sequence/6", "timestamp": "2026-01-14T18:04:12.476611+00:00", "child_id": { "domain": "script", "item_id": "verwarming_eco_2", "run_id": "16ebcb3c8c7a28827436e4e8a3c2c24f" }, "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "result": { "params": { "domain": "script", "service": "verwarming_eco_2", "service_data": {}, "target": {} }, "running_script": true } } ] }, "config": { "id": "1754287559178", "alias": "Auto Away & Thuis Boiler", "description": "Boiler en apparaten automatisch uit bij afwezigheid en aan bij thuiskomst", "triggers": [ { "trigger": "state", "entity_id": "binary_sensor.beweging_thuis", "from": "on", "to": "off", "for": "02:00:00", "id": "Niemand_thuis" }, { "trigger": "state", "entity_id": [ "device_tracker.iphone16_willem_irk_irk" ], "from": "not_home", "to": "home", "id": "Thuis" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "Niemand_thuis" ] }, { "condition": "state", "entity_id": "device_tracker.iphone16_willem_irk_irk", "state": "not_home" }, { "condition": "state", "entity_id": "input_boolean.verwarming_gastmodus", "state": "off" } ], "sequence": [ { "action": "switch.turn_off", "data": {}, "target": { "entity_id": "switch.boiler_2" } }, { "action": "script.speakers_woonkamer_standby" }, { "action": "script.voicebal_standby" }, { "data": { "operation_mode": "off" }, "action": "water_heater.set_operation_mode", "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } }, { "target": { "entity_id": "input_boolean.iemand_thuis" }, "action": "input_boolean.turn_off" }, { "action": "switch.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": "switch.boiler_2" } }, { "action": "script.verwarming_eco_2", "metadata": {}, "data": {} }, { "data": { "message": "Away modus ingeschakeld (boiler en verwarming uit)" }, "action": "notify.mobile_app_iphone_van_willem" }, { "action": "script.alle_lampen_uit", "metadata": {}, "data": {} } ] }, { "conditions": [ { "condition": "trigger", "id": "Thuis" } ], "sequence": [ { "condition": "state", "entity_id": "input_boolean.iemand_thuis", "state": "off" }, { "data": { "message": "Welkom thuis" }, "action": "notify.mobile_app_iphone_van_willem" }, { "data": { "operation_mode": "eco" }, "action": "water_heater.set_operation_mode", "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } }, { "target": { "entity_id": "input_boolean.iemand_thuis" }, "action": "input_boolean.turn_on" }, { "action": "switch.turn_on", "metadata": {}, "data": {}, "target": { "entity_id": "switch.boiler_2" } } ] } ] }, { "condition": "state", "entity_id": "input_boolean.verwarming_gastmodus", "state": "on" }, { "data": { "message": "Gastmodus staat aan" }, "action": "notify.mobile_app_iphone_van_willem" } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEYTVVPA30Q9BJV5EZTN21DG", "parent_id": "01KEYM04E5WG7G8A50JEKRNMHF", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/6", "run_id": "85520f5705fbbe7e079ba61b9ee2f67e", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-14T18:04:11.338449+00:00", "finish": "2026-01-14T18:04:14.560232+00:00" }, "domain": "automation", "item_id": "1754287559178", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "trigger": "state of binary_sensor.beweging_thuis" } }, { "extended_dict": { "last_step": "action/1/entity_id/0", "run_id": "760269db95c4c095c1e451334ba9263a", "state": "stopped", "script_execution": "aborted", "timestamp": { "start": "2026-01-16T08:41:02.957952+00:00", "finish": "2026-01-16T08:41:03.705608+00:00" }, "domain": "automation", "item_id": "1754287559178", "trigger": "state of device_tracker.iphone16_willem_irk_irk", "trace": { "trigger/1": [ { "path": "trigger/1", "timestamp": "2026-01-16T08:41:02.958003+00:00", "changed_variables": { "this": { "entity_id": "automation.willem_niet_thuis", "state": "on", "attributes": { "id": "1754287559178", "last_triggered": "2026-01-14T18:04:11.338592+00:00", "mode": "single", "current": 0, "friendly_name": "Auto Away & Thuis Boiler" }, "last_changed": "2026-01-15T08:04:17.789299+00:00", "last_reported": "2026-01-15T08:04:17.789299+00:00", "last_updated": "2026-01-15T08:04:17.789299+00:00", "context": { "id": "01KF0AY4QXTVDRGTK2960GBKRW", "parent_id": null, "user_id": null } }, "trigger": { "id": "Thuis", "idx": "1", "alias": null, "platform": "state", "entity_id": "device_tracker.iphone16_willem_irk_irk", "from_state": { "entity_id": "device_tracker.iphone16_willem_irk_irk", "state": "not_home", "attributes": { "source_type": "bluetooth_le", "friendly_name": "Iphone16_Willem_irk" }, "last_changed": "2026-01-15T08:04:10.163743+00:00", "last_reported": "2026-01-15T08:04:10.163743+00:00", "last_updated": "2026-01-15T08:04:10.163743+00:00", "context": { "id": "01KF0AXX9K5F74F2RZ8M41WANG", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "device_tracker.iphone16_willem_irk_irk", "state": "home", "attributes": { "source_type": "bluetooth_le", "current_address": "5B:1A:8E:62:98:44", "source": "88:13:BF:20:94:6E", "friendly_name": "Iphone16_Willem_irk" }, "last_changed": "2026-01-16T08:41:02.957254+00:00", "last_reported": "2026-01-16T08:41:02.957254+00:00", "last_updated": "2026-01-16T08:41:02.957254+00:00", "context": { "id": "01KF2ZE57DPNCMA4AP8EY4EQQC", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of device_tracker.iphone16_willem_irk_irk" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-16T08:41:02.958213+00:00", "changed_variables": { "context": { "id": "01KF2ZE57DJ4WSVER0TEQ93Z14", "parent_id": "01KF2ZE57DPNCMA4AP8EY4EQQC", "user_id": null } }, "result": { "choice": 1 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-16T08:41:02.958348+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-16T08:41:02.958375+00:00", "result": { "result": false } } ], "action/0/choose/1": [ { "path": "action/0/choose/1", "timestamp": "2026-01-16T08:41:02.958408+00:00", "result": { "result": true } } ], "action/0/choose/1/conditions/0": [ { "path": "action/0/choose/1/conditions/0", "timestamp": "2026-01-16T08:41:02.958424+00:00", "result": { "result": true } } ], "action/0/choose/1/sequence/0": [ { "path": "action/0/choose/1/sequence/0", "timestamp": "2026-01-16T08:41:02.958499+00:00", "result": { "result": true } } ], "action/0/choose/1/sequence/0/entity_id/0": [ { "path": "action/0/choose/1/sequence/0/entity_id/0", "timestamp": "2026-01-16T08:41:02.958546+00:00", "result": { "result": true, "state": "off", "wanted_state": "off" } } ], "action/0/choose/1/sequence/1": [ { "path": "action/0/choose/1/sequence/1", "timestamp": "2026-01-16T08:41:02.958597+00:00", "result": { "params": { "domain": "notify", "service": "mobile_app_iphone_van_willem", "service_data": { "message": "Welkom thuis" }, "target": {} }, "running_script": false } } ], "action/0/choose/1/sequence/2": [ { "path": "action/0/choose/1/sequence/2", "timestamp": "2026-01-16T08:41:03.225721+00:00", "result": { "params": { "domain": "water_heater", "service": "set_operation_mode", "service_data": { "operation_mode": "eco", "device_id": [ "0db7dd89cc13b1dee2490abad9450ca3" ] }, "target": { "device_id": [ "0db7dd89cc13b1dee2490abad9450ca3" ] } }, "running_script": false } } ], "action/0/choose/1/sequence/3": [ { "path": "action/0/choose/1/sequence/3", "timestamp": "2026-01-16T08:41:03.622209+00:00", "result": { "params": { "domain": "input_boolean", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "input_boolean.iemand_thuis" ] } }, "running_script": false } } ], "action/0/choose/1/sequence/4": [ { "path": "action/0/choose/1/sequence/4", "timestamp": "2026-01-16T08:41:03.622712+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.boiler_2" ] } }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-16T08:41:03.704877+00:00", "result": { "result": false } } ], "action/1/entity_id/0": [ { "path": "action/1/entity_id/0", "timestamp": "2026-01-16T08:41:03.704967+00:00", "result": { "result": false, "state": "off", "wanted_state": "on" } } ] }, "config": { "id": "1754287559178", "alias": "Auto Away & Thuis Boiler", "description": "Boiler en apparaten automatisch uit bij afwezigheid en aan bij thuiskomst", "triggers": [ { "trigger": "state", "entity_id": "binary_sensor.beweging_thuis", "from": "on", "to": "off", "for": "02:00:00", "id": "Niemand_thuis" }, { "trigger": "state", "entity_id": [ "device_tracker.iphone16_willem_irk_irk" ], "from": "not_home", "to": "home", "id": "Thuis" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "Niemand_thuis" ] }, { "condition": "state", "entity_id": "device_tracker.iphone16_willem_irk_irk", "state": "not_home" }, { "condition": "state", "entity_id": "input_boolean.verwarming_gastmodus", "state": "off" } ], "sequence": [ { "action": "switch.turn_off", "data": {}, "target": { "entity_id": "switch.boiler_2" } }, { "action": "script.speakers_woonkamer_standby" }, { "action": "script.voicebal_standby" }, { "data": { "operation_mode": "off" }, "action": "water_heater.set_operation_mode", "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } }, { "target": { "entity_id": "input_boolean.iemand_thuis" }, "action": "input_boolean.turn_off" }, { "action": "switch.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": "switch.boiler_2" } }, { "action": "script.verwarming_eco_2", "metadata": {}, "data": {} }, { "data": { "message": "Away modus ingeschakeld (boiler en verwarming uit)" }, "action": "notify.mobile_app_iphone_van_willem" }, { "action": "script.alle_lampen_uit", "metadata": {}, "data": {} } ] }, { "conditions": [ { "condition": "trigger", "id": "Thuis" } ], "sequence": [ { "condition": "state", "entity_id": "input_boolean.iemand_thuis", "state": "off" }, { "data": { "message": "Welkom thuis" }, "action": "notify.mobile_app_iphone_van_willem" }, { "data": { "operation_mode": "eco" }, "action": "water_heater.set_operation_mode", "target": { "device_id": "0db7dd89cc13b1dee2490abad9450ca3" } }, { "target": { "entity_id": "input_boolean.iemand_thuis" }, "action": "input_boolean.turn_on" }, { "action": "switch.turn_on", "metadata": {}, "data": {}, "target": { "entity_id": "switch.boiler_2" } } ] } ] }, { "condition": "state", "entity_id": "input_boolean.verwarming_gastmodus", "state": "on" }, { "data": { "message": "Gastmodus staat aan" }, "action": "notify.mobile_app_iphone_van_willem" } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF2ZE57DJ4WSVER0TEQ93Z14", "parent_id": "01KF2ZE57DPNCMA4AP8EY4EQQC", "user_id": null } }, "short_dict": { "last_step": "action/1/entity_id/0", "run_id": "760269db95c4c095c1e451334ba9263a", "state": "stopped", "script_execution": "aborted", "timestamp": { "start": "2026-01-16T08:41:02.957952+00:00", "finish": "2026-01-16T08:41:03.705608+00:00" }, "domain": "automation", "item_id": "1754287559178", "trigger": "state of device_tracker.iphone16_willem_irk_irk" } } ], "automation.1752821542310": [ { "extended_dict": { "last_step": "action/3", "run_id": "6f5c206a936b377e80939b34644972e8", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T08:43:31.606261+00:00", "finish": "2026-01-16T08:43:31.704265+00:00" }, "domain": "automation", "item_id": "1752821542310", "trigger": "state of binary_sensor.beweging_zolder_ep_lite_target_1_active", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-16T08:43:31.606304+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_woonkamer_scherm_aan", "state": "on", "attributes": { "id": "1752821542310", "last_triggered": "2026-01-14T15:59:42.265520+00:00", "mode": "single", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Woonkamer [BP]" }, "last_changed": "2026-01-15T08:04:17.789039+00:00", "last_reported": "2026-01-15T08:04:17.789039+00:00", "last_updated": "2026-01-15T08:04:17.789039+00:00", "context": { "id": "01KF0AY4QXFJWJ6922V4PJX09G", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "device", "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_1_active", "from_state": { "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_1_active", "state": "off", "attributes": { "friendly_name": "Beweging woonkamer Target 1 Active" }, "last_changed": "2026-01-15T08:04:06.634500+00:00", "last_reported": "2026-01-15T08:04:06.634500+00:00", "last_updated": "2026-01-15T08:04:06.634500+00:00", "context": { "id": "01KF0AXSVAP9HJQK66E89Y4Z2G", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_1_active", "state": "on", "attributes": { "friendly_name": "Beweging woonkamer Target 1 Active" }, "last_changed": "2026-01-16T08:43:31.583280+00:00", "last_reported": "2026-01-16T08:43:31.583280+00:00", "last_updated": "2026-01-16T08:43:31.583280+00:00", "context": { "id": "01KF2ZJPBZMD9YXAV8PSWZHW3Z", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_zolder_ep_lite_target_1_active" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-16T08:43:31.606569+00:00", "changed_variables": { "context": { "id": "01KF2ZJPCPR2P4CPTGJM6E710A", "parent_id": "01KF2ZJPBZMD9YXAV8PSWZHW3Z", "user_id": null } } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-16T08:43:31.606941+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.unnamed_room_statuslampje" ] } }, "running_script": false } } ], "action/2": [ { "path": "action/2", "timestamp": "2026-01-16T08:43:31.698148+00:00", "result": { "params": { "domain": "light", "service": "turn_on", "service_data": { "brightness_pct": 75, "entity_id": [ "light.esphome_web_0bac48_screen" ] }, "target": { "entity_id": [ "light.esphome_web_0bac48_screen" ] } }, "running_script": false } } ], "action/3": [ { "path": "action/3", "timestamp": "2026-01-16T08:43:31.698424+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.esphome_web_0bac48_speaker_enable" ] } }, "running_script": false } } ] }, "config": { "id": "1752821542310", "alias": "beweging woonkamer - scherm aan", "description": "", "triggers": [ { "type": "turned_on", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "7740d741aba09369422b3ff84df3832e", "domain": "binary_sensor", "trigger": "device" } ], "conditions": [], "actions": [ { "type": "turn_off", "device_id": "550ea07771d45eb70d342e229f4019ba", "entity_id": "f1484c61ee2d4a3d5f6f1c9328090d61", "domain": "switch" }, { "action": "switch.turn_on", "metadata": {}, "data": {}, "target": { "entity_id": "switch.unnamed_room_statuslampje" } }, { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 75 }, "target": { "entity_id": "light.esphome_web_0bac48_screen" } }, { "action": "switch.turn_on", "metadata": {}, "data": {}, "target": { "entity_id": "switch.esphome_web_0bac48_speaker_enable" } } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF2ZJPCPR2P4CPTGJM6E710A", "parent_id": "01KF2ZJPBZMD9YXAV8PSWZHW3Z", "user_id": null } }, "short_dict": { "last_step": "action/3", "run_id": "6f5c206a936b377e80939b34644972e8", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T08:43:31.606261+00:00", "finish": "2026-01-16T08:43:31.704265+00:00" }, "domain": "automation", "item_id": "1752821542310", "trigger": "state of binary_sensor.beweging_zolder_ep_lite_target_1_active" } }, { "extended_dict": { "last_step": "action/3", "run_id": "98c4aee940135cee9056f40f423a662e", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T08:44:52.060253+00:00", "finish": "2026-01-16T08:44:52.119356+00:00" }, "domain": "automation", "item_id": "1752821542310", "trigger": "state of binary_sensor.beweging_zolder_ep_lite_target_1_active", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-16T08:44:52.060300+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_woonkamer_scherm_aan", "state": "on", "attributes": { "id": "1752821542310", "last_triggered": "2026-01-16T08:43:31.606371+00:00", "mode": "single", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Woonkamer [BP]" }, "last_changed": "2026-01-15T08:04:17.789039+00:00", "last_reported": "2026-01-16T08:43:31.698601+00:00", "last_updated": "2026-01-16T08:43:31.698601+00:00", "context": { "id": "01KF2ZJPCPR2P4CPTGJM6E710A", "parent_id": "01KF2ZJPBZMD9YXAV8PSWZHW3Z", "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "device", "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_1_active", "from_state": { "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_1_active", "state": "off", "attributes": { "friendly_name": "Beweging woonkamer Target 1 Active" }, "last_changed": "2026-01-16T08:44:21.108275+00:00", "last_reported": "2026-01-16T08:44:21.108275+00:00", "last_updated": "2026-01-16T08:44:21.108275+00:00", "context": { "id": "01KF2ZM6QM895RZJA4B4KRAGC6", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_1_active", "state": "on", "attributes": { "friendly_name": "Beweging woonkamer Target 1 Active" }, "last_changed": "2026-01-16T08:44:52.041524+00:00", "last_reported": "2026-01-16T08:44:52.041524+00:00", "last_updated": "2026-01-16T08:44:52.041524+00:00", "context": { "id": "01KF2ZN4Y9VFXXETE4GAGZQMR0", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_zolder_ep_lite_target_1_active" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-16T08:44:52.060535+00:00", "changed_variables": { "context": { "id": "01KF2ZN4YW66NVWQ198Q77EE2W", "parent_id": "01KF2ZN4Y9VFXXETE4GAGZQMR0", "user_id": null } } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-16T08:44:52.060852+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.unnamed_room_statuslampje" ] } }, "running_script": false } } ], "action/2": [ { "path": "action/2", "timestamp": "2026-01-16T08:44:52.113872+00:00", "result": { "params": { "domain": "light", "service": "turn_on", "service_data": { "brightness_pct": 75, "entity_id": [ "light.esphome_web_0bac48_screen" ] }, "target": { "entity_id": [ "light.esphome_web_0bac48_screen" ] } }, "running_script": false } } ], "action/3": [ { "path": "action/3", "timestamp": "2026-01-16T08:44:52.114186+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.esphome_web_0bac48_speaker_enable" ] } }, "running_script": false } } ] }, "config": { "id": "1752821542310", "alias": "beweging woonkamer - scherm aan", "description": "", "triggers": [ { "type": "turned_on", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "7740d741aba09369422b3ff84df3832e", "domain": "binary_sensor", "trigger": "device" } ], "conditions": [], "actions": [ { "type": "turn_off", "device_id": "550ea07771d45eb70d342e229f4019ba", "entity_id": "f1484c61ee2d4a3d5f6f1c9328090d61", "domain": "switch" }, { "action": "switch.turn_on", "metadata": {}, "data": {}, "target": { "entity_id": "switch.unnamed_room_statuslampje" } }, { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 75 }, "target": { "entity_id": "light.esphome_web_0bac48_screen" } }, { "action": "switch.turn_on", "metadata": {}, "data": {}, "target": { "entity_id": "switch.esphome_web_0bac48_speaker_enable" } } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF2ZN4YW66NVWQ198Q77EE2W", "parent_id": "01KF2ZN4Y9VFXXETE4GAGZQMR0", "user_id": null } }, "short_dict": { "last_step": "action/3", "run_id": "98c4aee940135cee9056f40f423a662e", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T08:44:52.060253+00:00", "finish": "2026-01-16T08:44:52.119356+00:00" }, "domain": "automation", "item_id": "1752821542310", "trigger": "state of binary_sensor.beweging_zolder_ep_lite_target_1_active" } }, { "extended_dict": { "last_step": "action/3", "run_id": "645998bc5e0c395d938769bd5b625525", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T08:47:48.387926+00:00", "finish": "2026-01-16T08:47:48.444400+00:00" }, "domain": "automation", "item_id": "1752821542310", "trigger": "state of binary_sensor.beweging_zolder_ep_lite_target_1_active", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-16T08:47:48.387977+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_woonkamer_scherm_aan", "state": "on", "attributes": { "id": "1752821542310", "last_triggered": "2026-01-16T08:44:52.060361+00:00", "mode": "single", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Woonkamer [BP]" }, "last_changed": "2026-01-15T08:04:17.789039+00:00", "last_reported": "2026-01-16T08:44:52.114367+00:00", "last_updated": "2026-01-16T08:44:52.114367+00:00", "context": { "id": "01KF2ZN4YW66NVWQ198Q77EE2W", "parent_id": "01KF2ZN4Y9VFXXETE4GAGZQMR0", "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "device", "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_1_active", "from_state": { "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_1_active", "state": "off", "attributes": { "friendly_name": "Beweging woonkamer Target 1 Active" }, "last_changed": "2026-01-16T08:45:26.951227+00:00", "last_reported": "2026-01-16T08:45:26.951227+00:00", "last_updated": "2026-01-16T08:45:26.951227+00:00", "context": { "id": "01KF2ZP717GXHPF7YKE1XJ00JM", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_1_active", "state": "on", "attributes": { "friendly_name": "Beweging woonkamer Target 1 Active" }, "last_changed": "2026-01-16T08:47:48.361626+00:00", "last_reported": "2026-01-16T08:47:48.361626+00:00", "last_updated": "2026-01-16T08:47:48.361626+00:00", "context": { "id": "01KF2ZTH49SQ5XSF2E7F8SWTHB", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_zolder_ep_lite_target_1_active" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-16T08:47:48.388275+00:00", "changed_variables": { "context": { "id": "01KF2ZTH53W1DNJQCHG681DXST", "parent_id": "01KF2ZTH49SQ5XSF2E7F8SWTHB", "user_id": null } } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-16T08:47:48.388664+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.unnamed_room_statuslampje" ] } }, "running_script": false } } ], "action/2": [ { "path": "action/2", "timestamp": "2026-01-16T08:47:48.439051+00:00", "result": { "params": { "domain": "light", "service": "turn_on", "service_data": { "brightness_pct": 75, "entity_id": [ "light.esphome_web_0bac48_screen" ] }, "target": { "entity_id": [ "light.esphome_web_0bac48_screen" ] } }, "running_script": false } } ], "action/3": [ { "path": "action/3", "timestamp": "2026-01-16T08:47:48.439435+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.esphome_web_0bac48_speaker_enable" ] } }, "running_script": false } } ] }, "config": { "id": "1752821542310", "alias": "beweging woonkamer - scherm aan", "description": "", "triggers": [ { "type": "turned_on", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "7740d741aba09369422b3ff84df3832e", "domain": "binary_sensor", "trigger": "device" } ], "conditions": [], "actions": [ { "type": "turn_off", "device_id": "550ea07771d45eb70d342e229f4019ba", "entity_id": "f1484c61ee2d4a3d5f6f1c9328090d61", "domain": "switch" }, { "action": "switch.turn_on", "metadata": {}, "data": {}, "target": { "entity_id": "switch.unnamed_room_statuslampje" } }, { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 75 }, "target": { "entity_id": "light.esphome_web_0bac48_screen" } }, { "action": "switch.turn_on", "metadata": {}, "data": {}, "target": { "entity_id": "switch.esphome_web_0bac48_speaker_enable" } } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF2ZTH53W1DNJQCHG681DXST", "parent_id": "01KF2ZTH49SQ5XSF2E7F8SWTHB", "user_id": null } }, "short_dict": { "last_step": "action/3", "run_id": "645998bc5e0c395d938769bd5b625525", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T08:47:48.387926+00:00", "finish": "2026-01-16T08:47:48.444400+00:00" }, "domain": "automation", "item_id": "1752821542310", "trigger": "state of binary_sensor.beweging_zolder_ep_lite_target_1_active" } }, { "extended_dict": { "last_step": "action/3", "run_id": "fc49be3056e9f680ea4ad1450cd956c9", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T08:50:17.879781+00:00", "finish": "2026-01-16T08:50:17.940371+00:00" }, "domain": "automation", "item_id": "1752821542310", "trigger": "state of binary_sensor.beweging_zolder_ep_lite_target_1_active", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-16T08:50:17.879830+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_woonkamer_scherm_aan", "state": "on", "attributes": { "id": "1752821542310", "last_triggered": "2026-01-16T08:47:48.388052+00:00", "mode": "single", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Woonkamer [BP]" }, "last_changed": "2026-01-15T08:04:17.789039+00:00", "last_reported": "2026-01-16T08:47:48.439676+00:00", "last_updated": "2026-01-16T08:47:48.439676+00:00", "context": { "id": "01KF2ZTH53W1DNJQCHG681DXST", "parent_id": "01KF2ZTH49SQ5XSF2E7F8SWTHB", "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "device", "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_1_active", "from_state": { "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_1_active", "state": "off", "attributes": { "friendly_name": "Beweging woonkamer Target 1 Active" }, "last_changed": "2026-01-16T08:48:05.462221+00:00", "last_reported": "2026-01-16T08:48:05.462221+00:00", "last_updated": "2026-01-16T08:48:05.462221+00:00", "context": { "id": "01KF2ZV1TPTZCFX860T2ZJM1VN", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_1_active", "state": "on", "attributes": { "friendly_name": "Beweging woonkamer Target 1 Active" }, "last_changed": "2026-01-16T08:50:17.861954+00:00", "last_reported": "2026-01-16T08:50:17.861954+00:00", "last_updated": "2026-01-16T08:50:17.861954+00:00", "context": { "id": "01KF2ZZ345GT68DQ5ZADQ0RHKR", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_zolder_ep_lite_target_1_active" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-16T08:50:17.880089+00:00", "changed_variables": { "context": { "id": "01KF2ZZ34QAKY56WJ20D1FXNH7", "parent_id": "01KF2ZZ345GT68DQ5ZADQ0RHKR", "user_id": null } } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-16T08:50:17.880582+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.unnamed_room_statuslampje" ] } }, "running_script": false } } ], "action/2": [ { "path": "action/2", "timestamp": "2026-01-16T08:50:17.935639+00:00", "result": { "params": { "domain": "light", "service": "turn_on", "service_data": { "brightness_pct": 75, "entity_id": [ "light.esphome_web_0bac48_screen" ] }, "target": { "entity_id": [ "light.esphome_web_0bac48_screen" ] } }, "running_script": false } } ], "action/3": [ { "path": "action/3", "timestamp": "2026-01-16T08:50:17.935935+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.esphome_web_0bac48_speaker_enable" ] } }, "running_script": false } } ] }, "config": { "id": "1752821542310", "alias": "beweging woonkamer - scherm aan", "description": "", "triggers": [ { "type": "turned_on", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "7740d741aba09369422b3ff84df3832e", "domain": "binary_sensor", "trigger": "device" } ], "conditions": [], "actions": [ { "type": "turn_off", "device_id": "550ea07771d45eb70d342e229f4019ba", "entity_id": "f1484c61ee2d4a3d5f6f1c9328090d61", "domain": "switch" }, { "action": "switch.turn_on", "metadata": {}, "data": {}, "target": { "entity_id": "switch.unnamed_room_statuslampje" } }, { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 75 }, "target": { "entity_id": "light.esphome_web_0bac48_screen" } }, { "action": "switch.turn_on", "metadata": {}, "data": {}, "target": { "entity_id": "switch.esphome_web_0bac48_speaker_enable" } } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF2ZZ34QAKY56WJ20D1FXNH7", "parent_id": "01KF2ZZ345GT68DQ5ZADQ0RHKR", "user_id": null } }, "short_dict": { "last_step": "action/3", "run_id": "fc49be3056e9f680ea4ad1450cd956c9", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T08:50:17.879781+00:00", "finish": "2026-01-16T08:50:17.940371+00:00" }, "domain": "automation", "item_id": "1752821542310", "trigger": "state of binary_sensor.beweging_zolder_ep_lite_target_1_active" } }, { "extended_dict": { "last_step": "action/3", "run_id": "2cd0e3d097e12b82c4ca6fb00a87e276", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T09:16:23.839731+00:00", "finish": "2026-01-16T09:16:23.912672+00:00" }, "domain": "automation", "item_id": "1752821542310", "trigger": "state of binary_sensor.beweging_zolder_ep_lite_target_1_active", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-16T09:16:23.839784+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_woonkamer_scherm_aan", "state": "on", "attributes": { "id": "1752821542310", "last_triggered": "2026-01-16T08:50:17.879897+00:00", "mode": "single", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Woonkamer [BP]" }, "last_changed": "2026-01-15T08:04:17.789039+00:00", "last_reported": "2026-01-16T08:50:17.936109+00:00", "last_updated": "2026-01-16T08:50:17.936109+00:00", "context": { "id": "01KF2ZZ34QAKY56WJ20D1FXNH7", "parent_id": "01KF2ZZ345GT68DQ5ZADQ0RHKR", "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "device", "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_1_active", "from_state": { "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_1_active", "state": "off", "attributes": { "friendly_name": "Beweging woonkamer Target 1 Active" }, "last_changed": "2026-01-16T09:07:46.273403+00:00", "last_reported": "2026-01-16T09:07:46.273403+00:00", "last_updated": "2026-01-16T09:07:46.273403+00:00", "context": { "id": "01KF30Z2Z12MFXY3TCJ2512204", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_1_active", "state": "on", "attributes": { "friendly_name": "Beweging woonkamer Target 1 Active" }, "last_changed": "2026-01-16T09:16:23.821636+00:00", "last_reported": "2026-01-16T09:16:23.821636+00:00", "last_updated": "2026-01-16T09:16:23.821636+00:00", "context": { "id": "01KF31EWCDQCYB15NZZS3HKBPY", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_zolder_ep_lite_target_1_active" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-16T09:16:23.840057+00:00", "changed_variables": { "context": { "id": "01KF31EWCZFQ5RZ3TWC4M3GWX3", "parent_id": "01KF31EWCDQCYB15NZZS3HKBPY", "user_id": null } } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-16T09:16:23.840397+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.unnamed_room_statuslampje" ] } }, "running_script": false } } ], "action/2": [ { "path": "action/2", "timestamp": "2026-01-16T09:16:23.905890+00:00", "result": { "params": { "domain": "light", "service": "turn_on", "service_data": { "brightness_pct": 75, "entity_id": [ "light.esphome_web_0bac48_screen" ] }, "target": { "entity_id": [ "light.esphome_web_0bac48_screen" ] } }, "running_script": false } } ], "action/3": [ { "path": "action/3", "timestamp": "2026-01-16T09:16:23.906711+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.esphome_web_0bac48_speaker_enable" ] } }, "running_script": false } } ] }, "config": { "id": "1752821542310", "alias": "beweging woonkamer - scherm aan", "description": "", "triggers": [ { "type": "turned_on", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "7740d741aba09369422b3ff84df3832e", "domain": "binary_sensor", "trigger": "device" } ], "conditions": [], "actions": [ { "type": "turn_off", "device_id": "550ea07771d45eb70d342e229f4019ba", "entity_id": "f1484c61ee2d4a3d5f6f1c9328090d61", "domain": "switch" }, { "action": "switch.turn_on", "metadata": {}, "data": {}, "target": { "entity_id": "switch.unnamed_room_statuslampje" } }, { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 75 }, "target": { "entity_id": "light.esphome_web_0bac48_screen" } }, { "action": "switch.turn_on", "metadata": {}, "data": {}, "target": { "entity_id": "switch.esphome_web_0bac48_speaker_enable" } } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF31EWCZFQ5RZ3TWC4M3GWX3", "parent_id": "01KF31EWCDQCYB15NZZS3HKBPY", "user_id": null } }, "short_dict": { "last_step": "action/3", "run_id": "2cd0e3d097e12b82c4ca6fb00a87e276", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T09:16:23.839731+00:00", "finish": "2026-01-16T09:16:23.912672+00:00" }, "domain": "automation", "item_id": "1752821542310", "trigger": "state of binary_sensor.beweging_zolder_ep_lite_target_1_active" } } ], "automation.1752820768273": [ { "extended_dict": { "last_step": "condition/0", "run_id": "f925c11efc172d9d8f9b45a833dbe9a2", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T09:42:10.022708+00:00", "finish": "2026-01-16T09:42:10.022789+00:00" }, "domain": "automation", "item_id": "1752820768273", "trigger": "numeric state of sensor.beweging_zolder_ep_lite_target_1_speed", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-16T09:42:10.022742+00:00", "changed_variables": { "this": { "entity_id": "automation.fan_follow", "state": "on", "attributes": { "id": "1752820768273", "last_triggered": "2025-08-27T17:00:27.455608+00:00", "mode": "single", "current": 0, "friendly_name": "fan follow" }, "last_changed": "2026-01-15T08:04:17.788906+00:00", "last_reported": "2026-01-15T08:04:17.788906+00:00", "last_updated": "2026-01-15T08:04:17.788906+00:00", "context": { "id": "01KF0AY4QW4Y5C2GGDNQRCSB5Z", "parent_id": null, "user_id": null } }, "trigger": { "id": "Move", "idx": "0", "alias": null, "platform": "device", "entity_id": "sensor.beweging_zolder_ep_lite_target_1_speed", "below": 50.0, "above": 0.0, "from_state": { "entity_id": "sensor.beweging_zolder_ep_lite_target_1_speed", "state": "0.0", "attributes": { "state_class": "measurement", "unit_of_measurement": "m/s", "device_class": "speed", "friendly_name": "Beweging woonkamer Target 1 Speed" }, "last_changed": "2026-01-16T09:42:04.317675+00:00", "last_reported": "2026-01-16T09:42:04.317675+00:00", "last_updated": "2026-01-16T09:42:04.317675+00:00", "context": { "id": "01KF32XWRXBP90J0WDYQ4MKGRH", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.beweging_zolder_ep_lite_target_1_speed", "state": "0.0799999982118607", "attributes": { "state_class": "measurement", "unit_of_measurement": "m/s", "device_class": "speed", "friendly_name": "Beweging woonkamer Target 1 Speed" }, "last_changed": "2026-01-16T09:42:10.017156+00:00", "last_reported": "2026-01-16T09:42:10.017156+00:00", "last_updated": "2026-01-16T09:42:10.017156+00:00", "context": { "id": "01KF32Y2B15XGEM5FTMKHN5JX2", "parent_id": null, "user_id": null } }, "for": null, "description": "numeric state of sensor.beweging_zolder_ep_lite_target_1_speed" } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-16T09:42:10.022759+00:00", "result": { "result": false, "state": "off", "wanted_state": "on" } } ] }, "config": { "id": "1752820768273", "alias": "fan follow", "description": "", "triggers": [ { "type": "speed", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "7a0b45e086ea4a1bb197508d5dd5705f", "domain": "sensor", "trigger": "device", "above": 0, "below": 50, "id": "Move" }, { "type": "turned_off", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "7740d741aba09369422b3ff84df3832e", "domain": "binary_sensor", "trigger": "device", "id": "Nomove" } ], "conditions": [ { "condition": "device", "device_id": "65efdd1635426f4f499786410bc83b34", "domain": "fan", "entity_id": "76345f123ecacf22501b3f6ad8cd9eb6", "type": "is_on" }, { "condition": "state", "entity_id": "input_boolean.fan_follow_me", "state": "on" } ], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "Move" ] } ], "sequence": [ { "if": [ { "condition": "state", "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_2_active", "state": "on", "for": { "hours": 0, "minutes": 1, "seconds": 0 } } ], "then": [ { "if": [ { "condition": "numeric_state", "entity_id": "sensor.beweging_zolder_ep_lite_target_1_angle", "below": "sensor.beweging_zolder_ep_lite_target_2_angle" } ], "then": [ { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_1_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_left" } }, { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_2_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_right" } } ], "else": [ { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_2_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_left" } }, { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_1_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_right" } } ] }, { "type": "turn_on", "device_id": "65efdd1635426f4f499786410bc83b34", "entity_id": "2848fde3b6de331fc8ad9849b30c3317", "domain": "switch" } ], "else": [ { "type": "turn_off", "device_id": "65efdd1635426f4f499786410bc83b34", "entity_id": "2848fde3b6de331fc8ad9849b30c3317", "domain": "switch" }, { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_1_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_angle" } } ] } ] }, { "conditions": [ { "condition": "trigger", "id": [ "Nomove" ] } ], "sequence": [ { "type": "turn_on", "device_id": "65efdd1635426f4f499786410bc83b34", "entity_id": "2848fde3b6de331fc8ad9849b30c3317", "domain": "switch" } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF32Y2B61C5068KRGSDAAKN0", "parent_id": "01KF32Y2B15XGEM5FTMKHN5JX2", "user_id": null } }, "short_dict": { "last_step": "condition/0", "run_id": "f925c11efc172d9d8f9b45a833dbe9a2", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T09:42:10.022708+00:00", "finish": "2026-01-16T09:42:10.022789+00:00" }, "domain": "automation", "item_id": "1752820768273", "trigger": "numeric state of sensor.beweging_zolder_ep_lite_target_1_speed" } }, { "extended_dict": { "last_step": "condition/0", "run_id": "6e5a036e54307c50c836a97d6f7e46ae", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T09:42:44.886869+00:00", "finish": "2026-01-16T09:42:44.886938+00:00" }, "domain": "automation", "item_id": "1752820768273", "trigger": "numeric state of sensor.beweging_zolder_ep_lite_target_1_speed", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-16T09:42:44.886898+00:00", "changed_variables": { "this": { "entity_id": "automation.fan_follow", "state": "on", "attributes": { "id": "1752820768273", "last_triggered": "2025-08-27T17:00:27.455608+00:00", "mode": "single", "current": 0, "friendly_name": "fan follow" }, "last_changed": "2026-01-15T08:04:17.788906+00:00", "last_reported": "2026-01-15T08:04:17.788906+00:00", "last_updated": "2026-01-15T08:04:17.788906+00:00", "context": { "id": "01KF0AY4QW4Y5C2GGDNQRCSB5Z", "parent_id": null, "user_id": null } }, "trigger": { "id": "Move", "idx": "0", "alias": null, "platform": "device", "entity_id": "sensor.beweging_zolder_ep_lite_target_1_speed", "below": 50.0, "above": 0.0, "from_state": { "entity_id": "sensor.beweging_zolder_ep_lite_target_1_speed", "state": "0.0", "attributes": { "state_class": "measurement", "unit_of_measurement": "m/s", "device_class": "speed", "friendly_name": "Beweging woonkamer Target 1 Speed" }, "last_changed": "2026-01-16T09:42:29.985240+00:00", "last_reported": "2026-01-16T09:42:29.985240+00:00", "last_updated": "2026-01-16T09:42:29.985240+00:00", "context": { "id": "01KF32YNV1S9Q0FR4CAD72B97W", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.beweging_zolder_ep_lite_target_1_speed", "state": "0.0799999982118607", "attributes": { "state_class": "measurement", "unit_of_measurement": "m/s", "device_class": "speed", "friendly_name": "Beweging woonkamer Target 1 Speed" }, "last_changed": "2026-01-16T09:42:44.882662+00:00", "last_reported": "2026-01-16T09:42:44.882662+00:00", "last_updated": "2026-01-16T09:42:44.882662+00:00", "context": { "id": "01KF32Z4CJJVZ58G1MHRZ3066A", "parent_id": null, "user_id": null } }, "for": null, "description": "numeric state of sensor.beweging_zolder_ep_lite_target_1_speed" } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-16T09:42:44.886914+00:00", "result": { "result": false, "state": "off", "wanted_state": "on" } } ] }, "config": { "id": "1752820768273", "alias": "fan follow", "description": "", "triggers": [ { "type": "speed", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "7a0b45e086ea4a1bb197508d5dd5705f", "domain": "sensor", "trigger": "device", "above": 0, "below": 50, "id": "Move" }, { "type": "turned_off", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "7740d741aba09369422b3ff84df3832e", "domain": "binary_sensor", "trigger": "device", "id": "Nomove" } ], "conditions": [ { "condition": "device", "device_id": "65efdd1635426f4f499786410bc83b34", "domain": "fan", "entity_id": "76345f123ecacf22501b3f6ad8cd9eb6", "type": "is_on" }, { "condition": "state", "entity_id": "input_boolean.fan_follow_me", "state": "on" } ], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "Move" ] } ], "sequence": [ { "if": [ { "condition": "state", "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_2_active", "state": "on", "for": { "hours": 0, "minutes": 1, "seconds": 0 } } ], "then": [ { "if": [ { "condition": "numeric_state", "entity_id": "sensor.beweging_zolder_ep_lite_target_1_angle", "below": "sensor.beweging_zolder_ep_lite_target_2_angle" } ], "then": [ { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_1_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_left" } }, { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_2_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_right" } } ], "else": [ { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_2_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_left" } }, { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_1_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_right" } } ] }, { "type": "turn_on", "device_id": "65efdd1635426f4f499786410bc83b34", "entity_id": "2848fde3b6de331fc8ad9849b30c3317", "domain": "switch" } ], "else": [ { "type": "turn_off", "device_id": "65efdd1635426f4f499786410bc83b34", "entity_id": "2848fde3b6de331fc8ad9849b30c3317", "domain": "switch" }, { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_1_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_angle" } } ] } ] }, { "conditions": [ { "condition": "trigger", "id": [ "Nomove" ] } ], "sequence": [ { "type": "turn_on", "device_id": "65efdd1635426f4f499786410bc83b34", "entity_id": "2848fde3b6de331fc8ad9849b30c3317", "domain": "switch" } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF32Z4CPX6BJ0A0XMMZZ7B81", "parent_id": "01KF32Z4CJJVZ58G1MHRZ3066A", "user_id": null } }, "short_dict": { "last_step": "condition/0", "run_id": "6e5a036e54307c50c836a97d6f7e46ae", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T09:42:44.886869+00:00", "finish": "2026-01-16T09:42:44.886938+00:00" }, "domain": "automation", "item_id": "1752820768273", "trigger": "numeric state of sensor.beweging_zolder_ep_lite_target_1_speed" } }, { "extended_dict": { "last_step": "condition/0", "run_id": "6e489c91d4928b83961c76072448d47d", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T09:42:55.295058+00:00", "finish": "2026-01-16T09:42:55.295129+00:00" }, "domain": "automation", "item_id": "1752820768273", "trigger": "numeric state of sensor.beweging_zolder_ep_lite_target_1_speed", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-16T09:42:55.295087+00:00", "changed_variables": { "this": { "entity_id": "automation.fan_follow", "state": "on", "attributes": { "id": "1752820768273", "last_triggered": "2025-08-27T17:00:27.455608+00:00", "mode": "single", "current": 0, "friendly_name": "fan follow" }, "last_changed": "2026-01-15T08:04:17.788906+00:00", "last_reported": "2026-01-15T08:04:17.788906+00:00", "last_updated": "2026-01-15T08:04:17.788906+00:00", "context": { "id": "01KF0AY4QW4Y5C2GGDNQRCSB5Z", "parent_id": null, "user_id": null } }, "trigger": { "id": "Move", "idx": "0", "alias": null, "platform": "device", "entity_id": "sensor.beweging_zolder_ep_lite_target_1_speed", "below": 50.0, "above": 0.0, "from_state": { "entity_id": "sensor.beweging_zolder_ep_lite_target_1_speed", "state": "0.0", "attributes": { "state_class": "measurement", "unit_of_measurement": "m/s", "device_class": "speed", "friendly_name": "Beweging woonkamer Target 1 Speed" }, "last_changed": "2026-01-16T09:42:45.363137+00:00", "last_reported": "2026-01-16T09:42:45.363137+00:00", "last_updated": "2026-01-16T09:42:45.363137+00:00", "context": { "id": "01KF32Z4VKB7RP2H22J4WFT9QZ", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.beweging_zolder_ep_lite_target_1_speed", "state": "0.0799999982118607", "attributes": { "state_class": "measurement", "unit_of_measurement": "m/s", "device_class": "speed", "friendly_name": "Beweging woonkamer Target 1 Speed" }, "last_changed": "2026-01-16T09:42:55.290226+00:00", "last_reported": "2026-01-16T09:42:55.290226+00:00", "last_updated": "2026-01-16T09:42:55.290226+00:00", "context": { "id": "01KF32ZEHT3DS2BPK5Z7RBN6BF", "parent_id": null, "user_id": null } }, "for": null, "description": "numeric state of sensor.beweging_zolder_ep_lite_target_1_speed" } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-16T09:42:55.295103+00:00", "result": { "result": false, "state": "off", "wanted_state": "on" } } ] }, "config": { "id": "1752820768273", "alias": "fan follow", "description": "", "triggers": [ { "type": "speed", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "7a0b45e086ea4a1bb197508d5dd5705f", "domain": "sensor", "trigger": "device", "above": 0, "below": 50, "id": "Move" }, { "type": "turned_off", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "7740d741aba09369422b3ff84df3832e", "domain": "binary_sensor", "trigger": "device", "id": "Nomove" } ], "conditions": [ { "condition": "device", "device_id": "65efdd1635426f4f499786410bc83b34", "domain": "fan", "entity_id": "76345f123ecacf22501b3f6ad8cd9eb6", "type": "is_on" }, { "condition": "state", "entity_id": "input_boolean.fan_follow_me", "state": "on" } ], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "Move" ] } ], "sequence": [ { "if": [ { "condition": "state", "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_2_active", "state": "on", "for": { "hours": 0, "minutes": 1, "seconds": 0 } } ], "then": [ { "if": [ { "condition": "numeric_state", "entity_id": "sensor.beweging_zolder_ep_lite_target_1_angle", "below": "sensor.beweging_zolder_ep_lite_target_2_angle" } ], "then": [ { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_1_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_left" } }, { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_2_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_right" } } ], "else": [ { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_2_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_left" } }, { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_1_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_right" } } ] }, { "type": "turn_on", "device_id": "65efdd1635426f4f499786410bc83b34", "entity_id": "2848fde3b6de331fc8ad9849b30c3317", "domain": "switch" } ], "else": [ { "type": "turn_off", "device_id": "65efdd1635426f4f499786410bc83b34", "entity_id": "2848fde3b6de331fc8ad9849b30c3317", "domain": "switch" }, { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_1_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_angle" } } ] } ] }, { "conditions": [ { "condition": "trigger", "id": [ "Nomove" ] } ], "sequence": [ { "type": "turn_on", "device_id": "65efdd1635426f4f499786410bc83b34", "entity_id": "2848fde3b6de331fc8ad9849b30c3317", "domain": "switch" } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF32ZEHZY2QRSA46G0XP1Q4H", "parent_id": "01KF32ZEHT3DS2BPK5Z7RBN6BF", "user_id": null } }, "short_dict": { "last_step": "condition/0", "run_id": "6e489c91d4928b83961c76072448d47d", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T09:42:55.295058+00:00", "finish": "2026-01-16T09:42:55.295129+00:00" }, "domain": "automation", "item_id": "1752820768273", "trigger": "numeric state of sensor.beweging_zolder_ep_lite_target_1_speed" } }, { "extended_dict": { "last_step": "condition/0", "run_id": "7824a434723401f5a3da08f0f2ca8304", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T09:43:44.438964+00:00", "finish": "2026-01-16T09:43:44.439035+00:00" }, "domain": "automation", "item_id": "1752820768273", "trigger": "numeric state of sensor.beweging_zolder_ep_lite_target_1_speed", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-16T09:43:44.438994+00:00", "changed_variables": { "this": { "entity_id": "automation.fan_follow", "state": "on", "attributes": { "id": "1752820768273", "last_triggered": "2025-08-27T17:00:27.455608+00:00", "mode": "single", "current": 0, "friendly_name": "fan follow" }, "last_changed": "2026-01-15T08:04:17.788906+00:00", "last_reported": "2026-01-15T08:04:17.788906+00:00", "last_updated": "2026-01-15T08:04:17.788906+00:00", "context": { "id": "01KF0AY4QW4Y5C2GGDNQRCSB5Z", "parent_id": null, "user_id": null } }, "trigger": { "id": "Move", "idx": "0", "alias": null, "platform": "device", "entity_id": "sensor.beweging_zolder_ep_lite_target_1_speed", "below": 50.0, "above": 0.0, "from_state": { "entity_id": "sensor.beweging_zolder_ep_lite_target_1_speed", "state": "0.0", "attributes": { "state_class": "measurement", "unit_of_measurement": "m/s", "device_class": "speed", "friendly_name": "Beweging woonkamer Target 1 Speed" }, "last_changed": "2026-01-16T09:43:12.413042+00:00", "last_reported": "2026-01-16T09:43:12.413042+00:00", "last_updated": "2026-01-16T09:43:12.413042+00:00", "context": { "id": "01KF32ZZ8X970MAM0PJJ9CNG94", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.beweging_zolder_ep_lite_target_1_speed", "state": "0.0799999982118607", "attributes": { "state_class": "measurement", "unit_of_measurement": "m/s", "device_class": "speed", "friendly_name": "Beweging woonkamer Target 1 Speed" }, "last_changed": "2026-01-16T09:43:44.434593+00:00", "last_reported": "2026-01-16T09:43:44.434593+00:00", "last_updated": "2026-01-16T09:43:44.434593+00:00", "context": { "id": "01KF330YHJEN3P5PYMBS85MBE0", "parent_id": null, "user_id": null } }, "for": null, "description": "numeric state of sensor.beweging_zolder_ep_lite_target_1_speed" } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-16T09:43:44.439010+00:00", "result": { "result": false, "state": "off", "wanted_state": "on" } } ] }, "config": { "id": "1752820768273", "alias": "fan follow", "description": "", "triggers": [ { "type": "speed", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "7a0b45e086ea4a1bb197508d5dd5705f", "domain": "sensor", "trigger": "device", "above": 0, "below": 50, "id": "Move" }, { "type": "turned_off", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "7740d741aba09369422b3ff84df3832e", "domain": "binary_sensor", "trigger": "device", "id": "Nomove" } ], "conditions": [ { "condition": "device", "device_id": "65efdd1635426f4f499786410bc83b34", "domain": "fan", "entity_id": "76345f123ecacf22501b3f6ad8cd9eb6", "type": "is_on" }, { "condition": "state", "entity_id": "input_boolean.fan_follow_me", "state": "on" } ], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "Move" ] } ], "sequence": [ { "if": [ { "condition": "state", "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_2_active", "state": "on", "for": { "hours": 0, "minutes": 1, "seconds": 0 } } ], "then": [ { "if": [ { "condition": "numeric_state", "entity_id": "sensor.beweging_zolder_ep_lite_target_1_angle", "below": "sensor.beweging_zolder_ep_lite_target_2_angle" } ], "then": [ { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_1_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_left" } }, { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_2_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_right" } } ], "else": [ { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_2_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_left" } }, { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_1_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_right" } } ] }, { "type": "turn_on", "device_id": "65efdd1635426f4f499786410bc83b34", "entity_id": "2848fde3b6de331fc8ad9849b30c3317", "domain": "switch" } ], "else": [ { "type": "turn_off", "device_id": "65efdd1635426f4f499786410bc83b34", "entity_id": "2848fde3b6de331fc8ad9849b30c3317", "domain": "switch" }, { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_1_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_angle" } } ] } ] }, { "conditions": [ { "condition": "trigger", "id": [ "Nomove" ] } ], "sequence": [ { "type": "turn_on", "device_id": "65efdd1635426f4f499786410bc83b34", "entity_id": "2848fde3b6de331fc8ad9849b30c3317", "domain": "switch" } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF330YHPBCZC932ZS7V7A78H", "parent_id": "01KF330YHJEN3P5PYMBS85MBE0", "user_id": null } }, "short_dict": { "last_step": "condition/0", "run_id": "7824a434723401f5a3da08f0f2ca8304", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T09:43:44.438964+00:00", "finish": "2026-01-16T09:43:44.439035+00:00" }, "domain": "automation", "item_id": "1752820768273", "trigger": "numeric state of sensor.beweging_zolder_ep_lite_target_1_speed" } }, { "extended_dict": { "last_step": "condition/0", "run_id": "c45b59b9caf4738717e9ac464ad4db46", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T09:43:52.642013+00:00", "finish": "2026-01-16T09:43:52.642084+00:00" }, "domain": "automation", "item_id": "1752820768273", "trigger": "numeric state of sensor.beweging_zolder_ep_lite_target_1_speed", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-16T09:43:52.642041+00:00", "changed_variables": { "this": { "entity_id": "automation.fan_follow", "state": "on", "attributes": { "id": "1752820768273", "last_triggered": "2025-08-27T17:00:27.455608+00:00", "mode": "single", "current": 0, "friendly_name": "fan follow" }, "last_changed": "2026-01-15T08:04:17.788906+00:00", "last_reported": "2026-01-15T08:04:17.788906+00:00", "last_updated": "2026-01-15T08:04:17.788906+00:00", "context": { "id": "01KF0AY4QW4Y5C2GGDNQRCSB5Z", "parent_id": null, "user_id": null } }, "trigger": { "id": "Move", "idx": "0", "alias": null, "platform": "device", "entity_id": "sensor.beweging_zolder_ep_lite_target_1_speed", "below": 50.0, "above": 0.0, "from_state": { "entity_id": "sensor.beweging_zolder_ep_lite_target_1_speed", "state": "0.0", "attributes": { "state_class": "measurement", "unit_of_measurement": "m/s", "device_class": "speed", "friendly_name": "Beweging woonkamer Target 1 Speed" }, "last_changed": "2026-01-16T09:43:46.199708+00:00", "last_reported": "2026-01-16T09:43:46.199708+00:00", "last_updated": "2026-01-16T09:43:46.199708+00:00", "context": { "id": "01KF33108Q2MBDD0QG2FENCNPH", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.beweging_zolder_ep_lite_target_1_speed", "state": "0.0799999982118607", "attributes": { "state_class": "measurement", "unit_of_measurement": "m/s", "device_class": "speed", "friendly_name": "Beweging woonkamer Target 1 Speed" }, "last_changed": "2026-01-16T09:43:52.637745+00:00", "last_reported": "2026-01-16T09:43:52.637745+00:00", "last_updated": "2026-01-16T09:43:52.637745+00:00", "context": { "id": "01KF3316HX1R18GCYQ9QSJ44P5", "parent_id": null, "user_id": null } }, "for": null, "description": "numeric state of sensor.beweging_zolder_ep_lite_target_1_speed" } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-16T09:43:52.642057+00:00", "result": { "result": false, "state": "off", "wanted_state": "on" } } ] }, "config": { "id": "1752820768273", "alias": "fan follow", "description": "", "triggers": [ { "type": "speed", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "7a0b45e086ea4a1bb197508d5dd5705f", "domain": "sensor", "trigger": "device", "above": 0, "below": 50, "id": "Move" }, { "type": "turned_off", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "7740d741aba09369422b3ff84df3832e", "domain": "binary_sensor", "trigger": "device", "id": "Nomove" } ], "conditions": [ { "condition": "device", "device_id": "65efdd1635426f4f499786410bc83b34", "domain": "fan", "entity_id": "76345f123ecacf22501b3f6ad8cd9eb6", "type": "is_on" }, { "condition": "state", "entity_id": "input_boolean.fan_follow_me", "state": "on" } ], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "Move" ] } ], "sequence": [ { "if": [ { "condition": "state", "entity_id": "binary_sensor.beweging_zolder_ep_lite_target_2_active", "state": "on", "for": { "hours": 0, "minutes": 1, "seconds": 0 } } ], "then": [ { "if": [ { "condition": "numeric_state", "entity_id": "sensor.beweging_zolder_ep_lite_target_1_angle", "below": "sensor.beweging_zolder_ep_lite_target_2_angle" } ], "then": [ { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_1_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_left" } }, { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_2_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_right" } } ], "else": [ { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_2_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_left" } }, { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_1_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_oscillation_angle_right" } } ] }, { "type": "turn_on", "device_id": "65efdd1635426f4f499786410bc83b34", "entity_id": "2848fde3b6de331fc8ad9849b30c3317", "domain": "switch" } ], "else": [ { "type": "turn_off", "device_id": "65efdd1635426f4f499786410bc83b34", "entity_id": "2848fde3b6de331fc8ad9849b30c3317", "domain": "switch" }, { "action": "number.set_value", "metadata": {}, "data": { "value": "{{states('sensor.beweging_zolder_ep_lite_target_1_angle') | round * -1 }}" }, "target": { "entity_id": "number.air_circulator_horizontal_angle" } } ] } ] }, { "conditions": [ { "condition": "trigger", "id": [ "Nomove" ] } ], "sequence": [ { "type": "turn_on", "device_id": "65efdd1635426f4f499786410bc83b34", "entity_id": "2848fde3b6de331fc8ad9849b30c3317", "domain": "switch" } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF3316J1YKJN5080GFNHFQET", "parent_id": "01KF3316HX1R18GCYQ9QSJ44P5", "user_id": null } }, "short_dict": { "last_step": "condition/0", "run_id": "c45b59b9caf4738717e9ac464ad4db46", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T09:43:52.642013+00:00", "finish": "2026-01-16T09:43:52.642084+00:00" }, "domain": "automation", "item_id": "1752820768273", "trigger": "numeric state of sensor.beweging_zolder_ep_lite_target_1_speed" } } ], "automation.1755669352381": [ { "extended_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "7a1e4c9045eeba6ca9f8f29ad21a7d2d", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T13:11:12.561037+00:00", "finish": "2026-01-14T13:17:19.722460+00:00" }, "domain": "automation", "item_id": "1755669352381", "trigger": "state of binary_sensor.beweging_badkamer2_bezetting", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T13:11:12.561179+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_badkamer_bp", "state": "on", "attributes": { "id": "1755669352381", "last_triggered": "2026-01-14T11:43:13.917942+00:00", "mode": "restart", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Badkamer" }, "last_changed": "2026-01-13T12:10:27.678539+00:00", "last_reported": "2026-01-14T11:49:15.367963+00:00", "last_updated": "2026-01-14T11:49:15.367963+00:00", "context": { "id": "01KEY5DAZ7BHRN34AQFNW4DDSR", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "off", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T11:44:15.043443+00:00", "last_reported": "2026-01-14T11:44:15.043443+00:00", "last_updated": "2026-01-14T11:44:15.043443+00:00", "context": { "id": "01KEY545P34N5ETAMWJ7JP45V9", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "on", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T13:11:12.558784+00:00", "last_reported": "2026-01-14T13:11:12.558784+00:00", "last_updated": "2026-01-14T13:11:12.558784+00:00", "context": { "id": "01KEYA3CXE940D8RXATSCXGE93", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_badkamer2_bezetting" }, "target_entity": "light.lamp_badkamer", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.badkamer_timer", "entity_domain": "light", "turn_off_blocker_entity": "input_boolean.in_de_douche", "target_off_entity": null, "sun_condition": "Always" } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T13:11:12.561219+00:00", "result": { "result": true, "entities": [ "light.lamp_badkamer" ] } } ], "condition/1": [ { "path": "condition/1", "timestamp": "2026-01-14T13:11:12.561327+00:00", "result": { "result": true, "entities": [] } } ], "condition/2": [ { "path": "condition/2", "timestamp": "2026-01-14T13:11:12.561425+00:00", "result": { "result": true, "entities": [] } } ], "condition/3": [ { "path": "condition/3", "timestamp": "2026-01-14T13:11:12.561541+00:00", "result": { "result": true, "entities": [ "sun.sun" ] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T13:11:12.561877+00:00", "changed_variables": { "context": { "id": "01KEYA3CXH83DNPM17QC218AWE", "parent_id": "01KEYA3CXE940D8RXATSCXGE93", "user_id": null } }, "result": { "params": { "domain": "homeassistant", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "light.lamp_badkamer" ] } }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-14T13:11:12.736880+00:00", "changed_variables": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "on", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T13:11:12.558784+00:00", "last_reported": "2026-01-14T13:11:12.558784+00:00", "last_updated": "2026-01-14T13:11:12.558784+00:00", "context": { "id": "01KEYA3CXE940D8RXATSCXGE93", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "off", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T13:12:19.591351+00:00", "last_reported": "2026-01-14T13:12:19.591351+00:00", "last_updated": "2026-01-14T13:12:19.591351+00:00", "context": { "id": "01KEYA5EC7MDN4SVBJQDHV19XA", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_badkamer2_bezetting" } } }, "result": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "on", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T13:11:12.558784+00:00", "last_reported": "2026-01-14T13:11:12.558784+00:00", "last_updated": "2026-01-14T13:11:12.558784+00:00", "context": { "id": "01KEYA3CXE940D8RXATSCXGE93", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "off", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T13:12:19.591351+00:00", "last_reported": "2026-01-14T13:12:19.591351+00:00", "last_updated": "2026-01-14T13:12:19.591351+00:00", "context": { "id": "01KEYA5EC7MDN4SVBJQDHV19XA", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_badkamer2_bezetting" } } } } ], "action/2": [ { "path": "action/2", "timestamp": "2026-01-14T13:12:19.593960+00:00", "result": { "choice": 2 } } ], "action/2/choose/0": [ { "path": "action/2/choose/0", "timestamp": "2026-01-14T13:12:19.594011+00:00", "result": { "result": false } } ], "action/2/choose/0/conditions/0": [ { "path": "action/2/choose/0/conditions/0", "timestamp": "2026-01-14T13:12:19.594054+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/1": [ { "path": "action/2/choose/1", "timestamp": "2026-01-14T13:12:19.594182+00:00", "result": { "result": false } } ], "action/2/choose/1/conditions/0": [ { "path": "action/2/choose/1/conditions/0", "timestamp": "2026-01-14T13:12:19.594222+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/2": [ { "path": "action/2/choose/2", "timestamp": "2026-01-14T13:12:19.594311+00:00", "result": { "result": true } } ], "action/2/choose/2/conditions/0": [ { "path": "action/2/choose/2/conditions/0", "timestamp": "2026-01-14T13:12:19.594346+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/0": [ { "path": "action/2/choose/2/sequence/0", "timestamp": "2026-01-14T13:12:19.594551+00:00", "result": { "delay": 300.0, "done": true } } ], "action/2/choose/2/sequence/1": [ { "path": "action/2/choose/2/sequence/1", "timestamp": "2026-01-14T13:17:19.595772+00:00", "result": { "result": true, "entities": [ "input_boolean.in_de_douche" ] } } ], "action/2/choose/2/sequence/2": [ { "path": "action/2/choose/2/sequence/2", "timestamp": "2026-01-14T13:17:19.596027+00:00", "result": { "params": { "domain": "homeassistant", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.lamp_badkamer" ] } }, "running_script": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "target_entity": "light.lamp_badkamer", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.badkamer_timer", "entity_domain": "{{ states[target_entity].domain }}", "turn_off_blocker_entity": "input_boolean.in_de_douche", "target_off_entity": null, "sun_condition": "Always" }, "triggers": { "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "to": "on" }, "actions": [ { "entity_id": "light.lamp_badkamer", "action": "homeassistant.turn_on" }, { "wait_for_trigger": { "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from": "on", "to": "off" } }, { "choose": [ { "alias": "Motion wait not defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity == none }}" } ], "sequence": [ { "entity_id": "light.lamp_badkamer", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait not defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity != none }}" } ], "sequence": [ { "entity_id": null, "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity == none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": "light.lamp_badkamer", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity != none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": null, "action": "homeassistant.turn_off" } ] } ] } ], "conditions": [ { "condition": "template", "alias": "Check for illuminance conditions", "value_template": "{% set illuminance_defined = illuminance_currently != none and illuminance_cutoff != none %} {% set illuminance_defined_and_low = (illuminance_defined and (states(illuminance_currently) | int(0) < states(illuminance_cutoff) | int(0))) %}\n{% set target_entity_domain_supports_on_state_check = entity_domain != 'scene' and entity_domain != 'script' %} {% set target_entity_is_scene = entity_domain == 'scene' %} {% set scene_target_entities = state_attr(target_entity, 'entity_id') %} {% set singular_scene_entity_is_on = scene_target_entities is not none and scene_target_entities | count == 1 and scene_target_entities | first == 'on' %} {{ ( target_entity_domain_supports_on_state_check and states(target_entity) == 'on') or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and not illuminance_defined) or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and not illuminance_defined) or ( target_entity_is_scene and singular_scene_entity_is_on) }}\n" }, { "condition": "template", "alias": "Check for blocker entity", "value_template": "{{ (blocker_entity == none) or (states(blocker_entity) == 'off') }}" }, { "condition": "template", "alias": "Check for time limits", "value_template": "{% set current_time = now().strftime(\"%H:%M\") %}\n{% if time_limit_before == none and time_limit_after == none %} true {% endif %}\n{% if time_limit_before != none and time_limit_after == none %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {{ current_time_is_before_limit }} {% elif time_limit_before == none and time_limit_after != none %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {{ current_time_is_after_limit }} {% endif %}\n{% if time_limit_before != none and time_limit_after != none %} {% set before_limit_is_tomorrow = states(time_limit_before) < states(time_limit_after) %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {% set time_window_spans_midnight = states(time_limit_after) > states(time_limit_before) %}\n {% if time_window_spans_midnight != none and time_window_spans_midnight and before_limit_is_tomorrow %}\n {{ current_time_is_after_limit or current_time_is_before_limit }}\n {% elif time_window_spans_midnight != none and not time_window_spans_midnight %}\n {{ current_time_is_before_limit and current_time_is_after_limit }}\n {% endif %}\n{% endif %}\n" }, { "condition": "template", "alias": "Check for sun state", "value_template": "{# Prevent breaking when no sun condition is set in existing automations #} {% if not sun_condition is defined %} {% set sun_condition = 'Always' %} {% endif %} {# Get current sun state #} {% set current_sun_condition = states['sun.sun'].state %}\n{# Checks for current sun state #} {% set sun_state_is_below_horizon = current_sun_condition == 'below_horizon' %} {% set sun_state_is_above_horizon = current_sun_condition == 'above_horizon' %}\n{# Check to see if a condition for sunstate is set by user #} {% set no_sun_condition = sun_condition is defined and sun_condition == 'Always' %} {# Check to see if the user wants automation to trigger below horizon #} {% set sun_condition_is_below_horizon = sun_condition == 'Below horizon' %} {# Check to see if the user wants automation to trigger above horizon #} {% set sun_condition_is_above_horizon = sun_condition == 'Above horizon' %}\n{# Checks to see if sunstate matches up with users condition #} {% set sun_condition_below_horizon_match = sun_state_is_below_horizon and sun_condition_is_below_horizon %} {% set sun_condition_above_horizon_match = sun_state_is_above_horizon and sun_condition_is_above_horizon %} {% set sun_condition_matching = sun_condition_below_horizon_match or sun_condition_above_horizon_match or no_sun_condition %} {{ sun_condition_matching }}\n{# Debug values: (uncomment to check in template dev tool) ## Set at top of template: {% set sun_condition = 'Above horizon' %} Current sun condition: {{current_sun_condition}} Sun state is below horizon: {{ sun_state_is_below_horizon }} Sun state is above horizon: {{ sun_state_is_above_horizon }} Sun condition is set to always: {{ sun_condition_always }} Sun condition is below horizon: {{ sun_condition_is_below_horizon }} Sun condition is above horizon: {{ sun_condition_is_above_horizon }} Sun condition is below horizon match: {{ sun_condition_below_horizon_match }} Sun condition is above horizon match: {{ sun_condition_above_horizon_match }} Sun condition is a match: {{ sun_condition_matching }} #}\n" } ], "id": "1755669352381", "alias": "Beweging Badkamer [BP]", "description": "" }, "blueprint_inputs": { "id": "1755669352381", "alias": "Beweging Badkamer [BP]", "description": "", "use_blueprint": { "path": "freakshock88/motion_illuminance_activated_entity.yaml", "input": { "motion_sensor": "binary_sensor.beweging_badkamer2_bezetting", "target_entity": "light.lamp_badkamer", "no_motion_wait": "input_number.badkamer_timer", "turn_off_blocker_entity": "input_boolean.in_de_douche" } } }, "context": { "id": "01KEYA3CXH83DNPM17QC218AWE", "parent_id": "01KEYA3CXE940D8RXATSCXGE93", "user_id": null } }, "short_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "7a1e4c9045eeba6ca9f8f29ad21a7d2d", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T13:11:12.561037+00:00", "finish": "2026-01-14T13:17:19.722460+00:00" }, "domain": "automation", "item_id": "1755669352381", "trigger": "state of binary_sensor.beweging_badkamer2_bezetting" } }, { "extended_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "91f29ccf18de2e133084e83528666e08", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T14:05:35.728781+00:00", "finish": "2026-01-14T14:11:59.864625+00:00" }, "domain": "automation", "item_id": "1755669352381", "trigger": "state of binary_sensor.beweging_badkamer2_bezetting", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T14:05:35.728891+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_badkamer_bp", "state": "on", "attributes": { "id": "1755669352381", "last_triggered": "2026-01-14T13:11:12.561664+00:00", "mode": "restart", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Badkamer" }, "last_changed": "2026-01-13T12:10:27.678539+00:00", "last_reported": "2026-01-14T13:17:19.720935+00:00", "last_updated": "2026-01-14T13:17:19.720935+00:00", "context": { "id": "01KEYAEKF80A8TW5EDM08BEBMB", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "off", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T13:12:19.591351+00:00", "last_reported": "2026-01-14T13:12:19.591351+00:00", "last_updated": "2026-01-14T13:12:19.591351+00:00", "context": { "id": "01KEYA5EC7MDN4SVBJQDHV19XA", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "on", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T14:05:35.720901+00:00", "last_reported": "2026-01-14T14:05:35.720901+00:00", "last_updated": "2026-01-14T14:05:35.720901+00:00", "context": { "id": "01KEYD6ZK8C21NQDNSQQMQEM0K", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_badkamer2_bezetting" }, "target_entity": "light.lamp_badkamer", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.badkamer_timer", "entity_domain": "light", "turn_off_blocker_entity": "input_boolean.in_de_douche", "target_off_entity": null, "sun_condition": "Always" } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T14:05:35.728910+00:00", "result": { "result": true, "entities": [ "light.lamp_badkamer" ] } } ], "condition/1": [ { "path": "condition/1", "timestamp": "2026-01-14T14:05:35.728991+00:00", "result": { "result": true, "entities": [] } } ], "condition/2": [ { "path": "condition/2", "timestamp": "2026-01-14T14:05:35.729031+00:00", "result": { "result": true, "entities": [] } } ], "condition/3": [ { "path": "condition/3", "timestamp": "2026-01-14T14:05:35.729116+00:00", "result": { "result": true, "entities": [ "sun.sun" ] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T14:05:35.729358+00:00", "changed_variables": { "context": { "id": "01KEYD6ZKGC8H07XCN5YVVXB5H", "parent_id": "01KEYD6ZK8C21NQDNSQQMQEM0K", "user_id": null } }, "result": { "params": { "domain": "homeassistant", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "light.lamp_badkamer" ] } }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-14T14:05:35.888928+00:00", "changed_variables": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "on", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T14:05:35.720901+00:00", "last_reported": "2026-01-14T14:05:35.720901+00:00", "last_updated": "2026-01-14T14:05:35.720901+00:00", "context": { "id": "01KEYD6ZK8C21NQDNSQQMQEM0K", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "off", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T14:06:59.729161+00:00", "last_reported": "2026-01-14T14:06:59.729161+00:00", "last_updated": "2026-01-14T14:06:59.729161+00:00", "context": { "id": "01KEYD9HMH4HJ7TZ515FHBTA89", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_badkamer2_bezetting" } } }, "result": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "on", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T14:05:35.720901+00:00", "last_reported": "2026-01-14T14:05:35.720901+00:00", "last_updated": "2026-01-14T14:05:35.720901+00:00", "context": { "id": "01KEYD6ZK8C21NQDNSQQMQEM0K", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "off", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T14:06:59.729161+00:00", "last_reported": "2026-01-14T14:06:59.729161+00:00", "last_updated": "2026-01-14T14:06:59.729161+00:00", "context": { "id": "01KEYD9HMH4HJ7TZ515FHBTA89", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_badkamer2_bezetting" } } } } ], "action/2": [ { "path": "action/2", "timestamp": "2026-01-14T14:06:59.733074+00:00", "result": { "choice": 2 } } ], "action/2/choose/0": [ { "path": "action/2/choose/0", "timestamp": "2026-01-14T14:06:59.733184+00:00", "result": { "result": false } } ], "action/2/choose/0/conditions/0": [ { "path": "action/2/choose/0/conditions/0", "timestamp": "2026-01-14T14:06:59.733276+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/1": [ { "path": "action/2/choose/1", "timestamp": "2026-01-14T14:06:59.733488+00:00", "result": { "result": false } } ], "action/2/choose/1/conditions/0": [ { "path": "action/2/choose/1/conditions/0", "timestamp": "2026-01-14T14:06:59.733549+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/2": [ { "path": "action/2/choose/2", "timestamp": "2026-01-14T14:06:59.733700+00:00", "result": { "result": true } } ], "action/2/choose/2/conditions/0": [ { "path": "action/2/choose/2/conditions/0", "timestamp": "2026-01-14T14:06:59.733761+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/0": [ { "path": "action/2/choose/2/sequence/0", "timestamp": "2026-01-14T14:06:59.733994+00:00", "result": { "delay": 300.0, "done": true } } ], "action/2/choose/2/sequence/1": [ { "path": "action/2/choose/2/sequence/1", "timestamp": "2026-01-14T14:11:59.734995+00:00", "result": { "result": true, "entities": [ "input_boolean.in_de_douche" ] } } ], "action/2/choose/2/sequence/2": [ { "path": "action/2/choose/2/sequence/2", "timestamp": "2026-01-14T14:11:59.735272+00:00", "result": { "params": { "domain": "homeassistant", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.lamp_badkamer" ] } }, "running_script": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "target_entity": "light.lamp_badkamer", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.badkamer_timer", "entity_domain": "{{ states[target_entity].domain }}", "turn_off_blocker_entity": "input_boolean.in_de_douche", "target_off_entity": null, "sun_condition": "Always" }, "triggers": { "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "to": "on" }, "actions": [ { "entity_id": "light.lamp_badkamer", "action": "homeassistant.turn_on" }, { "wait_for_trigger": { "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from": "on", "to": "off" } }, { "choose": [ { "alias": "Motion wait not defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity == none }}" } ], "sequence": [ { "entity_id": "light.lamp_badkamer", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait not defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity != none }}" } ], "sequence": [ { "entity_id": null, "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity == none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": "light.lamp_badkamer", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity != none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": null, "action": "homeassistant.turn_off" } ] } ] } ], "conditions": [ { "condition": "template", "alias": "Check for illuminance conditions", "value_template": "{% set illuminance_defined = illuminance_currently != none and illuminance_cutoff != none %} {% set illuminance_defined_and_low = (illuminance_defined and (states(illuminance_currently) | int(0) < states(illuminance_cutoff) | int(0))) %}\n{% set target_entity_domain_supports_on_state_check = entity_domain != 'scene' and entity_domain != 'script' %} {% set target_entity_is_scene = entity_domain == 'scene' %} {% set scene_target_entities = state_attr(target_entity, 'entity_id') %} {% set singular_scene_entity_is_on = scene_target_entities is not none and scene_target_entities | count == 1 and scene_target_entities | first == 'on' %} {{ ( target_entity_domain_supports_on_state_check and states(target_entity) == 'on') or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and not illuminance_defined) or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and not illuminance_defined) or ( target_entity_is_scene and singular_scene_entity_is_on) }}\n" }, { "condition": "template", "alias": "Check for blocker entity", "value_template": "{{ (blocker_entity == none) or (states(blocker_entity) == 'off') }}" }, { "condition": "template", "alias": "Check for time limits", "value_template": "{% set current_time = now().strftime(\"%H:%M\") %}\n{% if time_limit_before == none and time_limit_after == none %} true {% endif %}\n{% if time_limit_before != none and time_limit_after == none %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {{ current_time_is_before_limit }} {% elif time_limit_before == none and time_limit_after != none %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {{ current_time_is_after_limit }} {% endif %}\n{% if time_limit_before != none and time_limit_after != none %} {% set before_limit_is_tomorrow = states(time_limit_before) < states(time_limit_after) %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {% set time_window_spans_midnight = states(time_limit_after) > states(time_limit_before) %}\n {% if time_window_spans_midnight != none and time_window_spans_midnight and before_limit_is_tomorrow %}\n {{ current_time_is_after_limit or current_time_is_before_limit }}\n {% elif time_window_spans_midnight != none and not time_window_spans_midnight %}\n {{ current_time_is_before_limit and current_time_is_after_limit }}\n {% endif %}\n{% endif %}\n" }, { "condition": "template", "alias": "Check for sun state", "value_template": "{# Prevent breaking when no sun condition is set in existing automations #} {% if not sun_condition is defined %} {% set sun_condition = 'Always' %} {% endif %} {# Get current sun state #} {% set current_sun_condition = states['sun.sun'].state %}\n{# Checks for current sun state #} {% set sun_state_is_below_horizon = current_sun_condition == 'below_horizon' %} {% set sun_state_is_above_horizon = current_sun_condition == 'above_horizon' %}\n{# Check to see if a condition for sunstate is set by user #} {% set no_sun_condition = sun_condition is defined and sun_condition == 'Always' %} {# Check to see if the user wants automation to trigger below horizon #} {% set sun_condition_is_below_horizon = sun_condition == 'Below horizon' %} {# Check to see if the user wants automation to trigger above horizon #} {% set sun_condition_is_above_horizon = sun_condition == 'Above horizon' %}\n{# Checks to see if sunstate matches up with users condition #} {% set sun_condition_below_horizon_match = sun_state_is_below_horizon and sun_condition_is_below_horizon %} {% set sun_condition_above_horizon_match = sun_state_is_above_horizon and sun_condition_is_above_horizon %} {% set sun_condition_matching = sun_condition_below_horizon_match or sun_condition_above_horizon_match or no_sun_condition %} {{ sun_condition_matching }}\n{# Debug values: (uncomment to check in template dev tool) ## Set at top of template: {% set sun_condition = 'Above horizon' %} Current sun condition: {{current_sun_condition}} Sun state is below horizon: {{ sun_state_is_below_horizon }} Sun state is above horizon: {{ sun_state_is_above_horizon }} Sun condition is set to always: {{ sun_condition_always }} Sun condition is below horizon: {{ sun_condition_is_below_horizon }} Sun condition is above horizon: {{ sun_condition_is_above_horizon }} Sun condition is below horizon match: {{ sun_condition_below_horizon_match }} Sun condition is above horizon match: {{ sun_condition_above_horizon_match }} Sun condition is a match: {{ sun_condition_matching }} #}\n" } ], "id": "1755669352381", "alias": "Beweging Badkamer [BP]", "description": "" }, "blueprint_inputs": { "id": "1755669352381", "alias": "Beweging Badkamer [BP]", "description": "", "use_blueprint": { "path": "freakshock88/motion_illuminance_activated_entity.yaml", "input": { "motion_sensor": "binary_sensor.beweging_badkamer2_bezetting", "target_entity": "light.lamp_badkamer", "no_motion_wait": "input_number.badkamer_timer", "turn_off_blocker_entity": "input_boolean.in_de_douche" } } }, "context": { "id": "01KEYD6ZKGC8H07XCN5YVVXB5H", "parent_id": "01KEYD6ZK8C21NQDNSQQMQEM0K", "user_id": null } }, "short_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "91f29ccf18de2e133084e83528666e08", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T14:05:35.728781+00:00", "finish": "2026-01-14T14:11:59.864625+00:00" }, "domain": "automation", "item_id": "1755669352381", "trigger": "state of binary_sensor.beweging_badkamer2_bezetting" } }, { "extended_dict": { "last_step": "action/2/choose/2/sequence/0", "run_id": "775828a01c44c72f3636ab5344eb0cd7", "state": "stopped", "script_execution": "cancelled", "timestamp": { "start": "2026-01-14T15:16:58.214619+00:00", "finish": "2026-01-14T15:22:42.873666+00:00" }, "domain": "automation", "item_id": "1755669352381", "trigger": "state of binary_sensor.beweging_badkamer2_bezetting", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T15:16:58.214736+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_badkamer_bp", "state": "on", "attributes": { "id": "1755669352381", "last_triggered": "2026-01-14T14:05:35.729221+00:00", "mode": "restart", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Badkamer" }, "last_changed": "2026-01-13T12:10:27.678539+00:00", "last_reported": "2026-01-14T14:11:59.863235+00:00", "last_updated": "2026-01-14T14:11:59.863235+00:00", "context": { "id": "01KEYDJPQQV6YW0CES91CY1VP0", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "off", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T14:06:59.729161+00:00", "last_reported": "2026-01-14T14:06:59.729161+00:00", "last_updated": "2026-01-14T14:06:59.729161+00:00", "context": { "id": "01KEYD9HMH4HJ7TZ515FHBTA89", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "on", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T15:16:58.213104+00:00", "last_reported": "2026-01-14T15:16:58.213104+00:00", "last_updated": "2026-01-14T15:16:58.213104+00:00", "context": { "id": "01KEYH9NQ5G3PP9C5FKKC8RT6J", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_badkamer2_bezetting" }, "target_entity": "light.lamp_badkamer", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.badkamer_timer", "entity_domain": "light", "turn_off_blocker_entity": "input_boolean.in_de_douche", "target_off_entity": null, "sun_condition": "Always" } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T15:16:58.214756+00:00", "result": { "result": true, "entities": [ "light.lamp_badkamer" ] } } ], "condition/1": [ { "path": "condition/1", "timestamp": "2026-01-14T15:16:58.214839+00:00", "result": { "result": true, "entities": [] } } ], "condition/2": [ { "path": "condition/2", "timestamp": "2026-01-14T15:16:58.214881+00:00", "result": { "result": true, "entities": [] } } ], "condition/3": [ { "path": "condition/3", "timestamp": "2026-01-14T15:16:58.214968+00:00", "result": { "result": true, "entities": [ "sun.sun" ] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T15:16:58.215211+00:00", "changed_variables": { "context": { "id": "01KEYH9NQ65N694SKY6P8V4KPP", "parent_id": "01KEYH9NQ5G3PP9C5FKKC8RT6J", "user_id": null } }, "result": { "params": { "domain": "homeassistant", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "light.lamp_badkamer" ] } }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-14T15:16:58.377367+00:00", "changed_variables": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "on", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T15:16:58.213104+00:00", "last_reported": "2026-01-14T15:16:58.213104+00:00", "last_updated": "2026-01-14T15:16:58.213104+00:00", "context": { "id": "01KEYH9NQ5G3PP9C5FKKC8RT6J", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "off", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T15:17:59.809880+00:00", "last_reported": "2026-01-14T15:17:59.809880+00:00", "last_updated": "2026-01-14T15:17:59.809880+00:00", "context": { "id": "01KEYHBHW171N524T8Q60VB27Z", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_badkamer2_bezetting" } } }, "result": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "on", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T15:16:58.213104+00:00", "last_reported": "2026-01-14T15:16:58.213104+00:00", "last_updated": "2026-01-14T15:16:58.213104+00:00", "context": { "id": "01KEYH9NQ5G3PP9C5FKKC8RT6J", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "off", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T15:17:59.809880+00:00", "last_reported": "2026-01-14T15:17:59.809880+00:00", "last_updated": "2026-01-14T15:17:59.809880+00:00", "context": { "id": "01KEYHBHW171N524T8Q60VB27Z", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_badkamer2_bezetting" } } } } ], "action/2": [ { "path": "action/2", "timestamp": "2026-01-14T15:17:59.812770+00:00", "result": { "choice": 2 } } ], "action/2/choose/0": [ { "path": "action/2/choose/0", "timestamp": "2026-01-14T15:17:59.812821+00:00", "result": { "result": false } } ], "action/2/choose/0/conditions/0": [ { "path": "action/2/choose/0/conditions/0", "timestamp": "2026-01-14T15:17:59.812864+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/1": [ { "path": "action/2/choose/1", "timestamp": "2026-01-14T15:17:59.812985+00:00", "result": { "result": false } } ], "action/2/choose/1/conditions/0": [ { "path": "action/2/choose/1/conditions/0", "timestamp": "2026-01-14T15:17:59.813050+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/2": [ { "path": "action/2/choose/2", "timestamp": "2026-01-14T15:17:59.813154+00:00", "result": { "result": true } } ], "action/2/choose/2/conditions/0": [ { "path": "action/2/choose/2/conditions/0", "timestamp": "2026-01-14T15:17:59.813202+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/0": [ { "path": "action/2/choose/2/sequence/0", "timestamp": "2026-01-14T15:17:59.813450+00:00", "result": { "delay": 300.0, "done": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "target_entity": "light.lamp_badkamer", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.badkamer_timer", "entity_domain": "{{ states[target_entity].domain }}", "turn_off_blocker_entity": "input_boolean.in_de_douche", "target_off_entity": null, "sun_condition": "Always" }, "triggers": { "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "to": "on" }, "actions": [ { "entity_id": "light.lamp_badkamer", "action": "homeassistant.turn_on" }, { "wait_for_trigger": { "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from": "on", "to": "off" } }, { "choose": [ { "alias": "Motion wait not defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity == none }}" } ], "sequence": [ { "entity_id": "light.lamp_badkamer", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait not defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity != none }}" } ], "sequence": [ { "entity_id": null, "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity == none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": "light.lamp_badkamer", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity != none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": null, "action": "homeassistant.turn_off" } ] } ] } ], "conditions": [ { "condition": "template", "alias": "Check for illuminance conditions", "value_template": "{% set illuminance_defined = illuminance_currently != none and illuminance_cutoff != none %} {% set illuminance_defined_and_low = (illuminance_defined and (states(illuminance_currently) | int(0) < states(illuminance_cutoff) | int(0))) %}\n{% set target_entity_domain_supports_on_state_check = entity_domain != 'scene' and entity_domain != 'script' %} {% set target_entity_is_scene = entity_domain == 'scene' %} {% set scene_target_entities = state_attr(target_entity, 'entity_id') %} {% set singular_scene_entity_is_on = scene_target_entities is not none and scene_target_entities | count == 1 and scene_target_entities | first == 'on' %} {{ ( target_entity_domain_supports_on_state_check and states(target_entity) == 'on') or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and not illuminance_defined) or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and not illuminance_defined) or ( target_entity_is_scene and singular_scene_entity_is_on) }}\n" }, { "condition": "template", "alias": "Check for blocker entity", "value_template": "{{ (blocker_entity == none) or (states(blocker_entity) == 'off') }}" }, { "condition": "template", "alias": "Check for time limits", "value_template": "{% set current_time = now().strftime(\"%H:%M\") %}\n{% if time_limit_before == none and time_limit_after == none %} true {% endif %}\n{% if time_limit_before != none and time_limit_after == none %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {{ current_time_is_before_limit }} {% elif time_limit_before == none and time_limit_after != none %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {{ current_time_is_after_limit }} {% endif %}\n{% if time_limit_before != none and time_limit_after != none %} {% set before_limit_is_tomorrow = states(time_limit_before) < states(time_limit_after) %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {% set time_window_spans_midnight = states(time_limit_after) > states(time_limit_before) %}\n {% if time_window_spans_midnight != none and time_window_spans_midnight and before_limit_is_tomorrow %}\n {{ current_time_is_after_limit or current_time_is_before_limit }}\n {% elif time_window_spans_midnight != none and not time_window_spans_midnight %}\n {{ current_time_is_before_limit and current_time_is_after_limit }}\n {% endif %}\n{% endif %}\n" }, { "condition": "template", "alias": "Check for sun state", "value_template": "{# Prevent breaking when no sun condition is set in existing automations #} {% if not sun_condition is defined %} {% set sun_condition = 'Always' %} {% endif %} {# Get current sun state #} {% set current_sun_condition = states['sun.sun'].state %}\n{# Checks for current sun state #} {% set sun_state_is_below_horizon = current_sun_condition == 'below_horizon' %} {% set sun_state_is_above_horizon = current_sun_condition == 'above_horizon' %}\n{# Check to see if a condition for sunstate is set by user #} {% set no_sun_condition = sun_condition is defined and sun_condition == 'Always' %} {# Check to see if the user wants automation to trigger below horizon #} {% set sun_condition_is_below_horizon = sun_condition == 'Below horizon' %} {# Check to see if the user wants automation to trigger above horizon #} {% set sun_condition_is_above_horizon = sun_condition == 'Above horizon' %}\n{# Checks to see if sunstate matches up with users condition #} {% set sun_condition_below_horizon_match = sun_state_is_below_horizon and sun_condition_is_below_horizon %} {% set sun_condition_above_horizon_match = sun_state_is_above_horizon and sun_condition_is_above_horizon %} {% set sun_condition_matching = sun_condition_below_horizon_match or sun_condition_above_horizon_match or no_sun_condition %} {{ sun_condition_matching }}\n{# Debug values: (uncomment to check in template dev tool) ## Set at top of template: {% set sun_condition = 'Above horizon' %} Current sun condition: {{current_sun_condition}} Sun state is below horizon: {{ sun_state_is_below_horizon }} Sun state is above horizon: {{ sun_state_is_above_horizon }} Sun condition is set to always: {{ sun_condition_always }} Sun condition is below horizon: {{ sun_condition_is_below_horizon }} Sun condition is above horizon: {{ sun_condition_is_above_horizon }} Sun condition is below horizon match: {{ sun_condition_below_horizon_match }} Sun condition is above horizon match: {{ sun_condition_above_horizon_match }} Sun condition is a match: {{ sun_condition_matching }} #}\n" } ], "id": "1755669352381", "alias": "Beweging Badkamer [BP]", "description": "" }, "blueprint_inputs": { "id": "1755669352381", "alias": "Beweging Badkamer [BP]", "description": "", "use_blueprint": { "path": "freakshock88/motion_illuminance_activated_entity.yaml", "input": { "motion_sensor": "binary_sensor.beweging_badkamer2_bezetting", "target_entity": "light.lamp_badkamer", "no_motion_wait": "input_number.badkamer_timer", "turn_off_blocker_entity": "input_boolean.in_de_douche" } } }, "context": { "id": "01KEYH9NQ65N694SKY6P8V4KPP", "parent_id": "01KEYH9NQ5G3PP9C5FKKC8RT6J", "user_id": null } }, "short_dict": { "last_step": "action/2/choose/2/sequence/0", "run_id": "775828a01c44c72f3636ab5344eb0cd7", "state": "stopped", "script_execution": "cancelled", "timestamp": { "start": "2026-01-14T15:16:58.214619+00:00", "finish": "2026-01-14T15:22:42.873666+00:00" }, "domain": "automation", "item_id": "1755669352381", "trigger": "state of binary_sensor.beweging_badkamer2_bezetting" } }, { "extended_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "4ab57f1d50f1e48157af7f12e7e2ae70", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T15:22:42.870938+00:00", "finish": "2026-01-14T15:28:51.087779+00:00" }, "domain": "automation", "item_id": "1755669352381", "trigger": "state of binary_sensor.beweging_badkamer2_bezetting", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T15:22:42.871055+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_badkamer_bp", "state": "on", "attributes": { "id": "1755669352381", "last_triggered": "2026-01-14T15:16:58.215064+00:00", "mode": "restart", "current": 1, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Badkamer" }, "last_changed": "2026-01-13T12:10:27.678539+00:00", "last_reported": "2026-01-14T15:16:58.215080+00:00", "last_updated": "2026-01-14T15:16:58.215080+00:00", "context": { "id": "01KEYH9NQ65N694SKY6P8V4KPP", "parent_id": "01KEYH9NQ5G3PP9C5FKKC8RT6J", "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "off", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T15:17:59.809880+00:00", "last_reported": "2026-01-14T15:17:59.809880+00:00", "last_updated": "2026-01-14T15:17:59.809880+00:00", "context": { "id": "01KEYHBHW171N524T8Q60VB27Z", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "on", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T15:22:42.869457+00:00", "last_reported": "2026-01-14T15:22:42.869457+00:00", "last_updated": "2026-01-14T15:22:42.869457+00:00", "context": { "id": "01KEYHM69NZT3Q2EMEPS8HD75K", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_badkamer2_bezetting" }, "target_entity": "light.lamp_badkamer", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.badkamer_timer", "entity_domain": "light", "turn_off_blocker_entity": "input_boolean.in_de_douche", "target_off_entity": null, "sun_condition": "Always" } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T15:22:42.871077+00:00", "result": { "result": true, "entities": [ "light.lamp_badkamer" ] } } ], "condition/1": [ { "path": "condition/1", "timestamp": "2026-01-14T15:22:42.871157+00:00", "result": { "result": true, "entities": [] } } ], "condition/2": [ { "path": "condition/2", "timestamp": "2026-01-14T15:22:42.871216+00:00", "result": { "result": true, "entities": [] } } ], "condition/3": [ { "path": "condition/3", "timestamp": "2026-01-14T15:22:42.871304+00:00", "result": { "result": true, "entities": [ "sun.sun" ] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T15:22:42.873977+00:00", "changed_variables": { "context": { "id": "01KEYHM69PVPS7EKNBNXBBWAHD", "parent_id": "01KEYHM69NZT3Q2EMEPS8HD75K", "user_id": null } }, "result": { "params": { "domain": "homeassistant", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "light.lamp_badkamer" ] } }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-14T15:22:43.015860+00:00", "changed_variables": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "on", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T15:22:42.869457+00:00", "last_reported": "2026-01-14T15:22:42.869457+00:00", "last_updated": "2026-01-14T15:22:42.869457+00:00", "context": { "id": "01KEYHM69NZT3Q2EMEPS8HD75K", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "off", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T15:23:50.924982+00:00", "last_reported": "2026-01-14T15:23:50.924982+00:00", "last_updated": "2026-01-14T15:23:50.924982+00:00", "context": { "id": "01KEYHP8RC467PM6H5328814KE", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_badkamer2_bezetting" } } }, "result": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "on", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T15:22:42.869457+00:00", "last_reported": "2026-01-14T15:22:42.869457+00:00", "last_updated": "2026-01-14T15:22:42.869457+00:00", "context": { "id": "01KEYHM69NZT3Q2EMEPS8HD75K", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "off", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T15:23:50.924982+00:00", "last_reported": "2026-01-14T15:23:50.924982+00:00", "last_updated": "2026-01-14T15:23:50.924982+00:00", "context": { "id": "01KEYHP8RC467PM6H5328814KE", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_badkamer2_bezetting" } } } } ], "action/2": [ { "path": "action/2", "timestamp": "2026-01-14T15:23:50.934228+00:00", "result": { "choice": 2 } } ], "action/2/choose/0": [ { "path": "action/2/choose/0", "timestamp": "2026-01-14T15:23:50.934360+00:00", "result": { "result": false } } ], "action/2/choose/0/conditions/0": [ { "path": "action/2/choose/0/conditions/0", "timestamp": "2026-01-14T15:23:50.934445+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/1": [ { "path": "action/2/choose/1", "timestamp": "2026-01-14T15:23:50.934652+00:00", "result": { "result": false } } ], "action/2/choose/1/conditions/0": [ { "path": "action/2/choose/1/conditions/0", "timestamp": "2026-01-14T15:23:50.934722+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/2": [ { "path": "action/2/choose/2", "timestamp": "2026-01-14T15:23:50.934903+00:00", "result": { "result": true } } ], "action/2/choose/2/conditions/0": [ { "path": "action/2/choose/2/conditions/0", "timestamp": "2026-01-14T15:23:50.934983+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/0": [ { "path": "action/2/choose/2/sequence/0", "timestamp": "2026-01-14T15:23:50.935319+00:00", "result": { "delay": 300.0, "done": true } } ], "action/2/choose/2/sequence/1": [ { "path": "action/2/choose/2/sequence/1", "timestamp": "2026-01-14T15:28:50.937025+00:00", "result": { "result": true, "entities": [ "input_boolean.in_de_douche" ] } } ], "action/2/choose/2/sequence/2": [ { "path": "action/2/choose/2/sequence/2", "timestamp": "2026-01-14T15:28:50.937304+00:00", "result": { "params": { "domain": "homeassistant", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.lamp_badkamer" ] } }, "running_script": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "target_entity": "light.lamp_badkamer", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.badkamer_timer", "entity_domain": "{{ states[target_entity].domain }}", "turn_off_blocker_entity": "input_boolean.in_de_douche", "target_off_entity": null, "sun_condition": "Always" }, "triggers": { "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "to": "on" }, "actions": [ { "entity_id": "light.lamp_badkamer", "action": "homeassistant.turn_on" }, { "wait_for_trigger": { "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from": "on", "to": "off" } }, { "choose": [ { "alias": "Motion wait not defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity == none }}" } ], "sequence": [ { "entity_id": "light.lamp_badkamer", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait not defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity != none }}" } ], "sequence": [ { "entity_id": null, "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity == none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": "light.lamp_badkamer", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity != none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": null, "action": "homeassistant.turn_off" } ] } ] } ], "conditions": [ { "condition": "template", "alias": "Check for illuminance conditions", "value_template": "{% set illuminance_defined = illuminance_currently != none and illuminance_cutoff != none %} {% set illuminance_defined_and_low = (illuminance_defined and (states(illuminance_currently) | int(0) < states(illuminance_cutoff) | int(0))) %}\n{% set target_entity_domain_supports_on_state_check = entity_domain != 'scene' and entity_domain != 'script' %} {% set target_entity_is_scene = entity_domain == 'scene' %} {% set scene_target_entities = state_attr(target_entity, 'entity_id') %} {% set singular_scene_entity_is_on = scene_target_entities is not none and scene_target_entities | count == 1 and scene_target_entities | first == 'on' %} {{ ( target_entity_domain_supports_on_state_check and states(target_entity) == 'on') or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and not illuminance_defined) or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and not illuminance_defined) or ( target_entity_is_scene and singular_scene_entity_is_on) }}\n" }, { "condition": "template", "alias": "Check for blocker entity", "value_template": "{{ (blocker_entity == none) or (states(blocker_entity) == 'off') }}" }, { "condition": "template", "alias": "Check for time limits", "value_template": "{% set current_time = now().strftime(\"%H:%M\") %}\n{% if time_limit_before == none and time_limit_after == none %} true {% endif %}\n{% if time_limit_before != none and time_limit_after == none %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {{ current_time_is_before_limit }} {% elif time_limit_before == none and time_limit_after != none %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {{ current_time_is_after_limit }} {% endif %}\n{% if time_limit_before != none and time_limit_after != none %} {% set before_limit_is_tomorrow = states(time_limit_before) < states(time_limit_after) %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {% set time_window_spans_midnight = states(time_limit_after) > states(time_limit_before) %}\n {% if time_window_spans_midnight != none and time_window_spans_midnight and before_limit_is_tomorrow %}\n {{ current_time_is_after_limit or current_time_is_before_limit }}\n {% elif time_window_spans_midnight != none and not time_window_spans_midnight %}\n {{ current_time_is_before_limit and current_time_is_after_limit }}\n {% endif %}\n{% endif %}\n" }, { "condition": "template", "alias": "Check for sun state", "value_template": "{# Prevent breaking when no sun condition is set in existing automations #} {% if not sun_condition is defined %} {% set sun_condition = 'Always' %} {% endif %} {# Get current sun state #} {% set current_sun_condition = states['sun.sun'].state %}\n{# Checks for current sun state #} {% set sun_state_is_below_horizon = current_sun_condition == 'below_horizon' %} {% set sun_state_is_above_horizon = current_sun_condition == 'above_horizon' %}\n{# Check to see if a condition for sunstate is set by user #} {% set no_sun_condition = sun_condition is defined and sun_condition == 'Always' %} {# Check to see if the user wants automation to trigger below horizon #} {% set sun_condition_is_below_horizon = sun_condition == 'Below horizon' %} {# Check to see if the user wants automation to trigger above horizon #} {% set sun_condition_is_above_horizon = sun_condition == 'Above horizon' %}\n{# Checks to see if sunstate matches up with users condition #} {% set sun_condition_below_horizon_match = sun_state_is_below_horizon and sun_condition_is_below_horizon %} {% set sun_condition_above_horizon_match = sun_state_is_above_horizon and sun_condition_is_above_horizon %} {% set sun_condition_matching = sun_condition_below_horizon_match or sun_condition_above_horizon_match or no_sun_condition %} {{ sun_condition_matching }}\n{# Debug values: (uncomment to check in template dev tool) ## Set at top of template: {% set sun_condition = 'Above horizon' %} Current sun condition: {{current_sun_condition}} Sun state is below horizon: {{ sun_state_is_below_horizon }} Sun state is above horizon: {{ sun_state_is_above_horizon }} Sun condition is set to always: {{ sun_condition_always }} Sun condition is below horizon: {{ sun_condition_is_below_horizon }} Sun condition is above horizon: {{ sun_condition_is_above_horizon }} Sun condition is below horizon match: {{ sun_condition_below_horizon_match }} Sun condition is above horizon match: {{ sun_condition_above_horizon_match }} Sun condition is a match: {{ sun_condition_matching }} #}\n" } ], "id": "1755669352381", "alias": "Beweging Badkamer [BP]", "description": "" }, "blueprint_inputs": { "id": "1755669352381", "alias": "Beweging Badkamer [BP]", "description": "", "use_blueprint": { "path": "freakshock88/motion_illuminance_activated_entity.yaml", "input": { "motion_sensor": "binary_sensor.beweging_badkamer2_bezetting", "target_entity": "light.lamp_badkamer", "no_motion_wait": "input_number.badkamer_timer", "turn_off_blocker_entity": "input_boolean.in_de_douche" } } }, "context": { "id": "01KEYHM69PVPS7EKNBNXBBWAHD", "parent_id": "01KEYHM69NZT3Q2EMEPS8HD75K", "user_id": null } }, "short_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "4ab57f1d50f1e48157af7f12e7e2ae70", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T15:22:42.870938+00:00", "finish": "2026-01-14T15:28:51.087779+00:00" }, "domain": "automation", "item_id": "1755669352381", "trigger": "state of binary_sensor.beweging_badkamer2_bezetting" } }, { "extended_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "faf34b6c84e0aa4a1c47935607db480a", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T15:58:58.914199+00:00", "finish": "2026-01-14T16:04:59.601694+00:00" }, "domain": "automation", "item_id": "1755669352381", "trigger": "state of binary_sensor.beweging_badkamer2_bezetting", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T15:58:58.918111+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_badkamer_bp", "state": "on", "attributes": { "id": "1755669352381", "last_triggered": "2026-01-14T15:22:42.873790+00:00", "mode": "restart", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Badkamer" }, "last_changed": "2026-01-14T15:48:56.986318+00:00", "last_reported": "2026-01-14T15:48:56.986318+00:00", "last_updated": "2026-01-14T15:48:56.986318+00:00", "context": { "id": "01KEYK47GT41K392HF99EK6RM8", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "off", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T15:48:55.698491+00:00", "last_reported": "2026-01-14T15:48:55.698491+00:00", "last_updated": "2026-01-14T15:48:55.698491+00:00", "context": { "id": "01KEYK468J31M8BSAZSWQ3WEBT", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "on", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T15:58:58.913186+00:00", "last_reported": "2026-01-14T15:58:58.913186+00:00", "last_updated": "2026-01-14T15:58:58.913186+00:00", "context": { "id": "01KEYKPKB1HCK4Z4N5FCN89AE8", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_badkamer2_bezetting" }, "target_entity": "light.lamp_badkamer", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.badkamer_timer", "entity_domain": "light", "turn_off_blocker_entity": "input_boolean.in_de_douche", "target_off_entity": null, "sun_condition": "Always" } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T15:58:58.918135+00:00", "result": { "result": true, "entities": [ "light.lamp_badkamer" ] } } ], "condition/1": [ { "path": "condition/1", "timestamp": "2026-01-14T15:58:58.918277+00:00", "result": { "result": true, "entities": [] } } ], "condition/2": [ { "path": "condition/2", "timestamp": "2026-01-14T15:58:58.918344+00:00", "result": { "result": true, "entities": [] } } ], "condition/3": [ { "path": "condition/3", "timestamp": "2026-01-14T15:58:58.918746+00:00", "result": { "result": true, "entities": [ "sun.sun" ] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T15:58:58.919062+00:00", "changed_variables": { "context": { "id": "01KEYKPKB2SGPMM01HVJH90YXK", "parent_id": "01KEYKPKB1HCK4Z4N5FCN89AE8", "user_id": null } }, "result": { "params": { "domain": "homeassistant", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "light.lamp_badkamer" ] } }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-14T15:58:59.047130+00:00", "changed_variables": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "on", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T15:58:58.913186+00:00", "last_reported": "2026-01-14T15:58:58.913186+00:00", "last_updated": "2026-01-14T15:58:58.913186+00:00", "context": { "id": "01KEYKPKB1HCK4Z4N5FCN89AE8", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "off", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T15:59:59.501658+00:00", "last_reported": "2026-01-14T15:59:59.501658+00:00", "last_updated": "2026-01-14T15:59:59.501658+00:00", "context": { "id": "01KEYKREGDH72CC1D1NWBY539S", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_badkamer2_bezetting" } } }, "result": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "on", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T15:58:58.913186+00:00", "last_reported": "2026-01-14T15:58:58.913186+00:00", "last_updated": "2026-01-14T15:58:58.913186+00:00", "context": { "id": "01KEYKPKB1HCK4Z4N5FCN89AE8", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "state": "off", "attributes": { "device_class": "occupancy", "friendly_name": "Beweging badkamer Bezetting" }, "last_changed": "2026-01-14T15:59:59.501658+00:00", "last_reported": "2026-01-14T15:59:59.501658+00:00", "last_updated": "2026-01-14T15:59:59.501658+00:00", "context": { "id": "01KEYKREGDH72CC1D1NWBY539S", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_badkamer2_bezetting" } } } } ], "action/2": [ { "path": "action/2", "timestamp": "2026-01-14T15:59:59.504069+00:00", "result": { "choice": 2 } } ], "action/2/choose/0": [ { "path": "action/2/choose/0", "timestamp": "2026-01-14T15:59:59.504330+00:00", "result": { "result": false } } ], "action/2/choose/0/conditions/0": [ { "path": "action/2/choose/0/conditions/0", "timestamp": "2026-01-14T15:59:59.504410+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/1": [ { "path": "action/2/choose/1", "timestamp": "2026-01-14T15:59:59.504542+00:00", "result": { "result": false } } ], "action/2/choose/1/conditions/0": [ { "path": "action/2/choose/1/conditions/0", "timestamp": "2026-01-14T15:59:59.504600+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/2": [ { "path": "action/2/choose/2", "timestamp": "2026-01-14T15:59:59.504709+00:00", "result": { "result": true } } ], "action/2/choose/2/conditions/0": [ { "path": "action/2/choose/2/conditions/0", "timestamp": "2026-01-14T15:59:59.504743+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/0": [ { "path": "action/2/choose/2/sequence/0", "timestamp": "2026-01-14T15:59:59.504919+00:00", "result": { "delay": 300.0, "done": true } } ], "action/2/choose/2/sequence/1": [ { "path": "action/2/choose/2/sequence/1", "timestamp": "2026-01-14T16:04:59.505894+00:00", "result": { "result": true, "entities": [ "input_boolean.in_de_douche" ] } } ], "action/2/choose/2/sequence/2": [ { "path": "action/2/choose/2/sequence/2", "timestamp": "2026-01-14T16:04:59.506181+00:00", "result": { "params": { "domain": "homeassistant", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.lamp_badkamer" ] } }, "running_script": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "target_entity": "light.lamp_badkamer", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.badkamer_timer", "entity_domain": "{{ states[target_entity].domain }}", "turn_off_blocker_entity": "input_boolean.in_de_douche", "target_off_entity": null, "sun_condition": "Always" }, "triggers": { "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "to": "on" }, "actions": [ { "entity_id": "light.lamp_badkamer", "action": "homeassistant.turn_on" }, { "wait_for_trigger": { "platform": "state", "entity_id": "binary_sensor.beweging_badkamer2_bezetting", "from": "on", "to": "off" } }, { "choose": [ { "alias": "Motion wait not defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity == none }}" } ], "sequence": [ { "entity_id": "light.lamp_badkamer", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait not defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity != none }}" } ], "sequence": [ { "entity_id": null, "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity == none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": "light.lamp_badkamer", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity != none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": null, "action": "homeassistant.turn_off" } ] } ] } ], "conditions": [ { "condition": "template", "alias": "Check for illuminance conditions", "value_template": "{% set illuminance_defined = illuminance_currently != none and illuminance_cutoff != none %} {% set illuminance_defined_and_low = (illuminance_defined and (states(illuminance_currently) | int(0) < states(illuminance_cutoff) | int(0))) %}\n{% set target_entity_domain_supports_on_state_check = entity_domain != 'scene' and entity_domain != 'script' %} {% set target_entity_is_scene = entity_domain == 'scene' %} {% set scene_target_entities = state_attr(target_entity, 'entity_id') %} {% set singular_scene_entity_is_on = scene_target_entities is not none and scene_target_entities | count == 1 and scene_target_entities | first == 'on' %} {{ ( target_entity_domain_supports_on_state_check and states(target_entity) == 'on') or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and not illuminance_defined) or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and not illuminance_defined) or ( target_entity_is_scene and singular_scene_entity_is_on) }}\n" }, { "condition": "template", "alias": "Check for blocker entity", "value_template": "{{ (blocker_entity == none) or (states(blocker_entity) == 'off') }}" }, { "condition": "template", "alias": "Check for time limits", "value_template": "{% set current_time = now().strftime(\"%H:%M\") %}\n{% if time_limit_before == none and time_limit_after == none %} true {% endif %}\n{% if time_limit_before != none and time_limit_after == none %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {{ current_time_is_before_limit }} {% elif time_limit_before == none and time_limit_after != none %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {{ current_time_is_after_limit }} {% endif %}\n{% if time_limit_before != none and time_limit_after != none %} {% set before_limit_is_tomorrow = states(time_limit_before) < states(time_limit_after) %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {% set time_window_spans_midnight = states(time_limit_after) > states(time_limit_before) %}\n {% if time_window_spans_midnight != none and time_window_spans_midnight and before_limit_is_tomorrow %}\n {{ current_time_is_after_limit or current_time_is_before_limit }}\n {% elif time_window_spans_midnight != none and not time_window_spans_midnight %}\n {{ current_time_is_before_limit and current_time_is_after_limit }}\n {% endif %}\n{% endif %}\n" }, { "condition": "template", "alias": "Check for sun state", "value_template": "{# Prevent breaking when no sun condition is set in existing automations #} {% if not sun_condition is defined %} {% set sun_condition = 'Always' %} {% endif %} {# Get current sun state #} {% set current_sun_condition = states['sun.sun'].state %}\n{# Checks for current sun state #} {% set sun_state_is_below_horizon = current_sun_condition == 'below_horizon' %} {% set sun_state_is_above_horizon = current_sun_condition == 'above_horizon' %}\n{# Check to see if a condition for sunstate is set by user #} {% set no_sun_condition = sun_condition is defined and sun_condition == 'Always' %} {# Check to see if the user wants automation to trigger below horizon #} {% set sun_condition_is_below_horizon = sun_condition == 'Below horizon' %} {# Check to see if the user wants automation to trigger above horizon #} {% set sun_condition_is_above_horizon = sun_condition == 'Above horizon' %}\n{# Checks to see if sunstate matches up with users condition #} {% set sun_condition_below_horizon_match = sun_state_is_below_horizon and sun_condition_is_below_horizon %} {% set sun_condition_above_horizon_match = sun_state_is_above_horizon and sun_condition_is_above_horizon %} {% set sun_condition_matching = sun_condition_below_horizon_match or sun_condition_above_horizon_match or no_sun_condition %} {{ sun_condition_matching }}\n{# Debug values: (uncomment to check in template dev tool) ## Set at top of template: {% set sun_condition = 'Above horizon' %} Current sun condition: {{current_sun_condition}} Sun state is below horizon: {{ sun_state_is_below_horizon }} Sun state is above horizon: {{ sun_state_is_above_horizon }} Sun condition is set to always: {{ sun_condition_always }} Sun condition is below horizon: {{ sun_condition_is_below_horizon }} Sun condition is above horizon: {{ sun_condition_is_above_horizon }} Sun condition is below horizon match: {{ sun_condition_below_horizon_match }} Sun condition is above horizon match: {{ sun_condition_above_horizon_match }} Sun condition is a match: {{ sun_condition_matching }} #}\n" } ], "id": "1755669352381", "alias": "Beweging Badkamer [BP]", "description": "" }, "blueprint_inputs": { "id": "1755669352381", "alias": "Beweging Badkamer [BP]", "description": "", "use_blueprint": { "path": "freakshock88/motion_illuminance_activated_entity.yaml", "input": { "motion_sensor": "binary_sensor.beweging_badkamer2_bezetting", "target_entity": "light.lamp_badkamer", "no_motion_wait": "input_number.badkamer_timer", "turn_off_blocker_entity": "input_boolean.in_de_douche" } } }, "context": { "id": "01KEYKPKB2SGPMM01HVJH90YXK", "parent_id": "01KEYKPKB1HCK4Z4N5FCN89AE8", "user_id": null } }, "short_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "faf34b6c84e0aa4a1c47935607db480a", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T15:58:58.914199+00:00", "finish": "2026-01-14T16:04:59.601694+00:00" }, "domain": "automation", "item_id": "1755669352381", "trigger": "state of binary_sensor.beweging_badkamer2_bezetting" } } ], "automation.1767031482023": [ { "extended_dict": { "last_step": "action/0/choose/0/sequence/0", "run_id": "466de274d9d7f87e1ae327b72ae00972", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T15:52:54.631991+00:00", "finish": "2026-01-13T15:52:54.748722+00:00" }, "domain": "automation", "item_id": "1767031482023", "trigger": "event 'shelly.click'", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-13T15:52:54.632016+00:00", "changed_variables": { "this": { "entity_id": "automation.schakelaar_overloop", "state": "on", "attributes": { "id": "1767031482023", "last_triggered": "2026-01-13T14:22:39.263044+00:00", "mode": "single", "current": 0, "friendly_name": "Schakelaar overloop" }, "last_changed": "2026-01-13T12:10:27.681371+00:00", "last_reported": "2026-01-13T14:22:39.264326+00:00", "last_updated": "2026-01-13T14:22:39.264326+00:00", "context": { "id": "01KEVVSG4Y9547YGPDNJEPWK52", "parent_id": "01KEVVSG4YGRGYS76VN1CAJAJ6", "user_id": null } }, "trigger": { "id": "Rechts enkel", "idx": "0", "alias": null, "platform": "device", "event": { "event_type": "shelly.click", "data": { "device_id": "20400558bc79dabd3eef8163fb4a0c79", "device": "shelly2pmg3-b08184eb6dd4", "channel": 2, "click_type": "single_push", "generation": 2 }, "origin": "LOCAL", "time_fired": "2026-01-13T15:52:54.631867+00:00", "context": { "id": "01KEW0YRK7PSF0PJSF43VV9FQK", "parent_id": null, "user_id": null } }, "description": "event 'shelly.click'" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-13T15:52:54.632203+00:00", "changed_variables": { "context": { "id": "01KEW0YRK7M0QK3AR60WQQA2YY", "parent_id": "01KEW0YRK7PSF0PJSF43VV9FQK", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-13T15:52:54.632257+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-13T15:52:54.632283+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-13T15:52:54.632360+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": {}, "target": { "entity_id": [ "light.lamp_badkamer" ] } }, "running_script": false } } ] }, "config": { "id": "1767031482023", "alias": "Schakelaar overloop", "description": "", "triggers": [ { "device_id": "20400558bc79dabd3eef8163fb4a0c79", "domain": "shelly", "type": "single_push", "subtype": "button2", "trigger": "device", "id": "Rechts enkel" }, { "device_id": "20400558bc79dabd3eef8163fb4a0c79", "domain": "shelly", "type": "double_push", "subtype": "button2", "trigger": "device", "id": "Rechts dubbel" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "Rechts enkel" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "target": { "entity_id": "light.lamp_badkamer" }, "data": {} } ] }, { "conditions": [ { "condition": "trigger", "id": [ "Rechts dubbel" ] } ], "sequence": [ { "action": "input_boolean.toggle", "metadata": {}, "target": { "entity_id": "input_boolean.in_de_douche" }, "data": {} } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEW0YRK7M0QK3AR60WQQA2YY", "parent_id": "01KEW0YRK7PSF0PJSF43VV9FQK", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0", "run_id": "466de274d9d7f87e1ae327b72ae00972", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T15:52:54.631991+00:00", "finish": "2026-01-13T15:52:54.748722+00:00" }, "domain": "automation", "item_id": "1767031482023", "trigger": "event 'shelly.click'" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/0", "run_id": "6e1ec565bec75677931aeaf2c56116a9", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T23:16:48.170103+00:00", "finish": "2026-01-13T23:16:48.247711+00:00" }, "domain": "automation", "item_id": "1767031482023", "trigger": "event 'shelly.click'", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-13T23:16:48.170139+00:00", "changed_variables": { "this": { "entity_id": "automation.schakelaar_overloop", "state": "on", "attributes": { "id": "1767031482023", "last_triggered": "2026-01-13T15:52:54.632063+00:00", "mode": "single", "current": 0, "friendly_name": "Schakelaar overloop" }, "last_changed": "2026-01-13T12:10:27.681371+00:00", "last_reported": "2026-01-13T15:52:54.747976+00:00", "last_updated": "2026-01-13T15:52:54.747976+00:00", "context": { "id": "01KEW0YRK7M0QK3AR60WQQA2YY", "parent_id": "01KEW0YRK7PSF0PJSF43VV9FQK", "user_id": null } }, "trigger": { "id": "Rechts enkel", "idx": "0", "alias": null, "platform": "device", "event": { "event_type": "shelly.click", "data": { "device_id": "20400558bc79dabd3eef8163fb4a0c79", "device": "shelly2pmg3-b08184eb6dd4", "channel": 2, "click_type": "single_push", "generation": 2 }, "origin": "LOCAL", "time_fired": "2026-01-13T23:16:48.170035+00:00", "context": { "id": "01KEWTBHXAG37JKNNHEZBMN4K8", "parent_id": null, "user_id": null } }, "description": "event 'shelly.click'" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-13T23:16:48.170372+00:00", "changed_variables": { "context": { "id": "01KEWTBHXA4J9AD9VND2C8HDEN", "parent_id": "01KEWTBHXAG37JKNNHEZBMN4K8", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-13T23:16:48.170427+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-13T23:16:48.170454+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-13T23:16:48.170541+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": {}, "target": { "entity_id": [ "light.lamp_badkamer" ] } }, "running_script": false } } ] }, "config": { "id": "1767031482023", "alias": "Schakelaar overloop", "description": "", "triggers": [ { "device_id": "20400558bc79dabd3eef8163fb4a0c79", "domain": "shelly", "type": "single_push", "subtype": "button2", "trigger": "device", "id": "Rechts enkel" }, { "device_id": "20400558bc79dabd3eef8163fb4a0c79", "domain": "shelly", "type": "double_push", "subtype": "button2", "trigger": "device", "id": "Rechts dubbel" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "Rechts enkel" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "target": { "entity_id": "light.lamp_badkamer" }, "data": {} } ] }, { "conditions": [ { "condition": "trigger", "id": [ "Rechts dubbel" ] } ], "sequence": [ { "action": "input_boolean.toggle", "metadata": {}, "target": { "entity_id": "input_boolean.in_de_douche" }, "data": {} } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEWTBHXA4J9AD9VND2C8HDEN", "parent_id": "01KEWTBHXAG37JKNNHEZBMN4K8", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0", "run_id": "6e1ec565bec75677931aeaf2c56116a9", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T23:16:48.170103+00:00", "finish": "2026-01-13T23:16:48.247711+00:00" }, "domain": "automation", "item_id": "1767031482023", "trigger": "event 'shelly.click'" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/0", "run_id": "6a6b16e5877b297c60f5e04cf0f64163", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T10:06:42.409979+00:00", "finish": "2026-01-14T10:06:42.498270+00:00" }, "domain": "automation", "item_id": "1767031482023", "trigger": "event 'shelly.click'", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T10:06:42.410012+00:00", "changed_variables": { "this": { "entity_id": "automation.schakelaar_overloop", "state": "on", "attributes": { "id": "1767031482023", "last_triggered": "2026-01-13T23:16:48.170227+00:00", "mode": "single", "current": 0, "friendly_name": "Schakelaar overloop" }, "last_changed": "2026-01-13T12:10:27.681371+00:00", "last_reported": "2026-01-13T23:16:48.247313+00:00", "last_updated": "2026-01-13T23:16:48.247313+00:00", "context": { "id": "01KEWTBHXA4J9AD9VND2C8HDEN", "parent_id": "01KEWTBHXAG37JKNNHEZBMN4K8", "user_id": null } }, "trigger": { "id": "Rechts enkel", "idx": "0", "alias": null, "platform": "device", "event": { "event_type": "shelly.click", "data": { "device_id": "20400558bc79dabd3eef8163fb4a0c79", "device": "shelly2pmg3-b08184eb6dd4", "channel": 2, "click_type": "single_push", "generation": 2 }, "origin": "LOCAL", "time_fired": "2026-01-14T10:06:42.409907+00:00", "context": { "id": "01KEXZHJ795MF5XF3G2M2BD7W7", "parent_id": null, "user_id": null } }, "description": "event 'shelly.click'" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T10:06:42.410258+00:00", "changed_variables": { "context": { "id": "01KEXZHJ79CGV3A7THGW86MFXH", "parent_id": "01KEXZHJ795MF5XF3G2M2BD7W7", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T10:06:42.410315+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T10:06:42.410358+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-14T10:06:42.410442+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": {}, "target": { "entity_id": [ "light.lamp_badkamer" ] } }, "running_script": false } } ] }, "config": { "id": "1767031482023", "alias": "Schakelaar overloop", "description": "", "triggers": [ { "device_id": "20400558bc79dabd3eef8163fb4a0c79", "domain": "shelly", "type": "single_push", "subtype": "button2", "trigger": "device", "id": "Rechts enkel" }, { "device_id": "20400558bc79dabd3eef8163fb4a0c79", "domain": "shelly", "type": "double_push", "subtype": "button2", "trigger": "device", "id": "Rechts dubbel" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "Rechts enkel" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "target": { "entity_id": "light.lamp_badkamer" }, "data": {} } ] }, { "conditions": [ { "condition": "trigger", "id": [ "Rechts dubbel" ] } ], "sequence": [ { "action": "input_boolean.toggle", "metadata": {}, "target": { "entity_id": "input_boolean.in_de_douche" }, "data": {} } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEXZHJ79CGV3A7THGW86MFXH", "parent_id": "01KEXZHJ795MF5XF3G2M2BD7W7", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0", "run_id": "6a6b16e5877b297c60f5e04cf0f64163", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T10:06:42.409979+00:00", "finish": "2026-01-14T10:06:42.498270+00:00" }, "domain": "automation", "item_id": "1767031482023", "trigger": "event 'shelly.click'" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/0", "run_id": "a246d67b1d3973d74e68c19878fe5813", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T13:11:24.343223+00:00", "finish": "2026-01-14T13:11:24.428257+00:00" }, "domain": "automation", "item_id": "1767031482023", "trigger": "event 'shelly.click'", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T13:11:24.343268+00:00", "changed_variables": { "this": { "entity_id": "automation.schakelaar_overloop", "state": "on", "attributes": { "id": "1767031482023", "last_triggered": "2026-01-14T10:06:42.410062+00:00", "mode": "single", "current": 0, "friendly_name": "Schakelaar overloop" }, "last_changed": "2026-01-13T12:10:27.681371+00:00", "last_reported": "2026-01-14T10:06:42.497400+00:00", "last_updated": "2026-01-14T10:06:42.497400+00:00", "context": { "id": "01KEXZHJ79CGV3A7THGW86MFXH", "parent_id": "01KEXZHJ795MF5XF3G2M2BD7W7", "user_id": null } }, "trigger": { "id": "Rechts enkel", "idx": "0", "alias": null, "platform": "device", "event": { "event_type": "shelly.click", "data": { "device_id": "20400558bc79dabd3eef8163fb4a0c79", "device": "shelly2pmg3-b08184eb6dd4", "channel": 2, "click_type": "single_push", "generation": 2 }, "origin": "LOCAL", "time_fired": "2026-01-14T13:11:24.343134+00:00", "context": { "id": "01KEYA3RDQWCR6CM61424Z0FG2", "parent_id": null, "user_id": null } }, "description": "event 'shelly.click'" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T13:11:24.343531+00:00", "changed_variables": { "context": { "id": "01KEYA3RDQND4WB0KP8K5862YG", "parent_id": "01KEYA3RDQWCR6CM61424Z0FG2", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T13:11:24.343597+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T13:11:24.343636+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-14T13:11:24.343746+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": {}, "target": { "entity_id": [ "light.lamp_badkamer" ] } }, "running_script": false } } ] }, "config": { "id": "1767031482023", "alias": "Schakelaar overloop", "description": "", "triggers": [ { "device_id": "20400558bc79dabd3eef8163fb4a0c79", "domain": "shelly", "type": "single_push", "subtype": "button2", "trigger": "device", "id": "Rechts enkel" }, { "device_id": "20400558bc79dabd3eef8163fb4a0c79", "domain": "shelly", "type": "double_push", "subtype": "button2", "trigger": "device", "id": "Rechts dubbel" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "Rechts enkel" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "target": { "entity_id": "light.lamp_badkamer" }, "data": {} } ] }, { "conditions": [ { "condition": "trigger", "id": [ "Rechts dubbel" ] } ], "sequence": [ { "action": "input_boolean.toggle", "metadata": {}, "target": { "entity_id": "input_boolean.in_de_douche" }, "data": {} } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEYA3RDQND4WB0KP8K5862YG", "parent_id": "01KEYA3RDQWCR6CM61424Z0FG2", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0", "run_id": "a246d67b1d3973d74e68c19878fe5813", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T13:11:24.343223+00:00", "finish": "2026-01-14T13:11:24.428257+00:00" }, "domain": "automation", "item_id": "1767031482023", "trigger": "event 'shelly.click'" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/0", "run_id": "70826ee6f78ca5b7cecfa34402e76f7c", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T15:59:03.204286+00:00", "finish": "2026-01-14T15:59:03.309617+00:00" }, "domain": "automation", "item_id": "1767031482023", "trigger": "event 'shelly.click'", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T15:59:03.204324+00:00", "changed_variables": { "this": { "entity_id": "automation.schakelaar_overloop", "state": "on", "attributes": { "id": "1767031482023", "last_triggered": "2026-01-14T13:11:24.343320+00:00", "mode": "single", "current": 0, "friendly_name": "Schakelaar overloop" }, "last_changed": "2026-01-14T15:48:56.989083+00:00", "last_reported": "2026-01-14T15:48:56.989083+00:00", "last_updated": "2026-01-14T15:48:56.989083+00:00", "context": { "id": "01KEYK47GX7XF1EAC35FQRAT6M", "parent_id": null, "user_id": null } }, "trigger": { "id": "Rechts enkel", "idx": "0", "alias": null, "platform": "device", "event": { "event_type": "shelly.click", "data": { "device_id": "20400558bc79dabd3eef8163fb4a0c79", "device": "shelly2pmg3-b08184eb6dd4", "channel": 2, "click_type": "single_push", "generation": 2 }, "origin": "LOCAL", "time_fired": "2026-01-14T15:59:03.204142+00:00", "context": { "id": "01KEYKPQH4M7YERRDKQFKRNM7Z", "parent_id": null, "user_id": null } }, "description": "event 'shelly.click'" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T15:59:03.204523+00:00", "changed_variables": { "context": { "id": "01KEYKPQH4820EZS7S9PQ36BC0", "parent_id": "01KEYKPQH4M7YERRDKQFKRNM7Z", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T15:59:03.204630+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T15:59:03.204656+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-14T15:59:03.204735+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": {}, "target": { "entity_id": [ "light.lamp_badkamer" ] } }, "running_script": false } } ] }, "config": { "id": "1767031482023", "alias": "Schakelaar overloop", "description": "", "triggers": [ { "device_id": "20400558bc79dabd3eef8163fb4a0c79", "domain": "shelly", "type": "single_push", "subtype": "button2", "trigger": "device", "id": "Rechts enkel" }, { "device_id": "20400558bc79dabd3eef8163fb4a0c79", "domain": "shelly", "type": "double_push", "subtype": "button2", "trigger": "device", "id": "Rechts dubbel" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "Rechts enkel" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "target": { "entity_id": "light.lamp_badkamer" }, "data": {} } ] }, { "conditions": [ { "condition": "trigger", "id": [ "Rechts dubbel" ] } ], "sequence": [ { "action": "input_boolean.toggle", "metadata": {}, "target": { "entity_id": "input_boolean.in_de_douche" }, "data": {} } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEYKPQH4820EZS7S9PQ36BC0", "parent_id": "01KEYKPQH4M7YERRDKQFKRNM7Z", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0", "run_id": "70826ee6f78ca5b7cecfa34402e76f7c", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T15:59:03.204286+00:00", "finish": "2026-01-14T15:59:03.309617+00:00" }, "domain": "automation", "item_id": "1767031482023", "trigger": "event 'shelly.click'" } } ], "automation.1764153380661": [ { "extended_dict": { "last_step": "action/1", "run_id": "cc2864b07d5281be2cf08077946c1d6f", "state": "stopped", "script_execution": "aborted", "timestamp": { "start": "2026-01-13T14:26:29.766922+00:00", "finish": "2026-01-13T14:28:30.131345+00:00" }, "domain": "automation", "item_id": "1764153380661", "trigger": "state of lock.voordeur", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-13T14:26:29.766957+00:00", "changed_variables": { "this": { "entity_id": "automation.alles_uit_vragen_bij_deur_op_slot", "state": "on", "attributes": { "id": "1764153380661", "last_triggered": "2026-01-12T09:23:49.052433+00:00", "mode": "single", "current": 0, "friendly_name": "Alles uit vragen bij deur op slot" }, "last_changed": "2026-01-13T12:10:27.680741+00:00", "last_reported": "2026-01-13T12:10:27.680741+00:00", "last_updated": "2026-01-13T12:10:27.680741+00:00", "context": { "id": "01KEVM7EF0SMS0K2XX1XWFHHTQ", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "lock.voordeur", "from_state": { "entity_id": "lock.voordeur", "state": "unlocked", "attributes": { "changed_by": "KeyID 255", "friendly_name": "Voordeur", "supported_features": 1 }, "last_changed": "2026-01-13T13:59:45.467712+00:00", "last_reported": "2026-01-13T13:59:52.530715+00:00", "last_updated": "2026-01-13T13:59:52.530715+00:00", "context": { "id": "01KEVTFSEJK7HZFJX0JC642H08", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "lock.voordeur", "state": "locked", "attributes": { "changed_by": "KeyID 255", "friendly_name": "Voordeur", "supported_features": 1 }, "last_changed": "2026-01-13T14:26:29.766259+00:00", "last_reported": "2026-01-13T14:26:29.766259+00:00", "last_updated": "2026-01-13T14:26:29.766259+00:00", "context": { "id": "01KEVW0H86W5YFKB389W95JJSD", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of lock.voordeur" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-13T14:26:29.767211+00:00", "changed_variables": { "context": { "id": "01KEVW0H860J9Z5WJH3T3JNG7G", "parent_id": "01KEVW0H86W5YFKB389W95JJSD", "user_id": null } }, "result": { "params": { "domain": "notify", "service": "notify", "service_data": { "title": "Alles uitzetten?", "message": "Je hebt de voordeur op slot gedaan. Wil je alles uitschakelen?", "data": { "actions": [ { "action": "TURN_OFF_ALL", "title": "Ja" }, { "action": "IGNORE", "title": "Nee" } ] } }, "target": {} }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-13T14:26:30.129642+00:00", "changed_variables": { "wait": { "remaining": 0.0, "completed": false, "trigger": null } }, "error": "TimeoutError", "result": { "wait": { "remaining": 0.0, "completed": false, "trigger": null }, "timeout": true } } ] }, "config": { "id": "1764153380661", "alias": "Alles uit vragen bij deur op slot", "description": "Interactieve notificatie wanneer voordeur wordt vergrendeld", "triggers": [ { "entity_id": "lock.voordeur", "to": "locked", "trigger": "state" } ], "actions": [ { "alias": "Stuur interactieve notificatie", "data": { "title": "Alles uitzetten?", "message": "Je hebt de voordeur op slot gedaan. Wil je alles uitschakelen?", "data": { "actions": [ { "action": "TURN_OFF_ALL", "title": "Ja" }, { "action": "IGNORE", "title": "Nee" } ] } }, "action": "notify.notify" }, { "alias": "Wacht op notificatie-actie", "wait_for_trigger": [ { "event_type": "mobile_app_notification_action", "event_data": { "action": "TURN_OFF_ALL" }, "trigger": "event" } ], "timeout": "00:02:00", "continue_on_timeout": false }, { "alias": "Voer uitschakelacties uit", "action": "script.boiler_uit" }, { "action": "script.verwarming_eco_2" }, { "action": "script.alle_lampen_uit" } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEVW0H860J9Z5WJH3T3JNG7G", "parent_id": "01KEVW0H86W5YFKB389W95JJSD", "user_id": null } }, "short_dict": { "last_step": "action/1", "run_id": "cc2864b07d5281be2cf08077946c1d6f", "state": "stopped", "script_execution": "aborted", "timestamp": { "start": "2026-01-13T14:26:29.766922+00:00", "finish": "2026-01-13T14:28:30.131345+00:00" }, "domain": "automation", "item_id": "1764153380661", "trigger": "state of lock.voordeur" } }, { "extended_dict": { "last_step": "action/1", "run_id": "36c0c884a4982281607df5b935bd756f", "state": "stopped", "script_execution": "aborted", "timestamp": { "start": "2026-01-13T15:54:41.641225+00:00", "finish": "2026-01-13T15:56:41.896952+00:00" }, "domain": "automation", "item_id": "1764153380661", "trigger": "state of lock.voordeur", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-13T15:54:41.641252+00:00", "changed_variables": { "this": { "entity_id": "automation.alles_uit_vragen_bij_deur_op_slot", "state": "on", "attributes": { "id": "1764153380661", "last_triggered": "2026-01-13T14:26:29.767010+00:00", "mode": "single", "current": 0, "friendly_name": "Alles uit vragen bij deur op slot" }, "last_changed": "2026-01-13T12:10:27.680741+00:00", "last_reported": "2026-01-13T14:28:30.130776+00:00", "last_updated": "2026-01-13T14:28:30.130776+00:00", "context": { "id": "01KEVW46SJYDDQ260VAQ4HFYN3", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "lock.voordeur", "from_state": { "entity_id": "lock.voordeur", "state": "unlocked", "attributes": { "changed_by": "KeyID 255", "friendly_name": "Voordeur", "supported_features": 1 }, "last_changed": "2026-01-13T15:11:13.482600+00:00", "last_reported": "2026-01-13T15:11:20.364733+00:00", "last_updated": "2026-01-13T15:11:20.364733+00:00", "context": { "id": "01KEVYJMSCYYR7FT94GYWN2J51", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "lock.voordeur", "state": "locked", "attributes": { "changed_by": "KeyID 255", "friendly_name": "Voordeur", "supported_features": 1 }, "last_changed": "2026-01-13T15:54:41.640745+00:00", "last_reported": "2026-01-13T15:54:41.640745+00:00", "last_updated": "2026-01-13T15:54:41.640745+00:00", "context": { "id": "01KEW121386KZZHSHM49J5VVFQ", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of lock.voordeur" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-13T15:54:41.641429+00:00", "changed_variables": { "context": { "id": "01KEW12139R1YPDFSFQB76AHRZ", "parent_id": "01KEW121386KZZHSHM49J5VVFQ", "user_id": null } }, "result": { "params": { "domain": "notify", "service": "notify", "service_data": { "title": "Alles uitzetten?", "message": "Je hebt de voordeur op slot gedaan. Wil je alles uitschakelen?", "data": { "actions": [ { "action": "TURN_OFF_ALL", "title": "Ja" }, { "action": "IGNORE", "title": "Nee" } ] } }, "target": {} }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-13T15:54:41.895012+00:00", "changed_variables": { "wait": { "remaining": 0.0, "completed": false, "trigger": null } }, "error": "TimeoutError", "result": { "wait": { "remaining": 0.0, "completed": false, "trigger": null }, "timeout": true } } ] }, "config": { "id": "1764153380661", "alias": "Alles uit vragen bij deur op slot", "description": "Interactieve notificatie wanneer voordeur wordt vergrendeld", "triggers": [ { "entity_id": "lock.voordeur", "to": "locked", "trigger": "state" } ], "actions": [ { "alias": "Stuur interactieve notificatie", "data": { "title": "Alles uitzetten?", "message": "Je hebt de voordeur op slot gedaan. Wil je alles uitschakelen?", "data": { "actions": [ { "action": "TURN_OFF_ALL", "title": "Ja" }, { "action": "IGNORE", "title": "Nee" } ] } }, "action": "notify.notify" }, { "alias": "Wacht op notificatie-actie", "wait_for_trigger": [ { "event_type": "mobile_app_notification_action", "event_data": { "action": "TURN_OFF_ALL" }, "trigger": "event" } ], "timeout": "00:02:00", "continue_on_timeout": false }, { "alias": "Voer uitschakelacties uit", "action": "script.boiler_uit" }, { "action": "script.verwarming_eco_2" }, { "action": "script.alle_lampen_uit" } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEW12139R1YPDFSFQB76AHRZ", "parent_id": "01KEW121386KZZHSHM49J5VVFQ", "user_id": null } }, "short_dict": { "last_step": "action/1", "run_id": "36c0c884a4982281607df5b935bd756f", "state": "stopped", "script_execution": "aborted", "timestamp": { "start": "2026-01-13T15:54:41.641225+00:00", "finish": "2026-01-13T15:56:41.896952+00:00" }, "domain": "automation", "item_id": "1764153380661", "trigger": "state of lock.voordeur" } }, { "extended_dict": { "last_step": "action/1", "run_id": "dca1f59be45e62a426210725d2946f4c", "state": "stopped", "script_execution": "aborted", "timestamp": { "start": "2026-01-13T22:36:00.485124+00:00", "finish": "2026-01-13T22:38:00.836837+00:00" }, "domain": "automation", "item_id": "1764153380661", "trigger": "state of lock.voordeur", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-13T22:36:00.485298+00:00", "changed_variables": { "this": { "entity_id": "automation.alles_uit_vragen_bij_deur_op_slot", "state": "on", "attributes": { "id": "1764153380661", "last_triggered": "2026-01-13T15:54:41.641296+00:00", "mode": "single", "current": 0, "friendly_name": "Alles uit vragen bij deur op slot" }, "last_changed": "2026-01-13T12:10:27.680741+00:00", "last_reported": "2026-01-13T15:56:41.896444+00:00", "last_updated": "2026-01-13T15:56:41.896444+00:00", "context": { "id": "01KEW15PH86AHZBJBJ53CBDSBB", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "lock.voordeur", "from_state": { "entity_id": "lock.voordeur", "state": "unlocked", "attributes": { "changed_by": "KeyID 255", "friendly_name": "Voordeur", "supported_features": 1 }, "last_changed": "2026-01-13T22:35:47.539188+00:00", "last_reported": "2026-01-13T22:35:54.814954+00:00", "last_updated": "2026-01-13T22:35:54.814954+00:00", "context": { "id": "01KEWR0P1YZ9DR94MNK8VDZGBQ", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "lock.voordeur", "state": "locked", "attributes": { "changed_by": "KeyID 255", "friendly_name": "Voordeur", "supported_features": 1 }, "last_changed": "2026-01-13T22:36:00.481024+00:00", "last_reported": "2026-01-13T22:36:00.481024+00:00", "last_updated": "2026-01-13T22:36:00.481024+00:00", "context": { "id": "01KEWR0VK1CGRWYD416EKM0RJ4", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of lock.voordeur" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-13T22:36:00.486635+00:00", "changed_variables": { "context": { "id": "01KEWR0VK5JQXWNME2KBHS5ZCZ", "parent_id": "01KEWR0VK1CGRWYD416EKM0RJ4", "user_id": null } }, "result": { "params": { "domain": "notify", "service": "notify", "service_data": { "title": "Alles uitzetten?", "message": "Je hebt de voordeur op slot gedaan. Wil je alles uitschakelen?", "data": { "actions": [ { "action": "TURN_OFF_ALL", "title": "Ja" }, { "action": "IGNORE", "title": "Nee" } ] } }, "target": {} }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-13T22:36:00.834499+00:00", "changed_variables": { "wait": { "remaining": 0.0, "completed": false, "trigger": null } }, "error": "TimeoutError", "result": { "wait": { "remaining": 0.0, "completed": false, "trigger": null }, "timeout": true } } ] }, "config": { "id": "1764153380661", "alias": "Alles uit vragen bij deur op slot", "description": "Interactieve notificatie wanneer voordeur wordt vergrendeld", "triggers": [ { "entity_id": "lock.voordeur", "to": "locked", "trigger": "state" } ], "actions": [ { "alias": "Stuur interactieve notificatie", "data": { "title": "Alles uitzetten?", "message": "Je hebt de voordeur op slot gedaan. Wil je alles uitschakelen?", "data": { "actions": [ { "action": "TURN_OFF_ALL", "title": "Ja" }, { "action": "IGNORE", "title": "Nee" } ] } }, "action": "notify.notify" }, { "alias": "Wacht op notificatie-actie", "wait_for_trigger": [ { "event_type": "mobile_app_notification_action", "event_data": { "action": "TURN_OFF_ALL" }, "trigger": "event" } ], "timeout": "00:02:00", "continue_on_timeout": false }, { "alias": "Voer uitschakelacties uit", "action": "script.boiler_uit" }, { "action": "script.verwarming_eco_2" }, { "action": "script.alle_lampen_uit" } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEWR0VK5JQXWNME2KBHS5ZCZ", "parent_id": "01KEWR0VK1CGRWYD416EKM0RJ4", "user_id": null } }, "short_dict": { "last_step": "action/1", "run_id": "dca1f59be45e62a426210725d2946f4c", "state": "stopped", "script_execution": "aborted", "timestamp": { "start": "2026-01-13T22:36:00.485124+00:00", "finish": "2026-01-13T22:38:00.836837+00:00" }, "domain": "automation", "item_id": "1764153380661", "trigger": "state of lock.voordeur" } }, { "extended_dict": { "last_step": "action/1", "run_id": "fcaa1557b5bc3450fec6904335a42d89", "state": "stopped", "script_execution": "aborted", "timestamp": { "start": "2026-01-14T11:08:49.495771+00:00", "finish": "2026-01-14T11:10:49.753583+00:00" }, "domain": "automation", "item_id": "1764153380661", "trigger": "state of lock.voordeur", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T11:08:49.495809+00:00", "changed_variables": { "this": { "entity_id": "automation.alles_uit_vragen_bij_deur_op_slot", "state": "on", "attributes": { "id": "1764153380661", "last_triggered": "2026-01-13T22:36:00.485523+00:00", "mode": "single", "current": 0, "friendly_name": "Alles uit vragen bij deur op slot" }, "last_changed": "2026-01-13T12:10:27.680741+00:00", "last_reported": "2026-01-13T22:38:00.836295+00:00", "last_updated": "2026-01-13T22:38:00.836295+00:00", "context": { "id": "01KEWR4H44TNSA415NX2HJ2Q65", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "lock.voordeur", "from_state": { "entity_id": "lock.voordeur", "state": "unlocked", "attributes": { "changed_by": "KeyID 255", "friendly_name": "Voordeur", "supported_features": 1 }, "last_changed": "2026-01-14T11:08:40.553273+00:00", "last_reported": "2026-01-14T11:08:40.553273+00:00", "last_updated": "2026-01-14T11:08:40.553273+00:00", "context": { "id": "01KEY331790XF05R67ZDSH08Q3", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "lock.voordeur", "state": "locked", "attributes": { "changed_by": "KeyID 255", "friendly_name": "Voordeur", "supported_features": 1 }, "last_changed": "2026-01-14T11:08:49.494937+00:00", "last_reported": "2026-01-14T11:08:49.494937+00:00", "last_updated": "2026-01-14T11:08:49.494937+00:00", "context": { "id": "01KEY339YPF8BT9E2TTKQVQ8YE", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of lock.voordeur" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T11:08:49.496111+00:00", "changed_variables": { "context": { "id": "01KEY339YQQS62T6QRAPA6SP0X", "parent_id": "01KEY339YPF8BT9E2TTKQVQ8YE", "user_id": null } }, "result": { "params": { "domain": "notify", "service": "notify", "service_data": { "title": "Alles uitzetten?", "message": "Je hebt de voordeur op slot gedaan. Wil je alles uitschakelen?", "data": { "actions": [ { "action": "TURN_OFF_ALL", "title": "Ja" }, { "action": "IGNORE", "title": "Nee" } ] } }, "target": {} }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-14T11:08:49.751254+00:00", "changed_variables": { "wait": { "remaining": 0.0, "completed": false, "trigger": null } }, "error": "TimeoutError", "result": { "wait": { "remaining": 0.0, "completed": false, "trigger": null }, "timeout": true } } ] }, "config": { "id": "1764153380661", "alias": "Alles uit vragen bij deur op slot", "description": "Interactieve notificatie wanneer voordeur wordt vergrendeld", "triggers": [ { "entity_id": "lock.voordeur", "to": "locked", "trigger": "state" } ], "actions": [ { "alias": "Stuur interactieve notificatie", "data": { "title": "Alles uitzetten?", "message": "Je hebt de voordeur op slot gedaan. Wil je alles uitschakelen?", "data": { "actions": [ { "action": "TURN_OFF_ALL", "title": "Ja" }, { "action": "IGNORE", "title": "Nee" } ] } }, "action": "notify.notify" }, { "alias": "Wacht op notificatie-actie", "wait_for_trigger": [ { "event_type": "mobile_app_notification_action", "event_data": { "action": "TURN_OFF_ALL" }, "trigger": "event" } ], "timeout": "00:02:00", "continue_on_timeout": false }, { "alias": "Voer uitschakelacties uit", "action": "script.boiler_uit" }, { "action": "script.verwarming_eco_2" }, { "action": "script.alle_lampen_uit" } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEY339YQQS62T6QRAPA6SP0X", "parent_id": "01KEY339YPF8BT9E2TTKQVQ8YE", "user_id": null } }, "short_dict": { "last_step": "action/1", "run_id": "fcaa1557b5bc3450fec6904335a42d89", "state": "stopped", "script_execution": "aborted", "timestamp": { "start": "2026-01-14T11:08:49.495771+00:00", "finish": "2026-01-14T11:10:49.753583+00:00" }, "domain": "automation", "item_id": "1764153380661", "trigger": "state of lock.voordeur" } }, { "extended_dict": { "last_step": "action/1", "run_id": "9858526136a2899266840583a234d18f", "state": "stopped", "script_execution": "aborted", "timestamp": { "start": "2026-01-14T16:03:25.843519+00:00", "finish": "2026-01-14T16:05:26.123136+00:00" }, "domain": "automation", "item_id": "1764153380661", "trigger": "state of lock.voordeur", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T16:03:25.843542+00:00", "changed_variables": { "this": { "entity_id": "automation.alles_uit_vragen_bij_deur_op_slot", "state": "on", "attributes": { "id": "1764153380661", "last_triggered": "2026-01-14T11:08:49.495882+00:00", "mode": "single", "current": 0, "friendly_name": "Alles uit vragen bij deur op slot" }, "last_changed": "2026-01-14T15:48:56.988438+00:00", "last_reported": "2026-01-14T15:48:56.988438+00:00", "last_updated": "2026-01-14T15:48:56.988438+00:00", "context": { "id": "01KEYK47GW7GP41VXNB73WSZNX", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "lock.voordeur", "from_state": { "entity_id": "lock.voordeur", "state": "unlocked", "attributes": { "changed_by": "KeyID 255", "friendly_name": "Voordeur", "supported_features": 1 }, "last_changed": "2026-01-14T15:48:48.828724+00:00", "last_reported": "2026-01-14T16:03:21.722687+00:00", "last_updated": "2026-01-14T16:03:21.722687+00:00", "context": { "id": "01KEYKYKZTW1Q4BSB9BJHXGH2Z", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "lock.voordeur", "state": "locked", "attributes": { "changed_by": "KeyID 255", "friendly_name": "Voordeur", "supported_features": 1 }, "last_changed": "2026-01-14T16:03:25.843050+00:00", "last_reported": "2026-01-14T16:03:25.843050+00:00", "last_updated": "2026-01-14T16:03:25.843050+00:00", "context": { "id": "01KEYKYR0KD6CS6YF3ADKQ5QF7", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of lock.voordeur" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T16:03:25.843779+00:00", "changed_variables": { "context": { "id": "01KEYKYR0K5PMAV9W2SB951ECW", "parent_id": "01KEYKYR0KD6CS6YF3ADKQ5QF7", "user_id": null } }, "result": { "params": { "domain": "notify", "service": "notify", "service_data": { "title": "Alles uitzetten?", "message": "Je hebt de voordeur op slot gedaan. Wil je alles uitschakelen?", "data": { "actions": [ { "action": "TURN_OFF_ALL", "title": "Ja" }, { "action": "IGNORE", "title": "Nee" } ] } }, "target": {} }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-14T16:03:26.118012+00:00", "changed_variables": { "wait": { "remaining": 0.0, "completed": false, "trigger": null } }, "error": "TimeoutError", "result": { "wait": { "remaining": 0.0, "completed": false, "trigger": null }, "timeout": true } } ] }, "config": { "id": "1764153380661", "alias": "Alles uit vragen bij deur op slot", "description": "Interactieve notificatie wanneer voordeur wordt vergrendeld", "triggers": [ { "entity_id": "lock.voordeur", "to": "locked", "trigger": "state" } ], "actions": [ { "alias": "Stuur interactieve notificatie", "data": { "title": "Alles uitzetten?", "message": "Je hebt de voordeur op slot gedaan. Wil je alles uitschakelen?", "data": { "actions": [ { "action": "TURN_OFF_ALL", "title": "Ja" }, { "action": "IGNORE", "title": "Nee" } ] } }, "action": "notify.notify" }, { "alias": "Wacht op notificatie-actie", "wait_for_trigger": [ { "event_type": "mobile_app_notification_action", "event_data": { "action": "TURN_OFF_ALL" }, "trigger": "event" } ], "timeout": "00:02:00", "continue_on_timeout": false }, { "alias": "Voer uitschakelacties uit", "action": "script.boiler_uit" }, { "action": "script.verwarming_eco_2" }, { "action": "script.alle_lampen_uit" } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEYKYR0K5PMAV9W2SB951ECW", "parent_id": "01KEYKYR0KD6CS6YF3ADKQ5QF7", "user_id": null } }, "short_dict": { "last_step": "action/1", "run_id": "9858526136a2899266840583a234d18f", "state": "stopped", "script_execution": "aborted", "timestamp": { "start": "2026-01-14T16:03:25.843519+00:00", "finish": "2026-01-14T16:05:26.123136+00:00" }, "domain": "automation", "item_id": "1764153380661", "trigger": "state of lock.voordeur" } } ], "automation.1759752615892": [ { "extended_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "run_id": "6c4be8b541b4b7012215003bd3949baf", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T06:57:45.404871+00:00", "finish": "2026-01-14T06:57:51.914335+00:00" }, "domain": "automation", "item_id": "1759752615892", "trigger": "state of binary_sensor.shelly1pmminig3_54320451c290_input_0", "trace": { "trigger/1": [ { "path": "trigger/1", "timestamp": "2026-01-14T06:57:45.404902+00:00", "changed_variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_tafel", "primary_input_var": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "secondary_input_var": "input_boolean.dummy", "tertiary_input_var": "input_boolean.dummy", "confirm_switch_var": "switch.lamp_tafel_main_confirm", "this": { "entity_id": "automation.schakelaar_tafel", "state": "on", "attributes": { "id": "1759752615892", "last_triggered": "2026-01-13T22:36:03.734519+00:00", "mode": "single", "current": 0, "friendly_name": "Schakelaar tafel [BP]" }, "last_changed": "2026-01-13T12:10:27.679746+00:00", "last_reported": "2026-01-13T22:36:03.924146+00:00", "last_updated": "2026-01-13T22:36:03.924146+00:00", "context": { "id": "01KEWR0YRPAC16BTZ739TDTH0W", "parent_id": "01KEWR0YRGENWF3X50BQF71K1Q", "user_id": null } }, "trigger": { "id": "1", "idx": "1", "alias": null, "platform": "state", "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "from_state": { "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "state": "on", "attributes": { "device_class": "power", "friendly_name": "Schakelaar eettafel" }, "last_changed": "2026-01-13T22:36:03.728838+00:00", "last_reported": "2026-01-13T22:36:03.728838+00:00", "last_updated": "2026-01-13T22:36:03.728838+00:00", "context": { "id": "01KEWR0YRGENWF3X50BQF71K1Q", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "state": "off", "attributes": { "device_class": "power", "friendly_name": "Schakelaar eettafel" }, "last_changed": "2026-01-14T06:57:45.403723+00:00", "last_reported": "2026-01-14T06:57:45.403723+00:00", "last_updated": "2026-01-14T06:57:45.403723+00:00", "context": { "id": "01KEXMQJXVNV2JC5T4CYD4B5J7", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.shelly1pmminig3_54320451c290_input_0" } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T06:57:45.404922+00:00", "result": { "result": true, "entities": [] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T06:57:45.405218+00:00", "changed_variables": { "context": { "id": "01KEXMQJXW782DF3QRG1YPD6ME", "parent_id": "01KEXMQJXVNV2JC5T4CYD4B5J7", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T06:57:45.405273+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T06:57:45.405309+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-14T06:57:45.405439+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-14T06:57:45.405472+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-14T06:57:45.405500+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-14T06:57:45.405620+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-14T06:57:45.405651+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-14T06:57:45.405681+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-14T06:57:45.405795+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": {}, "target": { "entity_id": [ "light.lamp_tafel" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1", "timestamp": "2026-01-14T06:57:51.847873+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0", "timestamp": "2026-01-14T06:57:51.847917+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0", "timestamp": "2026-01-14T06:57:51.847952+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "timestamp": "2026-01-14T06:57:51.848135+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.lamp_tafel_main_confirm" ] } }, "running_script": false } } ] }, "config": { "variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_tafel", "primary_input_var": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "secondary_input_var": "input_boolean.dummy", "tertiary_input_var": "input_boolean.dummy", "confirm_switch_var": "switch.lamp_tafel_main_confirm" }, "mode": "single", "triggers": [ { "trigger": "state", "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "on", "to": "off" } ], "actions": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'lamp' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n (switch_type_selected == 'toggle' or\n (switch_type_selected == 'momentary' and trigger.to_state.state == 'on')) }}\n" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ lamp_entity_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ lamp_entity_var }}" }, "action": "light.toggle" } ] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'custom' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'on' and\n (switch_type_selected == 'toggle' or switch_type_selected == 'momentary') }}\n" } ], "sequence": [] }, { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'off' and\n switch_type_selected == 'toggle' }}\n" } ], "sequence": [] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ], "conditions": [ { "condition": "template", "value_template": "{{ trigger.from_state.state in ['on', 'off'] and\n trigger.to_state.state in ['on', 'off'] }}\n" } ], "id": "1759752615892", "alias": "schakelaar tafel", "description": "" }, "blueprint_inputs": { "id": "1759752615892", "alias": "schakelaar tafel", "description": "", "use_blueprint": { "path": "willumpie82/shelly-detached-input3.yaml", "input": { "primary_input": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "lamp_entity": "light.lamp_tafel", "confirm_switch": "switch.lamp_tafel_main_confirm" } } }, "context": { "id": "01KEXMQJXW782DF3QRG1YPD6ME", "parent_id": "01KEXMQJXVNV2JC5T4CYD4B5J7", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "run_id": "6c4be8b541b4b7012215003bd3949baf", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T06:57:45.404871+00:00", "finish": "2026-01-14T06:57:51.914335+00:00" }, "domain": "automation", "item_id": "1759752615892", "trigger": "state of binary_sensor.shelly1pmminig3_54320451c290_input_0" } }, { "extended_dict": { "last_step": "condition/0", "run_id": "61980a316970dbf9e373b43059be57da", "state": "stopped", "script_execution": "failed_single", "timestamp": { "start": "2026-01-14T06:57:49.583352+00:00", "finish": "2026-01-14T06:57:49.583636+00:00" }, "domain": "automation", "item_id": "1759752615892", "trigger": "state of binary_sensor.shelly1pmminig3_54320451c290_input_0", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T06:57:49.583383+00:00", "changed_variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_tafel", "primary_input_var": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "secondary_input_var": "input_boolean.dummy", "tertiary_input_var": "input_boolean.dummy", "confirm_switch_var": "switch.lamp_tafel_main_confirm", "this": { "entity_id": "automation.schakelaar_tafel", "state": "on", "attributes": { "id": "1759752615892", "last_triggered": "2026-01-14T06:57:45.405065+00:00", "mode": "single", "current": 1, "friendly_name": "Schakelaar tafel [BP]" }, "last_changed": "2026-01-13T12:10:27.679746+00:00", "last_reported": "2026-01-14T06:57:45.405090+00:00", "last_updated": "2026-01-14T06:57:45.405090+00:00", "context": { "id": "01KEXMQJXW782DF3QRG1YPD6ME", "parent_id": "01KEXMQJXVNV2JC5T4CYD4B5J7", "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "from_state": { "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "state": "off", "attributes": { "device_class": "power", "friendly_name": "Schakelaar eettafel" }, "last_changed": "2026-01-14T06:57:45.403723+00:00", "last_reported": "2026-01-14T06:57:45.403723+00:00", "last_updated": "2026-01-14T06:57:45.403723+00:00", "context": { "id": "01KEXMQJXVNV2JC5T4CYD4B5J7", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "state": "on", "attributes": { "device_class": "power", "friendly_name": "Schakelaar eettafel" }, "last_changed": "2026-01-14T06:57:49.582775+00:00", "last_reported": "2026-01-14T06:57:49.582775+00:00", "last_updated": "2026-01-14T06:57:49.582775+00:00", "context": { "id": "01KEXMQQ0E0AJBMH77XT3G0VGF", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.shelly1pmminig3_54320451c290_input_0" } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T06:57:49.583403+00:00", "result": { "result": true, "entities": [] } } ] }, "config": { "variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_tafel", "primary_input_var": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "secondary_input_var": "input_boolean.dummy", "tertiary_input_var": "input_boolean.dummy", "confirm_switch_var": "switch.lamp_tafel_main_confirm" }, "mode": "single", "triggers": [ { "trigger": "state", "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "on", "to": "off" } ], "actions": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'lamp' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n (switch_type_selected == 'toggle' or\n (switch_type_selected == 'momentary' and trigger.to_state.state == 'on')) }}\n" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ lamp_entity_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ lamp_entity_var }}" }, "action": "light.toggle" } ] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'custom' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'on' and\n (switch_type_selected == 'toggle' or switch_type_selected == 'momentary') }}\n" } ], "sequence": [] }, { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'off' and\n switch_type_selected == 'toggle' }}\n" } ], "sequence": [] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ], "conditions": [ { "condition": "template", "value_template": "{{ trigger.from_state.state in ['on', 'off'] and\n trigger.to_state.state in ['on', 'off'] }}\n" } ], "id": "1759752615892", "alias": "schakelaar tafel", "description": "" }, "blueprint_inputs": { "id": "1759752615892", "alias": "schakelaar tafel", "description": "", "use_blueprint": { "path": "willumpie82/shelly-detached-input3.yaml", "input": { "primary_input": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "lamp_entity": "light.lamp_tafel", "confirm_switch": "switch.lamp_tafel_main_confirm" } } }, "context": { "id": "01KEXMQQ0FN24QF25EN0M5D4SC", "parent_id": "01KEXMQQ0E0AJBMH77XT3G0VGF", "user_id": null } }, "short_dict": { "last_step": "condition/0", "run_id": "61980a316970dbf9e373b43059be57da", "state": "stopped", "script_execution": "failed_single", "timestamp": { "start": "2026-01-14T06:57:49.583352+00:00", "finish": "2026-01-14T06:57:49.583636+00:00" }, "domain": "automation", "item_id": "1759752615892", "trigger": "state of binary_sensor.shelly1pmminig3_54320451c290_input_0" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "run_id": "216f13443c17c408b3b562fc9ad60a16", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T09:01:21.854068+00:00", "finish": "2026-01-14T09:01:22.145765+00:00" }, "domain": "automation", "item_id": "1759752615892", "trigger": "state of binary_sensor.shelly1pmminig3_54320451c290_input_0", "trace": { "trigger/1": [ { "path": "trigger/1", "timestamp": "2026-01-14T09:01:21.854099+00:00", "changed_variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_tafel", "primary_input_var": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "secondary_input_var": "input_boolean.dummy", "tertiary_input_var": "input_boolean.dummy", "confirm_switch_var": "switch.lamp_tafel_main_confirm", "this": { "entity_id": "automation.schakelaar_tafel", "state": "on", "attributes": { "id": "1759752615892", "last_triggered": "2026-01-14T06:57:45.405065+00:00", "mode": "single", "current": 0, "friendly_name": "Schakelaar tafel [BP]" }, "last_changed": "2026-01-13T12:10:27.679746+00:00", "last_reported": "2026-01-14T06:57:51.910339+00:00", "last_updated": "2026-01-14T06:57:51.910339+00:00", "context": { "id": "01KEXMQQ0FN24QF25EN0M5D4SC", "parent_id": "01KEXMQQ0E0AJBMH77XT3G0VGF", "user_id": null } }, "trigger": { "id": "1", "idx": "1", "alias": null, "platform": "state", "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "from_state": { "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "state": "on", "attributes": { "device_class": "power", "friendly_name": "Schakelaar eettafel" }, "last_changed": "2026-01-14T06:57:49.582775+00:00", "last_reported": "2026-01-14T06:57:49.582775+00:00", "last_updated": "2026-01-14T06:57:49.582775+00:00", "context": { "id": "01KEXMQQ0E0AJBMH77XT3G0VGF", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "state": "off", "attributes": { "device_class": "power", "friendly_name": "Schakelaar eettafel" }, "last_changed": "2026-01-14T09:01:21.853529+00:00", "last_reported": "2026-01-14T09:01:21.853529+00:00", "last_updated": "2026-01-14T09:01:21.853529+00:00", "context": { "id": "01KEXVSXHX7V37QCXKF5AH9WRT", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.shelly1pmminig3_54320451c290_input_0" } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T09:01:21.854118+00:00", "result": { "result": true, "entities": [] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T09:01:21.854430+00:00", "changed_variables": { "context": { "id": "01KEXVSXHYBFTKPZEBRXQKVWB3", "parent_id": "01KEXVSXHX7V37QCXKF5AH9WRT", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T09:01:21.854483+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T09:01:21.854518+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-14T09:01:21.854641+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-14T09:01:21.854672+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-14T09:01:21.854702+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-14T09:01:21.854818+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-14T09:01:21.854857+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-14T09:01:21.854885+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-14T09:01:21.854994+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": {}, "target": { "entity_id": [ "light.lamp_tafel" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1", "timestamp": "2026-01-14T09:01:22.107461+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0", "timestamp": "2026-01-14T09:01:22.107525+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0", "timestamp": "2026-01-14T09:01:22.107587+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "timestamp": "2026-01-14T09:01:22.107813+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.lamp_tafel_main_confirm" ] } }, "running_script": false } } ] }, "config": { "variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_tafel", "primary_input_var": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "secondary_input_var": "input_boolean.dummy", "tertiary_input_var": "input_boolean.dummy", "confirm_switch_var": "switch.lamp_tafel_main_confirm" }, "mode": "single", "triggers": [ { "trigger": "state", "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "on", "to": "off" } ], "actions": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'lamp' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n (switch_type_selected == 'toggle' or\n (switch_type_selected == 'momentary' and trigger.to_state.state == 'on')) }}\n" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ lamp_entity_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ lamp_entity_var }}" }, "action": "light.toggle" } ] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'custom' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'on' and\n (switch_type_selected == 'toggle' or switch_type_selected == 'momentary') }}\n" } ], "sequence": [] }, { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'off' and\n switch_type_selected == 'toggle' }}\n" } ], "sequence": [] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ], "conditions": [ { "condition": "template", "value_template": "{{ trigger.from_state.state in ['on', 'off'] and\n trigger.to_state.state in ['on', 'off'] }}\n" } ], "id": "1759752615892", "alias": "schakelaar tafel", "description": "" }, "blueprint_inputs": { "id": "1759752615892", "alias": "schakelaar tafel", "description": "", "use_blueprint": { "path": "willumpie82/shelly-detached-input3.yaml", "input": { "primary_input": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "lamp_entity": "light.lamp_tafel", "confirm_switch": "switch.lamp_tafel_main_confirm" } } }, "context": { "id": "01KEXVSXHYBFTKPZEBRXQKVWB3", "parent_id": "01KEXVSXHX7V37QCXKF5AH9WRT", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "run_id": "216f13443c17c408b3b562fc9ad60a16", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T09:01:21.854068+00:00", "finish": "2026-01-14T09:01:22.145765+00:00" }, "domain": "automation", "item_id": "1759752615892", "trigger": "state of binary_sensor.shelly1pmminig3_54320451c290_input_0" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "run_id": "953af172f18b834e914acd7ad44779f7", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T11:56:01.329152+00:00", "finish": "2026-01-14T11:56:01.977420+00:00" }, "domain": "automation", "item_id": "1759752615892", "trigger": "state of binary_sensor.shelly1pmminig3_54320451c290_input_0", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T11:56:01.329205+00:00", "changed_variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_tafel", "primary_input_var": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "secondary_input_var": "input_boolean.dummy", "tertiary_input_var": "input_boolean.dummy", "confirm_switch_var": "switch.lamp_tafel_main_confirm", "this": { "entity_id": "automation.schakelaar_tafel", "state": "on", "attributes": { "id": "1759752615892", "last_triggered": "2026-01-14T09:01:21.854290+00:00", "mode": "single", "current": 0, "friendly_name": "Schakelaar tafel [BP]" }, "last_changed": "2026-01-13T12:10:27.679746+00:00", "last_reported": "2026-01-14T09:01:22.140481+00:00", "last_updated": "2026-01-14T09:01:22.140481+00:00", "context": { "id": "01KEXVSXHYBFTKPZEBRXQKVWB3", "parent_id": "01KEXVSXHX7V37QCXKF5AH9WRT", "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "from_state": { "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "state": "off", "attributes": { "device_class": "power", "friendly_name": "Schakelaar eettafel" }, "last_changed": "2026-01-14T09:01:21.853529+00:00", "last_reported": "2026-01-14T09:01:21.853529+00:00", "last_updated": "2026-01-14T09:01:21.853529+00:00", "context": { "id": "01KEXVSXHX7V37QCXKF5AH9WRT", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "state": "on", "attributes": { "device_class": "power", "friendly_name": "Schakelaar eettafel" }, "last_changed": "2026-01-14T11:56:01.328634+00:00", "last_reported": "2026-01-14T11:56:01.328634+00:00", "last_updated": "2026-01-14T11:56:01.328634+00:00", "context": { "id": "01KEY5SQDG0Z72EVB7CB9Q4GT5", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.shelly1pmminig3_54320451c290_input_0" } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T11:56:01.329226+00:00", "result": { "result": true, "entities": [] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T11:56:01.329517+00:00", "changed_variables": { "context": { "id": "01KEY5SQDHCZN4NEQN9JAZEKHY", "parent_id": "01KEY5SQDG0Z72EVB7CB9Q4GT5", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T11:56:01.329577+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T11:56:01.329616+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-14T11:56:01.329773+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-14T11:56:01.329810+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-14T11:56:01.329841+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-14T11:56:01.329968+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-14T11:56:01.330002+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-14T11:56:01.330034+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-14T11:56:01.330148+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": {}, "target": { "entity_id": [ "light.lamp_tafel" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1", "timestamp": "2026-01-14T11:56:01.530152+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0", "timestamp": "2026-01-14T11:56:01.530241+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0", "timestamp": "2026-01-14T11:56:01.530305+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "timestamp": "2026-01-14T11:56:01.530581+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.lamp_tafel_main_confirm" ] } }, "running_script": false } } ] }, "config": { "variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_tafel", "primary_input_var": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "secondary_input_var": "input_boolean.dummy", "tertiary_input_var": "input_boolean.dummy", "confirm_switch_var": "switch.lamp_tafel_main_confirm" }, "mode": "single", "triggers": [ { "trigger": "state", "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "on", "to": "off" } ], "actions": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'lamp' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n (switch_type_selected == 'toggle' or\n (switch_type_selected == 'momentary' and trigger.to_state.state == 'on')) }}\n" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ lamp_entity_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ lamp_entity_var }}" }, "action": "light.toggle" } ] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'custom' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'on' and\n (switch_type_selected == 'toggle' or switch_type_selected == 'momentary') }}\n" } ], "sequence": [] }, { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'off' and\n switch_type_selected == 'toggle' }}\n" } ], "sequence": [] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ], "conditions": [ { "condition": "template", "value_template": "{{ trigger.from_state.state in ['on', 'off'] and\n trigger.to_state.state in ['on', 'off'] }}\n" } ], "id": "1759752615892", "alias": "schakelaar tafel", "description": "" }, "blueprint_inputs": { "id": "1759752615892", "alias": "schakelaar tafel", "description": "", "use_blueprint": { "path": "willumpie82/shelly-detached-input3.yaml", "input": { "primary_input": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "lamp_entity": "light.lamp_tafel", "confirm_switch": "switch.lamp_tafel_main_confirm" } } }, "context": { "id": "01KEY5SQDHCZN4NEQN9JAZEKHY", "parent_id": "01KEY5SQDG0Z72EVB7CB9Q4GT5", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "run_id": "953af172f18b834e914acd7ad44779f7", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T11:56:01.329152+00:00", "finish": "2026-01-14T11:56:01.977420+00:00" }, "domain": "automation", "item_id": "1759752615892", "trigger": "state of binary_sensor.shelly1pmminig3_54320451c290_input_0" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "run_id": "e5196bd09a6a1e6dd2e964ae8069bee8", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T11:56:02.946733+00:00", "finish": "2026-01-14T11:56:03.510382+00:00" }, "domain": "automation", "item_id": "1759752615892", "trigger": "state of binary_sensor.shelly1pmminig3_54320451c290_input_0", "trace": { "trigger/1": [ { "path": "trigger/1", "timestamp": "2026-01-14T11:56:02.946774+00:00", "changed_variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_tafel", "primary_input_var": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "secondary_input_var": "input_boolean.dummy", "tertiary_input_var": "input_boolean.dummy", "confirm_switch_var": "switch.lamp_tafel_main_confirm", "this": { "entity_id": "automation.schakelaar_tafel", "state": "on", "attributes": { "id": "1759752615892", "last_triggered": "2026-01-14T11:56:01.329370+00:00", "mode": "single", "current": 0, "friendly_name": "Schakelaar tafel [BP]" }, "last_changed": "2026-01-13T12:10:27.679746+00:00", "last_reported": "2026-01-14T11:56:01.972916+00:00", "last_updated": "2026-01-14T11:56:01.972916+00:00", "context": { "id": "01KEY5SQDHCZN4NEQN9JAZEKHY", "parent_id": "01KEY5SQDG0Z72EVB7CB9Q4GT5", "user_id": null } }, "trigger": { "id": "1", "idx": "1", "alias": null, "platform": "state", "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "from_state": { "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "state": "on", "attributes": { "device_class": "power", "friendly_name": "Schakelaar eettafel" }, "last_changed": "2026-01-14T11:56:01.328634+00:00", "last_reported": "2026-01-14T11:56:01.328634+00:00", "last_updated": "2026-01-14T11:56:01.328634+00:00", "context": { "id": "01KEY5SQDG0Z72EVB7CB9Q4GT5", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "state": "off", "attributes": { "device_class": "power", "friendly_name": "Schakelaar eettafel" }, "last_changed": "2026-01-14T11:56:02.946044+00:00", "last_reported": "2026-01-14T11:56:02.946044+00:00", "last_updated": "2026-01-14T11:56:02.946044+00:00", "context": { "id": "01KEY5SS02HSSKPYSAJYAG1DQN", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.shelly1pmminig3_54320451c290_input_0" } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T11:56:02.946801+00:00", "result": { "result": true, "entities": [] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T11:56:02.947138+00:00", "changed_variables": { "context": { "id": "01KEY5SS02DWH4ZT7GDFENMXNV", "parent_id": "01KEY5SS02HSSKPYSAJYAG1DQN", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T11:56:02.947219+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T11:56:02.947272+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-14T11:56:02.947477+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-14T11:56:02.947538+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-14T11:56:02.947583+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-14T11:56:02.947750+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-14T11:56:02.947795+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-14T11:56:02.947839+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-14T11:56:02.947994+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": {}, "target": { "entity_id": [ "light.lamp_tafel" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1", "timestamp": "2026-01-14T11:56:03.160689+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0", "timestamp": "2026-01-14T11:56:03.160749+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0", "timestamp": "2026-01-14T11:56:03.160783+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "timestamp": "2026-01-14T11:56:03.160960+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.lamp_tafel_main_confirm" ] } }, "running_script": false } } ] }, "config": { "variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_tafel", "primary_input_var": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "secondary_input_var": "input_boolean.dummy", "tertiary_input_var": "input_boolean.dummy", "confirm_switch_var": "switch.lamp_tafel_main_confirm" }, "mode": "single", "triggers": [ { "trigger": "state", "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "on", "to": "off" } ], "actions": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'lamp' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n (switch_type_selected == 'toggle' or\n (switch_type_selected == 'momentary' and trigger.to_state.state == 'on')) }}\n" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ lamp_entity_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ lamp_entity_var }}" }, "action": "light.toggle" } ] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'custom' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'on' and\n (switch_type_selected == 'toggle' or switch_type_selected == 'momentary') }}\n" } ], "sequence": [] }, { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'off' and\n switch_type_selected == 'toggle' }}\n" } ], "sequence": [] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ], "conditions": [ { "condition": "template", "value_template": "{{ trigger.from_state.state in ['on', 'off'] and\n trigger.to_state.state in ['on', 'off'] }}\n" } ], "id": "1759752615892", "alias": "schakelaar tafel", "description": "" }, "blueprint_inputs": { "id": "1759752615892", "alias": "schakelaar tafel", "description": "", "use_blueprint": { "path": "willumpie82/shelly-detached-input3.yaml", "input": { "primary_input": "binary_sensor.shelly1pmminig3_54320451c290_input_0", "lamp_entity": "light.lamp_tafel", "confirm_switch": "switch.lamp_tafel_main_confirm" } } }, "context": { "id": "01KEY5SS02DWH4ZT7GDFENMXNV", "parent_id": "01KEY5SS02HSSKPYSAJYAG1DQN", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "run_id": "e5196bd09a6a1e6dd2e964ae8069bee8", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T11:56:02.946733+00:00", "finish": "2026-01-14T11:56:03.510382+00:00" }, "domain": "automation", "item_id": "1759752615892", "trigger": "state of binary_sensor.shelly1pmminig3_54320451c290_input_0" } } ], "automation.1759412912012": [ { "extended_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "run_id": "c23ed2ab134523ba5a7c870ea29f9d64", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T15:17:49.289057+00:00", "finish": "2026-01-13T15:17:49.452406+00:00" }, "domain": "automation", "item_id": "1759412912012", "trigger": "state of binary_sensor.slaapkamer_deur_input_0", "trace": { "trigger/1": [ { "path": "trigger/1", "timestamp": "2026-01-13T15:17:49.289088+00:00", "changed_variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_slaapkamer_2", "primary_input_var": "binary_sensor.slaapkamer_deur_input_0", "secondary_input_var": "binary_sensor.schakelaar_bed_rechts_1", "tertiary_input_var": "binary_sensor.schakelaar_bed_links_0", "confirm_switch_var": "switch.schakelaars_slaapkamer_deur_confirm", "this": { "entity_id": "automation.schakelaar_slaapkamer_bp", "state": "on", "attributes": { "id": "1759412912012", "last_triggered": "2026-01-13T15:14:15.426018+00:00", "mode": "single", "current": 0, "friendly_name": "Schakelaar slaapkamer [BP]" }, "last_changed": "2026-01-13T12:10:27.679588+00:00", "last_reported": "2026-01-13T15:14:15.542047+00:00", "last_updated": "2026-01-13T15:14:15.542047+00:00", "context": { "id": "01KEVYQZR1VD9ETVWFJKE88RGP", "parent_id": "01KEVYQZR11SYB47BPVMD29XQ1", "user_id": null } }, "trigger": { "id": "1", "idx": "1", "alias": null, "platform": "state", "entity_id": "binary_sensor.slaapkamer_deur_input_0", "from_state": { "entity_id": "binary_sensor.slaapkamer_deur_input_0", "state": "on", "attributes": { "device_class": "power", "icon": "mdi:toggle-switch-variant-off", "friendly_name": "Slaapkamer deur input 0" }, "last_changed": "2026-01-13T15:14:15.425144+00:00", "last_reported": "2026-01-13T15:14:15.425144+00:00", "last_updated": "2026-01-13T15:14:15.425144+00:00", "context": { "id": "01KEVYQZR11SYB47BPVMD29XQ1", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.slaapkamer_deur_input_0", "state": "off", "attributes": { "device_class": "power", "icon": "mdi:toggle-switch-variant-off", "friendly_name": "Slaapkamer deur input 0" }, "last_changed": "2026-01-13T15:17:49.288452+00:00", "last_reported": "2026-01-13T15:17:49.288452+00:00", "last_updated": "2026-01-13T15:17:49.288452+00:00", "context": { "id": "01KEVYYGK8ZZA5A2DNDN9ZNM8Z", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.slaapkamer_deur_input_0" } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-13T15:17:49.289108+00:00", "result": { "result": true, "entities": [] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-13T15:17:49.289489+00:00", "changed_variables": { "context": { "id": "01KEVYYGK9QF7H32X3Q9GSW54X", "parent_id": "01KEVYYGK8ZZA5A2DNDN9ZNM8Z", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-13T15:17:49.289542+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-13T15:17:49.289579+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-13T15:17:49.289714+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-13T15:17:49.289747+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-13T15:17:49.289777+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-13T15:17:49.289894+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-13T15:17:49.289925+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-13T15:17:49.289955+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-13T15:17:49.290064+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": {}, "target": { "entity_id": [ "light.lamp_slaapkamer_2" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1", "timestamp": "2026-01-13T15:17:49.417825+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0", "timestamp": "2026-01-13T15:17:49.417892+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0", "timestamp": "2026-01-13T15:17:49.417929+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "timestamp": "2026-01-13T15:17:49.418094+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.schakelaars_slaapkamer_deur_confirm" ] } }, "running_script": false } } ] }, "config": { "variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_slaapkamer_2", "primary_input_var": "binary_sensor.slaapkamer_deur_input_0", "secondary_input_var": "binary_sensor.schakelaar_bed_rechts_1", "tertiary_input_var": "binary_sensor.schakelaar_bed_links_0", "confirm_switch_var": "switch.schakelaars_slaapkamer_deur_confirm" }, "mode": "single", "triggers": [ { "trigger": "state", "entity_id": "binary_sensor.slaapkamer_deur_input_0", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.slaapkamer_deur_input_0", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_rechts_1", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_rechts_1", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_links_0", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_links_0", "from": "on", "to": "off" } ], "actions": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'lamp' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n (switch_type_selected == 'toggle' or\n (switch_type_selected == 'momentary' and trigger.to_state.state == 'on')) }}\n" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ lamp_entity_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ lamp_entity_var }}" }, "action": "light.toggle" } ] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'custom' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'on' and\n (switch_type_selected == 'toggle' or switch_type_selected == 'momentary') }}\n" } ], "sequence": [] }, { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'off' and\n switch_type_selected == 'toggle' }}\n" } ], "sequence": [] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ], "conditions": [ { "condition": "template", "value_template": "{{ trigger.from_state.state in ['on', 'off'] and\n trigger.to_state.state in ['on', 'off'] }}\n" } ], "id": "1759412912012", "alias": "Schakelaar slaapkamer [BP]", "description": "" }, "blueprint_inputs": { "id": "1759412912012", "alias": "Schakelaar slaapkamer [BP]", "description": "", "use_blueprint": { "path": "willumpie82/shelly-detached-input3.yaml", "input": { "primary_input": "binary_sensor.slaapkamer_deur_input_0", "secondary_input": "binary_sensor.schakelaar_bed_rechts_1", "lamp_entity": "light.lamp_slaapkamer_2", "confirm_switch": "switch.schakelaars_slaapkamer_deur_confirm", "tertiary_input": "binary_sensor.schakelaar_bed_links_0" } } }, "context": { "id": "01KEVYYGK9QF7H32X3Q9GSW54X", "parent_id": "01KEVYYGK8ZZA5A2DNDN9ZNM8Z", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "run_id": "c23ed2ab134523ba5a7c870ea29f9d64", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T15:17:49.289057+00:00", "finish": "2026-01-13T15:17:49.452406+00:00" }, "domain": "automation", "item_id": "1759412912012", "trigger": "state of binary_sensor.slaapkamer_deur_input_0" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "run_id": "d677876a2365d46daf86e84b83a20356", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T15:43:29.497637+00:00", "finish": "2026-01-13T15:43:29.662947+00:00" }, "domain": "automation", "item_id": "1759412912012", "trigger": "state of binary_sensor.slaapkamer_deur_input_0", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-13T15:43:29.497694+00:00", "changed_variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_slaapkamer_2", "primary_input_var": "binary_sensor.slaapkamer_deur_input_0", "secondary_input_var": "binary_sensor.schakelaar_bed_rechts_1", "tertiary_input_var": "binary_sensor.schakelaar_bed_links_0", "confirm_switch_var": "switch.schakelaars_slaapkamer_deur_confirm", "this": { "entity_id": "automation.schakelaar_slaapkamer_bp", "state": "on", "attributes": { "id": "1759412912012", "last_triggered": "2026-01-13T15:17:49.289355+00:00", "mode": "single", "current": 0, "friendly_name": "Schakelaar slaapkamer [BP]" }, "last_changed": "2026-01-13T12:10:27.679588+00:00", "last_reported": "2026-01-13T15:17:49.451849+00:00", "last_updated": "2026-01-13T15:17:49.451849+00:00", "context": { "id": "01KEVYYGK9QF7H32X3Q9GSW54X", "parent_id": "01KEVYYGK8ZZA5A2DNDN9ZNM8Z", "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.slaapkamer_deur_input_0", "from_state": { "entity_id": "binary_sensor.slaapkamer_deur_input_0", "state": "off", "attributes": { "device_class": "power", "icon": "mdi:toggle-switch-variant-off", "friendly_name": "Slaapkamer deur input 0" }, "last_changed": "2026-01-13T15:17:49.288452+00:00", "last_reported": "2026-01-13T15:17:49.288452+00:00", "last_updated": "2026-01-13T15:17:49.288452+00:00", "context": { "id": "01KEVYYGK8ZZA5A2DNDN9ZNM8Z", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.slaapkamer_deur_input_0", "state": "on", "attributes": { "device_class": "power", "icon": "mdi:toggle-switch-variant-off", "friendly_name": "Slaapkamer deur input 0" }, "last_changed": "2026-01-13T15:43:29.496937+00:00", "last_reported": "2026-01-13T15:43:29.496937+00:00", "last_updated": "2026-01-13T15:43:29.496937+00:00", "context": { "id": "01KEW0DGPRM99J4YVVS6G2RSSW", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.slaapkamer_deur_input_0" } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-13T15:43:29.497729+00:00", "result": { "result": true, "entities": [] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-13T15:43:29.498005+00:00", "changed_variables": { "context": { "id": "01KEW0DGPS98DDJ92XKX51F4VR", "parent_id": "01KEW0DGPRM99J4YVVS6G2RSSW", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-13T15:43:29.498056+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-13T15:43:29.498094+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-13T15:43:29.498229+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-13T15:43:29.498264+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-13T15:43:29.498295+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-13T15:43:29.498413+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-13T15:43:29.498445+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-13T15:43:29.498474+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-13T15:43:29.498585+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": {}, "target": { "entity_id": [ "light.lamp_slaapkamer_2" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1", "timestamp": "2026-01-13T15:43:29.624156+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0", "timestamp": "2026-01-13T15:43:29.624241+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0", "timestamp": "2026-01-13T15:43:29.624291+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "timestamp": "2026-01-13T15:43:29.624457+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.schakelaars_slaapkamer_deur_confirm" ] } }, "running_script": false } } ] }, "config": { "variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_slaapkamer_2", "primary_input_var": "binary_sensor.slaapkamer_deur_input_0", "secondary_input_var": "binary_sensor.schakelaar_bed_rechts_1", "tertiary_input_var": "binary_sensor.schakelaar_bed_links_0", "confirm_switch_var": "switch.schakelaars_slaapkamer_deur_confirm" }, "mode": "single", "triggers": [ { "trigger": "state", "entity_id": "binary_sensor.slaapkamer_deur_input_0", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.slaapkamer_deur_input_0", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_rechts_1", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_rechts_1", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_links_0", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_links_0", "from": "on", "to": "off" } ], "actions": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'lamp' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n (switch_type_selected == 'toggle' or\n (switch_type_selected == 'momentary' and trigger.to_state.state == 'on')) }}\n" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ lamp_entity_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ lamp_entity_var }}" }, "action": "light.toggle" } ] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'custom' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'on' and\n (switch_type_selected == 'toggle' or switch_type_selected == 'momentary') }}\n" } ], "sequence": [] }, { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'off' and\n switch_type_selected == 'toggle' }}\n" } ], "sequence": [] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ], "conditions": [ { "condition": "template", "value_template": "{{ trigger.from_state.state in ['on', 'off'] and\n trigger.to_state.state in ['on', 'off'] }}\n" } ], "id": "1759412912012", "alias": "Schakelaar slaapkamer [BP]", "description": "" }, "blueprint_inputs": { "id": "1759412912012", "alias": "Schakelaar slaapkamer [BP]", "description": "", "use_blueprint": { "path": "willumpie82/shelly-detached-input3.yaml", "input": { "primary_input": "binary_sensor.slaapkamer_deur_input_0", "secondary_input": "binary_sensor.schakelaar_bed_rechts_1", "lamp_entity": "light.lamp_slaapkamer_2", "confirm_switch": "switch.schakelaars_slaapkamer_deur_confirm", "tertiary_input": "binary_sensor.schakelaar_bed_links_0" } } }, "context": { "id": "01KEW0DGPS98DDJ92XKX51F4VR", "parent_id": "01KEW0DGPRM99J4YVVS6G2RSSW", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "run_id": "d677876a2365d46daf86e84b83a20356", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T15:43:29.497637+00:00", "finish": "2026-01-13T15:43:29.662947+00:00" }, "domain": "automation", "item_id": "1759412912012", "trigger": "state of binary_sensor.slaapkamer_deur_input_0" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "run_id": "4dea8884b111ece2cc10f87da4a4e22f", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T23:15:51.907204+00:00", "finish": "2026-01-13T23:15:52.078124+00:00" }, "domain": "automation", "item_id": "1759412912012", "trigger": "state of binary_sensor.slaapkamer_deur_input_0", "trace": { "trigger/1": [ { "path": "trigger/1", "timestamp": "2026-01-13T23:15:51.907235+00:00", "changed_variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_slaapkamer_2", "primary_input_var": "binary_sensor.slaapkamer_deur_input_0", "secondary_input_var": "binary_sensor.schakelaar_bed_rechts_1", "tertiary_input_var": "binary_sensor.schakelaar_bed_links_0", "confirm_switch_var": "switch.schakelaars_slaapkamer_deur_confirm", "this": { "entity_id": "automation.schakelaar_slaapkamer_bp", "state": "on", "attributes": { "id": "1759412912012", "last_triggered": "2026-01-13T15:43:29.497868+00:00", "mode": "single", "current": 0, "friendly_name": "Schakelaar slaapkamer [BP]" }, "last_changed": "2026-01-13T12:10:27.679588+00:00", "last_reported": "2026-01-13T15:43:29.662410+00:00", "last_updated": "2026-01-13T15:43:29.662410+00:00", "context": { "id": "01KEW0DGPS98DDJ92XKX51F4VR", "parent_id": "01KEW0DGPRM99J4YVVS6G2RSSW", "user_id": null } }, "trigger": { "id": "1", "idx": "1", "alias": null, "platform": "state", "entity_id": "binary_sensor.slaapkamer_deur_input_0", "from_state": { "entity_id": "binary_sensor.slaapkamer_deur_input_0", "state": "on", "attributes": { "device_class": "power", "icon": "mdi:toggle-switch-variant-off", "friendly_name": "Slaapkamer deur input 0" }, "last_changed": "2026-01-13T15:43:29.496937+00:00", "last_reported": "2026-01-13T15:43:29.496937+00:00", "last_updated": "2026-01-13T15:43:29.496937+00:00", "context": { "id": "01KEW0DGPRM99J4YVVS6G2RSSW", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.slaapkamer_deur_input_0", "state": "off", "attributes": { "device_class": "power", "icon": "mdi:toggle-switch-variant-off", "friendly_name": "Slaapkamer deur input 0" }, "last_changed": "2026-01-13T23:15:51.906449+00:00", "last_reported": "2026-01-13T23:15:51.906449+00:00", "last_updated": "2026-01-13T23:15:51.906449+00:00", "context": { "id": "01KEWT9TZ2GAG9V4QCD22J1JT8", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.slaapkamer_deur_input_0" } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-13T23:15:51.907255+00:00", "result": { "result": true, "entities": [] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-13T23:15:51.907534+00:00", "changed_variables": { "context": { "id": "01KEWT9TZ34H467B93JGCMTRMQ", "parent_id": "01KEWT9TZ2GAG9V4QCD22J1JT8", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-13T23:15:51.907587+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-13T23:15:51.907623+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-13T23:15:51.907748+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-13T23:15:51.907782+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-13T23:15:51.907810+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-13T23:15:51.907942+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-13T23:15:51.907973+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-13T23:15:51.908000+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-13T23:15:51.908105+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": {}, "target": { "entity_id": [ "light.lamp_slaapkamer_2" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1", "timestamp": "2026-01-13T23:15:52.031881+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0", "timestamp": "2026-01-13T23:15:52.031949+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0", "timestamp": "2026-01-13T23:15:52.031985+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "timestamp": "2026-01-13T23:15:52.032174+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.schakelaars_slaapkamer_deur_confirm" ] } }, "running_script": false } } ] }, "config": { "variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_slaapkamer_2", "primary_input_var": "binary_sensor.slaapkamer_deur_input_0", "secondary_input_var": "binary_sensor.schakelaar_bed_rechts_1", "tertiary_input_var": "binary_sensor.schakelaar_bed_links_0", "confirm_switch_var": "switch.schakelaars_slaapkamer_deur_confirm" }, "mode": "single", "triggers": [ { "trigger": "state", "entity_id": "binary_sensor.slaapkamer_deur_input_0", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.slaapkamer_deur_input_0", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_rechts_1", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_rechts_1", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_links_0", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_links_0", "from": "on", "to": "off" } ], "actions": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'lamp' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n (switch_type_selected == 'toggle' or\n (switch_type_selected == 'momentary' and trigger.to_state.state == 'on')) }}\n" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ lamp_entity_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ lamp_entity_var }}" }, "action": "light.toggle" } ] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'custom' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'on' and\n (switch_type_selected == 'toggle' or switch_type_selected == 'momentary') }}\n" } ], "sequence": [] }, { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'off' and\n switch_type_selected == 'toggle' }}\n" } ], "sequence": [] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ], "conditions": [ { "condition": "template", "value_template": "{{ trigger.from_state.state in ['on', 'off'] and\n trigger.to_state.state in ['on', 'off'] }}\n" } ], "id": "1759412912012", "alias": "Schakelaar slaapkamer [BP]", "description": "" }, "blueprint_inputs": { "id": "1759412912012", "alias": "Schakelaar slaapkamer [BP]", "description": "", "use_blueprint": { "path": "willumpie82/shelly-detached-input3.yaml", "input": { "primary_input": "binary_sensor.slaapkamer_deur_input_0", "secondary_input": "binary_sensor.schakelaar_bed_rechts_1", "lamp_entity": "light.lamp_slaapkamer_2", "confirm_switch": "switch.schakelaars_slaapkamer_deur_confirm", "tertiary_input": "binary_sensor.schakelaar_bed_links_0" } } }, "context": { "id": "01KEWT9TZ34H467B93JGCMTRMQ", "parent_id": "01KEWT9TZ2GAG9V4QCD22J1JT8", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "run_id": "4dea8884b111ece2cc10f87da4a4e22f", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T23:15:51.907204+00:00", "finish": "2026-01-13T23:15:52.078124+00:00" }, "domain": "automation", "item_id": "1759412912012", "trigger": "state of binary_sensor.slaapkamer_deur_input_0" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "run_id": "acff8f3396189b6a24e38774246f2100", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T06:54:12.225239+00:00", "finish": "2026-01-14T06:54:12.567596+00:00" }, "domain": "automation", "item_id": "1759412912012", "trigger": "state of binary_sensor.schakelaar_bed_links_0", "trace": { "trigger/5": [ { "path": "trigger/5", "timestamp": "2026-01-14T06:54:12.225279+00:00", "changed_variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_slaapkamer_2", "primary_input_var": "binary_sensor.slaapkamer_deur_input_0", "secondary_input_var": "binary_sensor.schakelaar_bed_rechts_1", "tertiary_input_var": "binary_sensor.schakelaar_bed_links_0", "confirm_switch_var": "switch.schakelaars_slaapkamer_deur_confirm", "this": { "entity_id": "automation.schakelaar_slaapkamer_bp", "state": "on", "attributes": { "id": "1759412912012", "last_triggered": "2026-01-13T23:15:51.907398+00:00", "mode": "single", "current": 0, "friendly_name": "Schakelaar slaapkamer [BP]" }, "last_changed": "2026-01-13T12:10:27.679588+00:00", "last_reported": "2026-01-13T23:15:52.077558+00:00", "last_updated": "2026-01-13T23:15:52.077558+00:00", "context": { "id": "01KEWT9TZ34H467B93JGCMTRMQ", "parent_id": "01KEWT9TZ2GAG9V4QCD22J1JT8", "user_id": null } }, "trigger": { "id": "5", "idx": "5", "alias": null, "platform": "state", "entity_id": "binary_sensor.schakelaar_bed_links_0", "from_state": { "entity_id": "binary_sensor.schakelaar_bed_links_0", "state": "on", "attributes": { "device_class": "power", "friendly_name": "schakelaar bed links 0" }, "last_changed": "2026-01-13T12:09:35.851481+00:00", "last_reported": "2026-01-13T12:11:00.111140+00:00", "last_updated": "2026-01-13T12:09:35.851481+00:00", "context": { "id": "01KEVM5VVBVKRS1G9BQAAF4JE2", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.schakelaar_bed_links_0", "state": "off", "attributes": { "device_class": "power", "friendly_name": "schakelaar bed links 0" }, "last_changed": "2026-01-14T06:54:12.223496+00:00", "last_reported": "2026-01-14T06:54:12.223496+00:00", "last_updated": "2026-01-14T06:54:12.223496+00:00", "context": { "id": "01KEXMH2QZP5MX055J7N6EKGC3", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.schakelaar_bed_links_0" } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T06:54:12.225302+00:00", "result": { "result": true, "entities": [] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T06:54:12.228702+00:00", "changed_variables": { "context": { "id": "01KEXMH2R1QGCGX6XFX6KE3608", "parent_id": "01KEXMH2QZP5MX055J7N6EKGC3", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T06:54:12.228828+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T06:54:12.228905+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-14T06:54:12.229879+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-14T06:54:12.229936+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-14T06:54:12.229988+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-14T06:54:12.230244+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-14T06:54:12.230303+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-14T06:54:12.230371+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-14T06:54:12.230577+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": {}, "target": { "entity_id": [ "light.lamp_slaapkamer_2" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1", "timestamp": "2026-01-14T06:54:12.418158+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0", "timestamp": "2026-01-14T06:54:12.418219+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0", "timestamp": "2026-01-14T06:54:12.418254+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "timestamp": "2026-01-14T06:54:12.418431+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.schakelaars_slaapkamer_deur_confirm" ] } }, "running_script": false } } ] }, "config": { "variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_slaapkamer_2", "primary_input_var": "binary_sensor.slaapkamer_deur_input_0", "secondary_input_var": "binary_sensor.schakelaar_bed_rechts_1", "tertiary_input_var": "binary_sensor.schakelaar_bed_links_0", "confirm_switch_var": "switch.schakelaars_slaapkamer_deur_confirm" }, "mode": "single", "triggers": [ { "trigger": "state", "entity_id": "binary_sensor.slaapkamer_deur_input_0", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.slaapkamer_deur_input_0", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_rechts_1", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_rechts_1", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_links_0", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_links_0", "from": "on", "to": "off" } ], "actions": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'lamp' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n (switch_type_selected == 'toggle' or\n (switch_type_selected == 'momentary' and trigger.to_state.state == 'on')) }}\n" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ lamp_entity_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ lamp_entity_var }}" }, "action": "light.toggle" } ] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'custom' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'on' and\n (switch_type_selected == 'toggle' or switch_type_selected == 'momentary') }}\n" } ], "sequence": [] }, { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'off' and\n switch_type_selected == 'toggle' }}\n" } ], "sequence": [] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ], "conditions": [ { "condition": "template", "value_template": "{{ trigger.from_state.state in ['on', 'off'] and\n trigger.to_state.state in ['on', 'off'] }}\n" } ], "id": "1759412912012", "alias": "Schakelaar slaapkamer [BP]", "description": "" }, "blueprint_inputs": { "id": "1759412912012", "alias": "Schakelaar slaapkamer [BP]", "description": "", "use_blueprint": { "path": "willumpie82/shelly-detached-input3.yaml", "input": { "primary_input": "binary_sensor.slaapkamer_deur_input_0", "secondary_input": "binary_sensor.schakelaar_bed_rechts_1", "lamp_entity": "light.lamp_slaapkamer_2", "confirm_switch": "switch.schakelaars_slaapkamer_deur_confirm", "tertiary_input": "binary_sensor.schakelaar_bed_links_0" } } }, "context": { "id": "01KEXMH2R1QGCGX6XFX6KE3608", "parent_id": "01KEXMH2QZP5MX055J7N6EKGC3", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "run_id": "acff8f3396189b6a24e38774246f2100", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T06:54:12.225239+00:00", "finish": "2026-01-14T06:54:12.567596+00:00" }, "domain": "automation", "item_id": "1759412912012", "trigger": "state of binary_sensor.schakelaar_bed_links_0" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "run_id": "3552f95624ba433711b3c5dd23b2229a", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T15:59:14.035028+00:00", "finish": "2026-01-14T15:59:14.408180+00:00" }, "domain": "automation", "item_id": "1759412912012", "trigger": "state of binary_sensor.slaapkamer_deur_input_0", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T15:59:14.035093+00:00", "changed_variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_slaapkamer_2", "primary_input_var": "binary_sensor.slaapkamer_deur_input_0", "secondary_input_var": "binary_sensor.schakelaar_bed_rechts_1", "tertiary_input_var": "binary_sensor.schakelaar_bed_links_0", "confirm_switch_var": "switch.schakelaars_slaapkamer_deur_confirm", "this": { "entity_id": "automation.schakelaar_slaapkamer_bp", "state": "on", "attributes": { "id": "1759412912012", "last_triggered": "2026-01-14T06:54:12.225501+00:00", "mode": "single", "current": 0, "friendly_name": "Schakelaar slaapkamer [BP]" }, "last_changed": "2026-01-14T15:48:56.987399+00:00", "last_reported": "2026-01-14T15:48:56.987399+00:00", "last_updated": "2026-01-14T15:48:56.987399+00:00", "context": { "id": "01KEYK47GV3B08RRAD3D6RV354", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.slaapkamer_deur_input_0", "from_state": { "entity_id": "binary_sensor.slaapkamer_deur_input_0", "state": "off", "attributes": { "device_class": "power", "icon": "mdi:toggle-switch-variant-off", "friendly_name": "Slaapkamer deur input 0" }, "last_changed": "2026-01-14T15:48:39.631437+00:00", "last_reported": "2026-01-14T15:48:39.631437+00:00", "last_updated": "2026-01-14T15:48:39.631437+00:00", "context": { "id": "01KEYK3PJF36N7ZA7MRWBM1KX8", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.slaapkamer_deur_input_0", "state": "on", "attributes": { "device_class": "power", "icon": "mdi:toggle-switch-variant-off", "friendly_name": "Slaapkamer deur input 0" }, "last_changed": "2026-01-14T15:59:14.034388+00:00", "last_reported": "2026-01-14T15:59:14.034388+00:00", "last_updated": "2026-01-14T15:59:14.034388+00:00", "context": { "id": "01KEYKQ23JB4JJQCHHHEGB90BA", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.slaapkamer_deur_input_0" } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T15:59:14.035110+00:00", "result": { "result": true, "entities": [] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T15:59:14.035741+00:00", "changed_variables": { "context": { "id": "01KEYKQ23KTH0E9YYY5MQ2XYW2", "parent_id": "01KEYKQ23JB4JJQCHHHEGB90BA", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T15:59:14.035847+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T15:59:14.035886+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-14T15:59:14.036036+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-14T15:59:14.036095+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-14T15:59:14.036126+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-14T15:59:14.036281+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-14T15:59:14.036340+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-14T15:59:14.036370+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-14T15:59:14.036499+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": {}, "target": { "entity_id": [ "light.lamp_slaapkamer_2" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1", "timestamp": "2026-01-14T15:59:14.329369+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0", "timestamp": "2026-01-14T15:59:14.329484+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0", "timestamp": "2026-01-14T15:59:14.329556+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "timestamp": "2026-01-14T15:59:14.329759+00:00", "result": { "params": { "domain": "switch", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "switch.schakelaars_slaapkamer_deur_confirm" ] } }, "running_script": false } } ] }, "config": { "variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_slaapkamer_2", "primary_input_var": "binary_sensor.slaapkamer_deur_input_0", "secondary_input_var": "binary_sensor.schakelaar_bed_rechts_1", "tertiary_input_var": "binary_sensor.schakelaar_bed_links_0", "confirm_switch_var": "switch.schakelaars_slaapkamer_deur_confirm" }, "mode": "single", "triggers": [ { "trigger": "state", "entity_id": "binary_sensor.slaapkamer_deur_input_0", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.slaapkamer_deur_input_0", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_rechts_1", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_rechts_1", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_links_0", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_links_0", "from": "on", "to": "off" } ], "actions": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'lamp' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n (switch_type_selected == 'toggle' or\n (switch_type_selected == 'momentary' and trigger.to_state.state == 'on')) }}\n" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ lamp_entity_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ lamp_entity_var }}" }, "action": "light.toggle" } ] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'custom' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'on' and\n (switch_type_selected == 'toggle' or switch_type_selected == 'momentary') }}\n" } ], "sequence": [] }, { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id in [primary_input_var, secondary_input_var, tertiary_input_var] and\n trigger.to_state.state == 'off' and\n switch_type_selected == 'toggle' }}\n" } ], "sequence": [] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ], "conditions": [ { "condition": "template", "value_template": "{{ trigger.from_state.state in ['on', 'off'] and\n trigger.to_state.state in ['on', 'off'] }}\n" } ], "id": "1759412912012", "alias": "Schakelaar slaapkamer [BP]", "description": "" }, "blueprint_inputs": { "id": "1759412912012", "alias": "Schakelaar slaapkamer [BP]", "description": "", "use_blueprint": { "path": "willumpie82/shelly-detached-input3.yaml", "input": { "primary_input": "binary_sensor.slaapkamer_deur_input_0", "secondary_input": "binary_sensor.schakelaar_bed_rechts_1", "lamp_entity": "light.lamp_slaapkamer_2", "confirm_switch": "switch.schakelaars_slaapkamer_deur_confirm", "tertiary_input": "binary_sensor.schakelaar_bed_links_0" } } }, "context": { "id": "01KEYKQ23KTH0E9YYY5MQ2XYW2", "parent_id": "01KEYKQ23JB4JJQCHHHEGB90BA", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/sequence/0", "run_id": "3552f95624ba433711b3c5dd23b2229a", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T15:59:14.035028+00:00", "finish": "2026-01-14T15:59:14.408180+00:00" }, "domain": "automation", "item_id": "1759412912012", "trigger": "state of binary_sensor.slaapkamer_deur_input_0" } } ], "script.new_script": [ { "extended_dict": { "last_step": "sequence/4", "run_id": "5d2f8b4f28d41be4a5a8fd1ce7d57ce6", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-13T15:54:15.624297+00:00", "finish": "2026-01-13T15:54:33.596420+00:00" }, "domain": "script", "item_id": "new_script", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-13T15:54:15.624534+00:00", "changed_variables": { "this": { "entity_id": "script.vertrekken", "state": "off", "attributes": { "last_triggered": "2026-01-12T07:49:11.197045+00:00", "mode": "single", "current": 0, "icon": "mdi:exit-run", "friendly_name": "vertrekken" }, "last_changed": "2026-01-13T12:08:44.574872+00:00", "last_reported": "2026-01-13T12:08:44.574872+00:00", "last_updated": "2026-01-13T12:08:44.574872+00:00", "context": { "id": "01KEVM49RY8PYEAN3H2K7SH5RZ", "parent_id": null, "user_id": null } }, "context": { "id": "01KEW117P8HGGRECRYYZ7K6YM7", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "result": { "params": { "domain": "light", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.lamp_tafel", "light.ikea_of_sweden_stoftmoln_ceiling_wall_lamp_ww37", "light.ikea_of_sweden_tradfri_bulb_e27_ww_clear_250lm", "light.lamp_kast", "light.zout_lamp" ] } }, "running_script": false } } ], "sequence/1": [ { "path": "sequence/1", "timestamp": "2026-01-13T15:54:16.021606+00:00", "result": { "params": { "domain": "fan", "service": "turn_off", "service_data": {}, "target": { "device_id": [ "65efdd1635426f4f499786410bc83b34" ] } }, "running_script": false } } ], "sequence/2": [ { "path": "sequence/2", "timestamp": "2026-01-13T15:54:16.040999+00:00", "child_id": { "domain": "script", "item_id": "speakers_woonkamer_standby", "run_id": "01349ff842a39cf5838cee8834ff9159" }, "result": { "params": { "domain": "script", "service": "speakers_woonkamer_standby", "service_data": {}, "target": {} }, "running_script": true } } ], "sequence/3": [ { "path": "sequence/3", "timestamp": "2026-01-13T15:54:16.205202+00:00", "child_id": { "domain": "script", "item_id": "voicebal_standby", "run_id": "970961ed8bbd2d3dc5cbf6e1b8c64676" }, "result": { "params": { "domain": "script", "service": "voicebal_standby", "service_data": {}, "target": {} }, "running_script": true } } ], "sequence/4": [ { "path": "sequence/4", "timestamp": "2026-01-13T15:54:16.217472+00:00", "child_id": { "domain": "script", "item_id": "verwarming_eco_2", "run_id": "f026bfa2657b6c2540ffb0c2570a94fe" }, "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "result": { "params": { "domain": "script", "service": "verwarming_eco_2", "service_data": {}, "target": {} }, "running_script": true } } ] }, "config": { "sequence": [ { "action": "light.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": [ "light.lamp_tafel", "light.ikea_of_sweden_stoftmoln_ceiling_wall_lamp_ww37", "light.ikea_of_sweden_tradfri_bulb_e27_ww_clear_250lm", "light.lamp_kast", "light.zout_lamp" ] } }, { "action": "fan.turn_off", "metadata": {}, "data": {}, "target": { "device_id": "65efdd1635426f4f499786410bc83b34" } }, { "action": "script.speakers_woonkamer_standby", "metadata": {}, "data": {} }, { "action": "script.voicebal_standby", "metadata": {}, "data": {} }, { "action": "script.verwarming_eco_2", "metadata": {}, "data": {} }, { "action": "script.kerst_uit", "metadata": {}, "data": {} }, { "if": [ { "condition": "time", "after": "22:00:00" } ], "then": [ { "action": "lock.lock", "metadata": {}, "data": {}, "target": { "device_id": "ead52fdd2817e1e0d5c981e717e3bf63" } } ], "alias": "check of de deur op slot moet" }, { "delay": { "hours": 0, "minutes": 0, "seconds": 3, "milliseconds": 0 } }, { "action": "script.display_off", "metadata": {}, "data": {} } ], "alias": "Vertrekken", "description": "", "icon": "mdi:exit-run" }, "blueprint_inputs": null, "context": { "id": "01KEW117P8HGGRECRYYZ7K6YM7", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "short_dict": { "last_step": "sequence/4", "run_id": "5d2f8b4f28d41be4a5a8fd1ce7d57ce6", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-13T15:54:15.624297+00:00", "finish": "2026-01-13T15:54:33.596420+00:00" }, "domain": "script", "item_id": "new_script", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0" } }, { "extended_dict": { "last_step": "sequence/4", "run_id": "967441b09a5aa5afdb8fc682f91e23ff", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-13T23:15:11.921489+00:00", "finish": "2026-01-13T23:15:14.190393+00:00" }, "domain": "script", "item_id": "new_script", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-13T23:15:11.921763+00:00", "changed_variables": { "this": { "entity_id": "script.vertrekken", "state": "off", "attributes": { "last_triggered": "2026-01-13T15:54:15.624350+00:00", "mode": "single", "current": 0, "icon": "mdi:exit-run", "friendly_name": "vertrekken" }, "last_changed": "2026-01-13T15:54:33.591085+00:00", "last_reported": "2026-01-13T15:54:33.591085+00:00", "last_updated": "2026-01-13T15:54:33.591085+00:00", "context": { "id": "01KEW11S7QS95N8GTQ5WMYRCAX", "parent_id": null, "user_id": null } }, "context": { "id": "01KEWT8KXH7QEJS52SBBHDEGBG", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "result": { "params": { "domain": "light", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.lamp_tafel", "light.ikea_of_sweden_stoftmoln_ceiling_wall_lamp_ww37", "light.ikea_of_sweden_tradfri_bulb_e27_ww_clear_250lm", "light.lamp_kast", "light.zout_lamp" ] } }, "running_script": false } } ], "sequence/1": [ { "path": "sequence/1", "timestamp": "2026-01-13T23:15:12.379461+00:00", "result": { "params": { "domain": "fan", "service": "turn_off", "service_data": {}, "target": { "device_id": [ "65efdd1635426f4f499786410bc83b34" ] } }, "running_script": false } } ], "sequence/2": [ { "path": "sequence/2", "timestamp": "2026-01-13T23:15:12.380612+00:00", "child_id": { "domain": "script", "item_id": "speakers_woonkamer_standby", "run_id": "cdbd34e610fa7bbfec624fd143c36bd1" }, "result": { "params": { "domain": "script", "service": "speakers_woonkamer_standby", "service_data": {}, "target": {} }, "running_script": true } } ], "sequence/3": [ { "path": "sequence/3", "timestamp": "2026-01-13T23:15:12.497095+00:00", "child_id": { "domain": "script", "item_id": "voicebal_standby", "run_id": "8258641d854ca01003b6a1155ab4d1a5" }, "result": { "params": { "domain": "script", "service": "voicebal_standby", "service_data": {}, "target": {} }, "running_script": true } } ], "sequence/4": [ { "path": "sequence/4", "timestamp": "2026-01-13T23:15:12.507656+00:00", "child_id": { "domain": "script", "item_id": "verwarming_eco_2", "run_id": "59a906c0e5e202dfe3d32f48f7ef6403" }, "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "result": { "params": { "domain": "script", "service": "verwarming_eco_2", "service_data": {}, "target": {} }, "running_script": true } } ] }, "config": { "sequence": [ { "action": "light.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": [ "light.lamp_tafel", "light.ikea_of_sweden_stoftmoln_ceiling_wall_lamp_ww37", "light.ikea_of_sweden_tradfri_bulb_e27_ww_clear_250lm", "light.lamp_kast", "light.zout_lamp" ] } }, { "action": "fan.turn_off", "metadata": {}, "data": {}, "target": { "device_id": "65efdd1635426f4f499786410bc83b34" } }, { "action": "script.speakers_woonkamer_standby", "metadata": {}, "data": {} }, { "action": "script.voicebal_standby", "metadata": {}, "data": {} }, { "action": "script.verwarming_eco_2", "metadata": {}, "data": {} }, { "action": "script.kerst_uit", "metadata": {}, "data": {} }, { "if": [ { "condition": "time", "after": "22:00:00" } ], "then": [ { "action": "lock.lock", "metadata": {}, "data": {}, "target": { "device_id": "ead52fdd2817e1e0d5c981e717e3bf63" } } ], "alias": "check of de deur op slot moet" }, { "delay": { "hours": 0, "minutes": 0, "seconds": 3, "milliseconds": 0 } }, { "action": "script.display_off", "metadata": {}, "data": {} } ], "alias": "Vertrekken", "description": "", "icon": "mdi:exit-run" }, "blueprint_inputs": null, "context": { "id": "01KEWT8KXH7QEJS52SBBHDEGBG", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "short_dict": { "last_step": "sequence/4", "run_id": "967441b09a5aa5afdb8fc682f91e23ff", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-13T23:15:11.921489+00:00", "finish": "2026-01-13T23:15:14.190393+00:00" }, "domain": "script", "item_id": "new_script", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0" } }, { "extended_dict": { "last_step": "sequence/4", "run_id": "578a16e496e83ed9d15c8da084962a17", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-14T16:02:21.843433+00:00", "finish": "2026-01-14T16:02:25.119287+00:00" }, "domain": "script", "item_id": "new_script", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-14T16:02:21.843785+00:00", "changed_variables": { "this": { "entity_id": "script.vertrekken", "state": "off", "attributes": { "last_triggered": "2026-01-13T23:15:11.921556+00:00", "mode": "single", "current": 0, "icon": "mdi:exit-run", "friendly_name": "vertrekken" }, "last_changed": "2026-01-14T15:48:26.119132+00:00", "last_reported": "2026-01-14T15:48:26.119132+00:00", "last_updated": "2026-01-14T15:48:26.119132+00:00", "context": { "id": "01KEYK39C722J4HEZF74P6YMGS", "parent_id": null, "user_id": null } }, "context": { "id": "01KEYKWSGK295BAV6VPSJ0KFNR", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "result": { "params": { "domain": "light", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.lamp_tafel", "light.ikea_of_sweden_stoftmoln_ceiling_wall_lamp_ww37", "light.ikea_of_sweden_tradfri_bulb_e27_ww_clear_250lm", "light.lamp_kast", "light.zout_lamp" ] } }, "running_script": false } } ], "sequence/1": [ { "path": "sequence/1", "timestamp": "2026-01-14T16:02:22.163842+00:00", "result": { "params": { "domain": "fan", "service": "turn_off", "service_data": {}, "target": { "device_id": [ "65efdd1635426f4f499786410bc83b34" ] } }, "running_script": false } } ], "sequence/2": [ { "path": "sequence/2", "timestamp": "2026-01-14T16:02:22.164647+00:00", "child_id": { "domain": "script", "item_id": "speakers_woonkamer_standby", "run_id": "50568589d047c57797b7b7e5e691a684" }, "result": { "params": { "domain": "script", "service": "speakers_woonkamer_standby", "service_data": {}, "target": {} }, "running_script": true } } ], "sequence/3": [ { "path": "sequence/3", "timestamp": "2026-01-14T16:02:22.334143+00:00", "child_id": { "domain": "script", "item_id": "voicebal_standby", "run_id": "969ff04c2aa79a1ff24bc34c0e8ad70d" }, "result": { "params": { "domain": "script", "service": "voicebal_standby", "service_data": {}, "target": {} }, "running_script": true } } ], "sequence/4": [ { "path": "sequence/4", "timestamp": "2026-01-14T16:02:22.337830+00:00", "child_id": { "domain": "script", "item_id": "verwarming_eco_2", "run_id": "8cacddc9fe7515814a2bf65f6dc537c3" }, "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "result": { "params": { "domain": "script", "service": "verwarming_eco_2", "service_data": {}, "target": {} }, "running_script": true } } ] }, "config": { "sequence": [ { "action": "light.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": [ "light.lamp_tafel", "light.ikea_of_sweden_stoftmoln_ceiling_wall_lamp_ww37", "light.ikea_of_sweden_tradfri_bulb_e27_ww_clear_250lm", "light.lamp_kast", "light.zout_lamp" ] } }, { "action": "fan.turn_off", "metadata": {}, "data": {}, "target": { "device_id": "65efdd1635426f4f499786410bc83b34" } }, { "action": "script.speakers_woonkamer_standby", "metadata": {}, "data": {} }, { "action": "script.voicebal_standby", "metadata": {}, "data": {} }, { "action": "script.verwarming_eco_2", "metadata": {}, "data": {} }, { "action": "script.kerst_uit", "metadata": {}, "data": {} }, { "if": [ { "condition": "time", "after": "22:00:00" } ], "then": [ { "action": "lock.lock", "metadata": {}, "data": {}, "target": { "device_id": "ead52fdd2817e1e0d5c981e717e3bf63" } } ], "alias": "check of de deur op slot moet" }, { "delay": { "hours": 0, "minutes": 0, "seconds": 3, "milliseconds": 0 } }, { "action": "script.display_off", "metadata": {}, "data": {} } ], "alias": "Vertrekken", "description": "", "icon": "mdi:exit-run" }, "blueprint_inputs": null, "context": { "id": "01KEYKWSGK295BAV6VPSJ0KFNR", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "short_dict": { "last_step": "sequence/4", "run_id": "578a16e496e83ed9d15c8da084962a17", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-14T16:02:21.843433+00:00", "finish": "2026-01-14T16:02:25.119287+00:00" }, "domain": "script", "item_id": "new_script", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0" } } ], "script.speakers_woonkamer_standby": [ { "extended_dict": { "last_step": "sequence/1", "run_id": "01349ff842a39cf5838cee8834ff9159", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T15:54:16.041197+00:00", "finish": "2026-01-13T15:54:16.205026+00:00" }, "domain": "script", "item_id": "speakers_woonkamer_standby", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-13T15:54:16.041443+00:00", "changed_variables": { "this": { "entity_id": "script.speakers_woonkamer_standby", "state": "off", "attributes": { "last_triggered": "2026-01-12T11:24:35.810152+00:00", "mode": "single", "current": 0, "icon": "mdi:exit-run", "friendly_name": "Speakers Woonkamer standby" }, "last_changed": "2026-01-13T12:08:44.575370+00:00", "last_reported": "2026-01-13T12:08:44.575370+00:00", "last_updated": "2026-01-13T12:08:44.575370+00:00", "context": { "id": "01KEVM49RZPRCQ3ZW6SV42B3PP", "parent_id": null, "user_id": null } }, "context": { "id": "01KEW117P8HGGRECRYYZ7K6YM7", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "result": { "params": { "domain": "switch", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "switch.unnamed_room_statuslampje" ] } }, "running_script": false } } ], "sequence/1": [ { "path": "sequence/1", "timestamp": "2026-01-13T15:54:16.188080+00:00", "result": { "params": { "domain": "media_player", "service": "media_stop", "service_data": {}, "target": { "device_id": [ "14f616b27d81af0d45c8847732876ec6" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "action": "switch.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": "switch.unnamed_room_statuslampje" } }, { "action": "media_player.media_stop", "metadata": {}, "data": {}, "target": { "device_id": "14f616b27d81af0d45c8847732876ec6" } } ], "alias": "Speakers Woonkamer standby", "description": "", "icon": "mdi:exit-run" }, "blueprint_inputs": null, "context": { "id": "01KEW117P8HGGRECRYYZ7K6YM7", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "short_dict": { "last_step": "sequence/1", "run_id": "01349ff842a39cf5838cee8834ff9159", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T15:54:16.041197+00:00", "finish": "2026-01-13T15:54:16.205026+00:00" }, "domain": "script", "item_id": "speakers_woonkamer_standby" } }, { "extended_dict": { "last_step": "sequence/1", "run_id": "508b69a37f0f606586e6f0cacde85acc", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T17:55:30.017114+00:00", "finish": "2026-01-13T17:55:30.082213+00:00" }, "domain": "script", "item_id": "speakers_woonkamer_standby", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-13T17:55:30.017467+00:00", "changed_variables": { "this": { "entity_id": "script.speakers_woonkamer_standby", "state": "off", "attributes": { "last_triggered": "2026-01-13T15:54:16.041265+00:00", "mode": "single", "current": 0, "icon": "mdi:exit-run", "friendly_name": "Speakers Woonkamer standby" }, "last_changed": "2026-01-13T15:54:16.204458+00:00", "last_reported": "2026-01-13T15:54:16.204458+00:00", "last_updated": "2026-01-13T15:54:16.204458+00:00", "context": { "id": "01KEW117P8HGGRECRYYZ7K6YM7", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "context": { "id": "01KEW7Z7GWMD61ZJDZJAMVYNY8", "parent_id": "01KEW13G8RFA9THQW4XGYC6XNW", "user_id": null } }, "result": { "params": { "domain": "switch", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "switch.unnamed_room_statuslampje" ] } }, "running_script": false } } ], "sequence/1": [ { "path": "sequence/1", "timestamp": "2026-01-13T17:55:30.073841+00:00", "result": { "params": { "domain": "media_player", "service": "media_stop", "service_data": {}, "target": { "device_id": [ "14f616b27d81af0d45c8847732876ec6" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "action": "switch.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": "switch.unnamed_room_statuslampje" } }, { "action": "media_player.media_stop", "metadata": {}, "data": {}, "target": { "device_id": "14f616b27d81af0d45c8847732876ec6" } } ], "alias": "Speakers Woonkamer standby", "description": "", "icon": "mdi:exit-run" }, "blueprint_inputs": null, "context": { "id": "01KEW7Z7GWMD61ZJDZJAMVYNY8", "parent_id": "01KEW13G8RFA9THQW4XGYC6XNW", "user_id": null } }, "short_dict": { "last_step": "sequence/1", "run_id": "508b69a37f0f606586e6f0cacde85acc", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T17:55:30.017114+00:00", "finish": "2026-01-13T17:55:30.082213+00:00" }, "domain": "script", "item_id": "speakers_woonkamer_standby" } }, { "extended_dict": { "last_step": "sequence/1", "run_id": "cdbd34e610fa7bbfec624fd143c36bd1", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T23:15:12.380735+00:00", "finish": "2026-01-13T23:15:12.496934+00:00" }, "domain": "script", "item_id": "speakers_woonkamer_standby", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-13T23:15:12.380989+00:00", "changed_variables": { "this": { "entity_id": "script.speakers_woonkamer_standby", "state": "off", "attributes": { "last_triggered": "2026-01-13T17:55:30.017194+00:00", "mode": "single", "current": 0, "icon": "mdi:exit-run", "friendly_name": "Speakers Woonkamer standby" }, "last_changed": "2026-01-13T17:55:30.081683+00:00", "last_reported": "2026-01-13T17:55:30.081683+00:00", "last_updated": "2026-01-13T17:55:30.081683+00:00", "context": { "id": "01KEW7Z7GWMD61ZJDZJAMVYNY8", "parent_id": "01KEW13G8RFA9THQW4XGYC6XNW", "user_id": null } }, "context": { "id": "01KEWT8KXH7QEJS52SBBHDEGBG", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "result": { "params": { "domain": "switch", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "switch.unnamed_room_statuslampje" ] } }, "running_script": false } } ], "sequence/1": [ { "path": "sequence/1", "timestamp": "2026-01-13T23:15:12.468852+00:00", "result": { "params": { "domain": "media_player", "service": "media_stop", "service_data": {}, "target": { "device_id": [ "14f616b27d81af0d45c8847732876ec6" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "action": "switch.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": "switch.unnamed_room_statuslampje" } }, { "action": "media_player.media_stop", "metadata": {}, "data": {}, "target": { "device_id": "14f616b27d81af0d45c8847732876ec6" } } ], "alias": "Speakers Woonkamer standby", "description": "", "icon": "mdi:exit-run" }, "blueprint_inputs": null, "context": { "id": "01KEWT8KXH7QEJS52SBBHDEGBG", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "short_dict": { "last_step": "sequence/1", "run_id": "cdbd34e610fa7bbfec624fd143c36bd1", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T23:15:12.380735+00:00", "finish": "2026-01-13T23:15:12.496934+00:00" }, "domain": "script", "item_id": "speakers_woonkamer_standby" } }, { "extended_dict": { "last_step": "sequence/1", "run_id": "50568589d047c57797b7b7e5e691a684", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T16:02:22.164769+00:00", "finish": "2026-01-14T16:02:22.333931+00:00" }, "domain": "script", "item_id": "speakers_woonkamer_standby", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-14T16:02:22.165046+00:00", "changed_variables": { "this": { "entity_id": "script.speakers_woonkamer_standby", "state": "off", "attributes": { "last_triggered": "2026-01-13T23:15:12.380780+00:00", "mode": "single", "current": 0, "icon": "mdi:exit-run", "friendly_name": "Speakers Woonkamer standby" }, "last_changed": "2026-01-14T15:48:26.120466+00:00", "last_reported": "2026-01-14T15:48:26.120466+00:00", "last_updated": "2026-01-14T15:48:26.120466+00:00", "context": { "id": "01KEYK39C8RR17MPK9NHXBWFBV", "parent_id": null, "user_id": null } }, "context": { "id": "01KEYKWSGK295BAV6VPSJ0KFNR", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "result": { "params": { "domain": "switch", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "switch.unnamed_room_statuslampje" ] } }, "running_script": false } } ], "sequence/1": [ { "path": "sequence/1", "timestamp": "2026-01-14T16:02:22.318306+00:00", "result": { "params": { "domain": "media_player", "service": "media_stop", "service_data": {}, "target": { "device_id": [ "14f616b27d81af0d45c8847732876ec6" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "action": "switch.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": "switch.unnamed_room_statuslampje" } }, { "action": "media_player.media_stop", "metadata": {}, "data": {}, "target": { "device_id": "14f616b27d81af0d45c8847732876ec6" } } ], "alias": "Speakers Woonkamer standby", "description": "", "icon": "mdi:exit-run" }, "blueprint_inputs": null, "context": { "id": "01KEYKWSGK295BAV6VPSJ0KFNR", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "short_dict": { "last_step": "sequence/1", "run_id": "50568589d047c57797b7b7e5e691a684", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T16:02:22.164769+00:00", "finish": "2026-01-14T16:02:22.333931+00:00" }, "domain": "script", "item_id": "speakers_woonkamer_standby" } }, { "extended_dict": { "last_step": "sequence/1", "run_id": "3453eb9730553fb00ce6bebbfb619ab9", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T18:04:11.390269+00:00", "finish": "2026-01-14T18:04:11.477318+00:00" }, "domain": "script", "item_id": "speakers_woonkamer_standby", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-14T18:04:11.390473+00:00", "changed_variables": { "this": { "entity_id": "script.speakers_woonkamer_standby", "state": "off", "attributes": { "last_triggered": "2026-01-14T16:02:22.164831+00:00", "mode": "single", "current": 0, "icon": "mdi:exit-run", "friendly_name": "Speakers Woonkamer standby" }, "last_changed": "2026-01-14T16:02:22.333524+00:00", "last_reported": "2026-01-14T16:02:22.333524+00:00", "last_updated": "2026-01-14T16:02:22.333524+00:00", "context": { "id": "01KEYKWSGK295BAV6VPSJ0KFNR", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "context": { "id": "01KEYTVVPA30Q9BJV5EZTN21DG", "parent_id": "01KEYM04E5WG7G8A50JEKRNMHF", "user_id": null } }, "result": { "params": { "domain": "switch", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "switch.unnamed_room_statuslampje" ] } }, "running_script": false } } ], "sequence/1": [ { "path": "sequence/1", "timestamp": "2026-01-14T18:04:11.467565+00:00", "result": { "params": { "domain": "media_player", "service": "media_stop", "service_data": {}, "target": { "device_id": [ "14f616b27d81af0d45c8847732876ec6" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "action": "switch.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": "switch.unnamed_room_statuslampje" } }, { "action": "media_player.media_stop", "metadata": {}, "data": {}, "target": { "device_id": "14f616b27d81af0d45c8847732876ec6" } } ], "alias": "Speakers Woonkamer standby", "description": "", "icon": "mdi:exit-run" }, "blueprint_inputs": null, "context": { "id": "01KEYTVVPA30Q9BJV5EZTN21DG", "parent_id": "01KEYM04E5WG7G8A50JEKRNMHF", "user_id": null } }, "short_dict": { "last_step": "sequence/1", "run_id": "3453eb9730553fb00ce6bebbfb619ab9", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T18:04:11.390269+00:00", "finish": "2026-01-14T18:04:11.477318+00:00" }, "domain": "script", "item_id": "speakers_woonkamer_standby" } } ], "script.voicebal_standby": [ { "extended_dict": { "last_step": "sequence/1", "run_id": "970961ed8bbd2d3dc5cbf6e1b8c64676", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T15:54:16.205369+00:00", "finish": "2026-01-13T15:54:16.217244+00:00" }, "domain": "script", "item_id": "voicebal_standby", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-13T15:54:16.205642+00:00", "changed_variables": { "this": { "entity_id": "script.voicebal_standby", "state": "off", "attributes": { "last_triggered": "2026-01-12T11:24:35.936654+00:00", "mode": "single", "current": 0, "icon": "mdi:account-tie-voice-off", "friendly_name": "VoiceBal Standby" }, "last_changed": "2026-01-13T12:08:44.575314+00:00", "last_reported": "2026-01-13T12:08:44.575314+00:00", "last_updated": "2026-01-13T12:08:44.575314+00:00", "context": { "id": "01KEVM49RZ8HKSB1211963RK4A", "parent_id": null, "user_id": null } }, "context": { "id": "01KEW117P8HGGRECRYYZ7K6YM7", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "result": { "params": { "domain": "light", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.esphome_web_0bac48", "light.esphome_web_0bac48_screen" ] } }, "running_script": false } } ], "sequence/1": [ { "path": "sequence/1", "timestamp": "2026-01-13T15:54:16.212562+00:00", "result": { "params": { "domain": "switch", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "switch.esphome_web_0bac48_speaker_enable" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "action": "light.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": [ "light.esphome_web_0bac48", "light.esphome_web_0bac48_screen" ] } }, { "action": "switch.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": "switch.esphome_web_0bac48_speaker_enable" } } ], "alias": "VoiceBal Standby", "description": "", "icon": "mdi:account-tie-voice-off" }, "blueprint_inputs": null, "context": { "id": "01KEW117P8HGGRECRYYZ7K6YM7", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "short_dict": { "last_step": "sequence/1", "run_id": "970961ed8bbd2d3dc5cbf6e1b8c64676", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T15:54:16.205369+00:00", "finish": "2026-01-13T15:54:16.217244+00:00" }, "domain": "script", "item_id": "voicebal_standby" } }, { "extended_dict": { "last_step": "sequence/1", "run_id": "308a7eca337e796029bc2daa31ff378a", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T17:55:30.082541+00:00", "finish": "2026-01-13T17:55:30.091476+00:00" }, "domain": "script", "item_id": "voicebal_standby", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-13T17:55:30.082733+00:00", "changed_variables": { "this": { "entity_id": "script.voicebal_standby", "state": "off", "attributes": { "last_triggered": "2026-01-13T15:54:16.205438+00:00", "mode": "single", "current": 0, "icon": "mdi:account-tie-voice-off", "friendly_name": "VoiceBal Standby" }, "last_changed": "2026-01-13T15:54:16.212969+00:00", "last_reported": "2026-01-13T15:54:16.212969+00:00", "last_updated": "2026-01-13T15:54:16.212969+00:00", "context": { "id": "01KEW117P8HGGRECRYYZ7K6YM7", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "context": { "id": "01KEW7Z7GWMD61ZJDZJAMVYNY8", "parent_id": "01KEW13G8RFA9THQW4XGYC6XNW", "user_id": null } }, "result": { "params": { "domain": "light", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.esphome_web_0bac48", "light.esphome_web_0bac48_screen" ] } }, "running_script": false } } ], "sequence/1": [ { "path": "sequence/1", "timestamp": "2026-01-13T17:55:30.087358+00:00", "result": { "params": { "domain": "switch", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "switch.esphome_web_0bac48_speaker_enable" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "action": "light.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": [ "light.esphome_web_0bac48", "light.esphome_web_0bac48_screen" ] } }, { "action": "switch.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": "switch.esphome_web_0bac48_speaker_enable" } } ], "alias": "VoiceBal Standby", "description": "", "icon": "mdi:account-tie-voice-off" }, "blueprint_inputs": null, "context": { "id": "01KEW7Z7GWMD61ZJDZJAMVYNY8", "parent_id": "01KEW13G8RFA9THQW4XGYC6XNW", "user_id": null } }, "short_dict": { "last_step": "sequence/1", "run_id": "308a7eca337e796029bc2daa31ff378a", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T17:55:30.082541+00:00", "finish": "2026-01-13T17:55:30.091476+00:00" }, "domain": "script", "item_id": "voicebal_standby" } }, { "extended_dict": { "last_step": "sequence/1", "run_id": "8258641d854ca01003b6a1155ab4d1a5", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T23:15:12.497243+00:00", "finish": "2026-01-13T23:15:12.507504+00:00" }, "domain": "script", "item_id": "voicebal_standby", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-13T23:15:12.497441+00:00", "changed_variables": { "this": { "entity_id": "script.voicebal_standby", "state": "off", "attributes": { "last_triggered": "2026-01-13T17:55:30.082586+00:00", "mode": "single", "current": 0, "icon": "mdi:account-tie-voice-off", "friendly_name": "VoiceBal Standby" }, "last_changed": "2026-01-13T17:55:30.087641+00:00", "last_reported": "2026-01-13T17:55:30.087641+00:00", "last_updated": "2026-01-13T17:55:30.087641+00:00", "context": { "id": "01KEW7Z7GWMD61ZJDZJAMVYNY8", "parent_id": "01KEW13G8RFA9THQW4XGYC6XNW", "user_id": null } }, "context": { "id": "01KEWT8KXH7QEJS52SBBHDEGBG", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "result": { "params": { "domain": "light", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.esphome_web_0bac48", "light.esphome_web_0bac48_screen" ] } }, "running_script": false } } ], "sequence/1": [ { "path": "sequence/1", "timestamp": "2026-01-13T23:15:12.502621+00:00", "result": { "params": { "domain": "switch", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "switch.esphome_web_0bac48_speaker_enable" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "action": "light.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": [ "light.esphome_web_0bac48", "light.esphome_web_0bac48_screen" ] } }, { "action": "switch.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": "switch.esphome_web_0bac48_speaker_enable" } } ], "alias": "VoiceBal Standby", "description": "", "icon": "mdi:account-tie-voice-off" }, "blueprint_inputs": null, "context": { "id": "01KEWT8KXH7QEJS52SBBHDEGBG", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "short_dict": { "last_step": "sequence/1", "run_id": "8258641d854ca01003b6a1155ab4d1a5", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T23:15:12.497243+00:00", "finish": "2026-01-13T23:15:12.507504+00:00" }, "domain": "script", "item_id": "voicebal_standby" } }, { "extended_dict": { "last_step": "sequence/1", "run_id": "969ff04c2aa79a1ff24bc34c0e8ad70d", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T16:02:22.334327+00:00", "finish": "2026-01-14T16:02:22.337789+00:00" }, "domain": "script", "item_id": "voicebal_standby", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-14T16:02:22.334745+00:00", "changed_variables": { "this": { "entity_id": "script.voicebal_standby", "state": "off", "attributes": { "last_triggered": "2026-01-13T23:15:12.497303+00:00", "mode": "single", "current": 0, "icon": "mdi:account-tie-voice-off", "friendly_name": "VoiceBal Standby" }, "last_changed": "2026-01-14T15:48:26.120355+00:00", "last_reported": "2026-01-14T15:48:26.120355+00:00", "last_updated": "2026-01-14T15:48:26.120355+00:00", "context": { "id": "01KEYK39C8YK7A76XJ7S1YVEHW", "parent_id": null, "user_id": null } }, "context": { "id": "01KEYKWSGK295BAV6VPSJ0KFNR", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "result": { "params": { "domain": "light", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.esphome_web_0bac48", "light.esphome_web_0bac48_screen" ] } }, "running_script": false } } ], "sequence/1": [ { "path": "sequence/1", "timestamp": "2026-01-14T16:02:22.335155+00:00", "result": { "params": { "domain": "switch", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "switch.esphome_web_0bac48_speaker_enable" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "action": "light.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": [ "light.esphome_web_0bac48", "light.esphome_web_0bac48_screen" ] } }, { "action": "switch.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": "switch.esphome_web_0bac48_speaker_enable" } } ], "alias": "VoiceBal Standby", "description": "", "icon": "mdi:account-tie-voice-off" }, "blueprint_inputs": null, "context": { "id": "01KEYKWSGK295BAV6VPSJ0KFNR", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "short_dict": { "last_step": "sequence/1", "run_id": "969ff04c2aa79a1ff24bc34c0e8ad70d", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T16:02:22.334327+00:00", "finish": "2026-01-14T16:02:22.337789+00:00" }, "domain": "script", "item_id": "voicebal_standby" } }, { "extended_dict": { "last_step": "sequence/1", "run_id": "6ac417a0d927e23f94fdd89da20e83a0", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T18:04:11.477639+00:00", "finish": "2026-01-14T18:04:11.478891+00:00" }, "domain": "script", "item_id": "voicebal_standby", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-14T18:04:11.477915+00:00", "changed_variables": { "this": { "entity_id": "script.voicebal_standby", "state": "off", "attributes": { "last_triggered": "2026-01-14T16:02:22.334416+00:00", "mode": "single", "current": 0, "icon": "mdi:account-tie-voice-off", "friendly_name": "VoiceBal Standby" }, "last_changed": "2026-01-14T16:02:22.337636+00:00", "last_reported": "2026-01-14T16:02:22.337636+00:00", "last_updated": "2026-01-14T16:02:22.337636+00:00", "context": { "id": "01KEYKWSGK295BAV6VPSJ0KFNR", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "context": { "id": "01KEYTVVPA30Q9BJV5EZTN21DG", "parent_id": "01KEYM04E5WG7G8A50JEKRNMHF", "user_id": null } }, "result": { "params": { "domain": "light", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.esphome_web_0bac48", "light.esphome_web_0bac48_screen" ] } }, "running_script": false } } ], "sequence/1": [ { "path": "sequence/1", "timestamp": "2026-01-14T18:04:11.478326+00:00", "result": { "params": { "domain": "switch", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "switch.esphome_web_0bac48_speaker_enable" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "action": "light.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": [ "light.esphome_web_0bac48", "light.esphome_web_0bac48_screen" ] } }, { "action": "switch.turn_off", "metadata": {}, "data": {}, "target": { "entity_id": "switch.esphome_web_0bac48_speaker_enable" } } ], "alias": "VoiceBal Standby", "description": "", "icon": "mdi:account-tie-voice-off" }, "blueprint_inputs": null, "context": { "id": "01KEYTVVPA30Q9BJV5EZTN21DG", "parent_id": "01KEYM04E5WG7G8A50JEKRNMHF", "user_id": null } }, "short_dict": { "last_step": "sequence/1", "run_id": "6ac417a0d927e23f94fdd89da20e83a0", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T18:04:11.477639+00:00", "finish": "2026-01-14T18:04:11.478891+00:00" }, "domain": "script", "item_id": "voicebal_standby" } } ], "script.verwarming_eco_2": [ { "extended_dict": { "last_step": "sequence/0", "run_id": "f026bfa2657b6c2540ffb0c2570a94fe", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-13T15:54:16.217587+00:00", "finish": "2026-01-13T15:54:33.590690+00:00" }, "domain": "script", "item_id": "verwarming_eco_2", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-13T15:54:16.217832+00:00", "changed_variables": { "this": { "entity_id": "script.verwarming_eco_2", "state": "off", "attributes": { "last_triggered": "2026-01-12T11:24:36.346747+00:00", "mode": "single", "current": 0, "friendly_name": "Verwarming Eco" }, "last_changed": "2026-01-13T12:08:44.575596+00:00", "last_reported": "2026-01-13T12:08:44.575596+00:00", "last_updated": "2026-01-13T12:08:44.575596+00:00", "context": { "id": "01KEVM49RZRF8KE24S6QVX7NYZ", "parent_id": null, "user_id": null } }, "context": { "id": "01KEW117P8HGGRECRYYZ7K6YM7", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "result": { "params": { "domain": "climate", "service": "set_temperature", "service_data": { "temperature": 10, "hvac_mode": "heat", "device_id": [ "a6c342fd91fe8235c3eea30494c495c0", "15a0f40b9a6e171f01dc2d6a65195f53", "2b87e743c31c0ed486136ad5153c9394", "132af80ea1f4a3b7dc3af822c9ff93de", "71c4472f2e7e4e9a0c7d36973841d0bc" ], "entity_id": [ "climate.thermostaat_keuken", "climate.kachel_kantoor" ] }, "target": { "device_id": [ "a6c342fd91fe8235c3eea30494c495c0", "15a0f40b9a6e171f01dc2d6a65195f53", "2b87e743c31c0ed486136ad5153c9394", "132af80ea1f4a3b7dc3af822c9ff93de", "71c4472f2e7e4e9a0c7d36973841d0bc" ], "entity_id": [ "climate.thermostaat_keuken", "climate.kachel_kantoor" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "action": "climate.set_temperature", "metadata": {}, "data": { "temperature": 10, "hvac_mode": "heat" }, "target": { "device_id": [ "a6c342fd91fe8235c3eea30494c495c0", "15a0f40b9a6e171f01dc2d6a65195f53", "2b87e743c31c0ed486136ad5153c9394", "132af80ea1f4a3b7dc3af822c9ff93de", "71c4472f2e7e4e9a0c7d36973841d0bc" ], "entity_id": [ "climate.thermostaat_keuken", "climate.kachel_kantoor" ] } } ], "alias": "Verwarming Eco", "description": "" }, "blueprint_inputs": null, "context": { "id": "01KEW117P8HGGRECRYYZ7K6YM7", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "short_dict": { "last_step": "sequence/0", "run_id": "f026bfa2657b6c2540ffb0c2570a94fe", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-13T15:54:16.217587+00:00", "finish": "2026-01-13T15:54:33.590690+00:00" }, "domain": "script", "item_id": "verwarming_eco_2", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0" } }, { "extended_dict": { "last_step": "sequence/0", "run_id": "74349cc1d5d9217f6a8026805a84555e", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-13T17:55:30.571671+00:00", "finish": "2026-01-13T17:55:33.629849+00:00" }, "domain": "script", "item_id": "verwarming_eco_2", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-13T17:55:30.571903+00:00", "changed_variables": { "this": { "entity_id": "script.verwarming_eco_2", "state": "off", "attributes": { "last_triggered": "2026-01-13T15:54:16.217628+00:00", "mode": "single", "current": 0, "friendly_name": "Verwarming Eco" }, "last_changed": "2026-01-13T15:54:33.589926+00:00", "last_reported": "2026-01-13T15:54:33.589926+00:00", "last_updated": "2026-01-13T15:54:33.589926+00:00", "context": { "id": "01KEW11S7NHJYN6VE2P22DHCR9", "parent_id": null, "user_id": null } }, "context": { "id": "01KEW7Z7GWMD61ZJDZJAMVYNY8", "parent_id": "01KEW13G8RFA9THQW4XGYC6XNW", "user_id": null } }, "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "result": { "params": { "domain": "climate", "service": "set_temperature", "service_data": { "temperature": 10, "hvac_mode": "heat", "device_id": [ "a6c342fd91fe8235c3eea30494c495c0", "15a0f40b9a6e171f01dc2d6a65195f53", "2b87e743c31c0ed486136ad5153c9394", "132af80ea1f4a3b7dc3af822c9ff93de", "71c4472f2e7e4e9a0c7d36973841d0bc" ], "entity_id": [ "climate.thermostaat_keuken", "climate.kachel_kantoor" ] }, "target": { "device_id": [ "a6c342fd91fe8235c3eea30494c495c0", "15a0f40b9a6e171f01dc2d6a65195f53", "2b87e743c31c0ed486136ad5153c9394", "132af80ea1f4a3b7dc3af822c9ff93de", "71c4472f2e7e4e9a0c7d36973841d0bc" ], "entity_id": [ "climate.thermostaat_keuken", "climate.kachel_kantoor" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "action": "climate.set_temperature", "metadata": {}, "data": { "temperature": 10, "hvac_mode": "heat" }, "target": { "device_id": [ "a6c342fd91fe8235c3eea30494c495c0", "15a0f40b9a6e171f01dc2d6a65195f53", "2b87e743c31c0ed486136ad5153c9394", "132af80ea1f4a3b7dc3af822c9ff93de", "71c4472f2e7e4e9a0c7d36973841d0bc" ], "entity_id": [ "climate.thermostaat_keuken", "climate.kachel_kantoor" ] } } ], "alias": "Verwarming Eco", "description": "" }, "blueprint_inputs": null, "context": { "id": "01KEW7Z7GWMD61ZJDZJAMVYNY8", "parent_id": "01KEW13G8RFA9THQW4XGYC6XNW", "user_id": null } }, "short_dict": { "last_step": "sequence/0", "run_id": "74349cc1d5d9217f6a8026805a84555e", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-13T17:55:30.571671+00:00", "finish": "2026-01-13T17:55:33.629849+00:00" }, "domain": "script", "item_id": "verwarming_eco_2", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0" } }, { "extended_dict": { "last_step": "sequence/0", "run_id": "59a906c0e5e202dfe3d32f48f7ef6403", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-13T23:15:12.507800+00:00", "finish": "2026-01-13T23:15:14.184675+00:00" }, "domain": "script", "item_id": "verwarming_eco_2", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-13T23:15:12.508063+00:00", "changed_variables": { "this": { "entity_id": "script.verwarming_eco_2", "state": "off", "attributes": { "last_triggered": "2026-01-13T17:55:30.571732+00:00", "mode": "single", "current": 0, "friendly_name": "Verwarming Eco" }, "last_changed": "2026-01-13T17:55:33.629137+00:00", "last_reported": "2026-01-13T17:55:33.629137+00:00", "last_updated": "2026-01-13T17:55:33.629137+00:00", "context": { "id": "01KEW7Z7GWMD61ZJDZJAMVYNY8", "parent_id": "01KEW13G8RFA9THQW4XGYC6XNW", "user_id": null } }, "context": { "id": "01KEWT8KXH7QEJS52SBBHDEGBG", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "result": { "params": { "domain": "climate", "service": "set_temperature", "service_data": { "temperature": 10, "hvac_mode": "heat", "device_id": [ "a6c342fd91fe8235c3eea30494c495c0", "15a0f40b9a6e171f01dc2d6a65195f53", "2b87e743c31c0ed486136ad5153c9394", "132af80ea1f4a3b7dc3af822c9ff93de", "71c4472f2e7e4e9a0c7d36973841d0bc" ], "entity_id": [ "climate.thermostaat_keuken", "climate.kachel_kantoor" ] }, "target": { "device_id": [ "a6c342fd91fe8235c3eea30494c495c0", "15a0f40b9a6e171f01dc2d6a65195f53", "2b87e743c31c0ed486136ad5153c9394", "132af80ea1f4a3b7dc3af822c9ff93de", "71c4472f2e7e4e9a0c7d36973841d0bc" ], "entity_id": [ "climate.thermostaat_keuken", "climate.kachel_kantoor" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "action": "climate.set_temperature", "metadata": {}, "data": { "temperature": 10, "hvac_mode": "heat" }, "target": { "device_id": [ "a6c342fd91fe8235c3eea30494c495c0", "15a0f40b9a6e171f01dc2d6a65195f53", "2b87e743c31c0ed486136ad5153c9394", "132af80ea1f4a3b7dc3af822c9ff93de", "71c4472f2e7e4e9a0c7d36973841d0bc" ], "entity_id": [ "climate.thermostaat_keuken", "climate.kachel_kantoor" ] } } ], "alias": "Verwarming Eco", "description": "" }, "blueprint_inputs": null, "context": { "id": "01KEWT8KXH7QEJS52SBBHDEGBG", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "short_dict": { "last_step": "sequence/0", "run_id": "59a906c0e5e202dfe3d32f48f7ef6403", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-13T23:15:12.507800+00:00", "finish": "2026-01-13T23:15:14.184675+00:00" }, "domain": "script", "item_id": "verwarming_eco_2", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0" } }, { "extended_dict": { "last_step": "sequence/0", "run_id": "8cacddc9fe7515814a2bf65f6dc537c3", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-14T16:02:22.337925+00:00", "finish": "2026-01-14T16:02:25.111703+00:00" }, "domain": "script", "item_id": "verwarming_eco_2", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-14T16:02:22.338152+00:00", "changed_variables": { "this": { "entity_id": "script.verwarming_eco_2", "state": "off", "attributes": { "last_triggered": "2026-01-13T23:15:12.507891+00:00", "mode": "single", "current": 0, "friendly_name": "Verwarming Eco" }, "last_changed": "2026-01-14T15:48:26.120914+00:00", "last_reported": "2026-01-14T15:48:26.120914+00:00", "last_updated": "2026-01-14T15:48:26.120914+00:00", "context": { "id": "01KEYK39C890C4BZ51DKTPM7HJ", "parent_id": null, "user_id": null } }, "context": { "id": "01KEYKWSGK295BAV6VPSJ0KFNR", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "result": { "params": { "domain": "climate", "service": "set_temperature", "service_data": { "temperature": 10, "hvac_mode": "heat", "device_id": [ "a6c342fd91fe8235c3eea30494c495c0", "15a0f40b9a6e171f01dc2d6a65195f53", "2b87e743c31c0ed486136ad5153c9394", "132af80ea1f4a3b7dc3af822c9ff93de", "71c4472f2e7e4e9a0c7d36973841d0bc" ], "entity_id": [ "climate.thermostaat_keuken", "climate.kachel_kantoor" ] }, "target": { "device_id": [ "a6c342fd91fe8235c3eea30494c495c0", "15a0f40b9a6e171f01dc2d6a65195f53", "2b87e743c31c0ed486136ad5153c9394", "132af80ea1f4a3b7dc3af822c9ff93de", "71c4472f2e7e4e9a0c7d36973841d0bc" ], "entity_id": [ "climate.thermostaat_keuken", "climate.kachel_kantoor" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "action": "climate.set_temperature", "metadata": {}, "data": { "temperature": 10, "hvac_mode": "heat" }, "target": { "device_id": [ "a6c342fd91fe8235c3eea30494c495c0", "15a0f40b9a6e171f01dc2d6a65195f53", "2b87e743c31c0ed486136ad5153c9394", "132af80ea1f4a3b7dc3af822c9ff93de", "71c4472f2e7e4e9a0c7d36973841d0bc" ], "entity_id": [ "climate.thermostaat_keuken", "climate.kachel_kantoor" ] } } ], "alias": "Verwarming Eco", "description": "" }, "blueprint_inputs": null, "context": { "id": "01KEYKWSGK295BAV6VPSJ0KFNR", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "short_dict": { "last_step": "sequence/0", "run_id": "8cacddc9fe7515814a2bf65f6dc537c3", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-14T16:02:22.337925+00:00", "finish": "2026-01-14T16:02:25.111703+00:00" }, "domain": "script", "item_id": "verwarming_eco_2", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0" } }, { "extended_dict": { "last_step": "sequence/0", "run_id": "16ebcb3c8c7a28827436e4e8a3c2c24f", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-14T18:04:12.476734+00:00", "finish": "2026-01-14T18:04:14.558720+00:00" }, "domain": "script", "item_id": "verwarming_eco_2", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-14T18:04:12.476999+00:00", "changed_variables": { "this": { "entity_id": "script.verwarming_eco_2", "state": "off", "attributes": { "last_triggered": "2026-01-14T16:02:22.337970+00:00", "mode": "single", "current": 0, "friendly_name": "Verwarming Eco" }, "last_changed": "2026-01-14T16:02:25.111007+00:00", "last_reported": "2026-01-14T16:02:25.111007+00:00", "last_updated": "2026-01-14T16:02:25.111007+00:00", "context": { "id": "01KEYKWSGK295BAV6VPSJ0KFNR", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "context": { "id": "01KEYTVVPA30Q9BJV5EZTN21DG", "parent_id": "01KEYM04E5WG7G8A50JEKRNMHF", "user_id": null } }, "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0", "result": { "params": { "domain": "climate", "service": "set_temperature", "service_data": { "temperature": 10, "hvac_mode": "heat", "device_id": [ "a6c342fd91fe8235c3eea30494c495c0", "15a0f40b9a6e171f01dc2d6a65195f53", "2b87e743c31c0ed486136ad5153c9394", "132af80ea1f4a3b7dc3af822c9ff93de", "71c4472f2e7e4e9a0c7d36973841d0bc" ], "entity_id": [ "climate.thermostaat_keuken", "climate.kachel_kantoor" ] }, "target": { "device_id": [ "a6c342fd91fe8235c3eea30494c495c0", "15a0f40b9a6e171f01dc2d6a65195f53", "2b87e743c31c0ed486136ad5153c9394", "132af80ea1f4a3b7dc3af822c9ff93de", "71c4472f2e7e4e9a0c7d36973841d0bc" ], "entity_id": [ "climate.thermostaat_keuken", "climate.kachel_kantoor" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "action": "climate.set_temperature", "metadata": {}, "data": { "temperature": 10, "hvac_mode": "heat" }, "target": { "device_id": [ "a6c342fd91fe8235c3eea30494c495c0", "15a0f40b9a6e171f01dc2d6a65195f53", "2b87e743c31c0ed486136ad5153c9394", "132af80ea1f4a3b7dc3af822c9ff93de", "71c4472f2e7e4e9a0c7d36973841d0bc" ], "entity_id": [ "climate.thermostaat_keuken", "climate.kachel_kantoor" ] } } ], "alias": "Verwarming Eco", "description": "" }, "blueprint_inputs": null, "context": { "id": "01KEYTVVPA30Q9BJV5EZTN21DG", "parent_id": "01KEYM04E5WG7G8A50JEKRNMHF", "user_id": null } }, "short_dict": { "last_step": "sequence/0", "run_id": "16ebcb3c8c7a28827436e4e8a3c2c24f", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-14T18:04:12.476734+00:00", "finish": "2026-01-14T18:04:14.558720+00:00" }, "domain": "script", "item_id": "verwarming_eco_2", "error": "Provided temperature 10.0 is not valid. Accepted range is 12.0 to 20.0" } } ], "automation.1764152745969": [ { "extended_dict": { "last_step": "action/0/choose/1/sequence/0", "run_id": "62861724b471e6213c43df1fc145183d", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T21:30:00.255401+00:00", "finish": "2026-01-13T21:30:00.815152+00:00" }, "domain": "automation", "item_id": "1764152745969", "trigger": "time", "trace": { "trigger/1": [ { "path": "trigger/1", "timestamp": "2026-01-13T21:30:00.255432+00:00", "changed_variables": { "this": { "entity_id": "automation.woonkamer_verlichting_automatisch", "state": "on", "attributes": { "id": "1764152745969", "last_triggered": "2026-01-13T15:55:39.370892+00:00", "mode": "single", "current": 0, "friendly_name": "Woonkamer verlichting automatisch" }, "last_changed": "2026-01-13T12:10:27.680649+00:00", "last_reported": "2026-01-13T15:55:39.576431+00:00", "last_updated": "2026-01-13T15:55:39.576431+00:00", "context": { "id": "01KEW13SFAMJ00PVQWKTHE3B8Y", "parent_id": null, "user_id": null } }, "trigger": { "id": "uit", "idx": "1", "alias": null, "platform": "time", "now": "2026-01-13T22:30:00.255241+01:00", "description": "time", "entity_id": null } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-13T21:30:00.255798+00:00", "changed_variables": { "context": { "id": "01KEWM805ZF462NJAPCD6B1JSZ", "parent_id": null, "user_id": null } }, "result": { "choice": 1 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-13T21:30:00.255882+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-13T21:30:00.255926+00:00", "result": { "result": false } } ], "action/0/choose/1": [ { "path": "action/0/choose/1", "timestamp": "2026-01-13T21:30:00.255983+00:00", "result": { "result": true } } ], "action/0/choose/1/conditions/0": [ { "path": "action/0/choose/1/conditions/0", "timestamp": "2026-01-13T21:30:00.256014+00:00", "result": { "result": true } } ], "action/0/choose/1/conditions/1": [ { "path": "action/0/choose/1/conditions/1", "timestamp": "2026-01-13T21:30:00.256052+00:00", "result": { "result": true } }, { "path": "action/0/choose/1/conditions/1", "timestamp": "2026-01-13T21:30:00.256079+00:00", "result": { "result": true } } ], "action/0/choose/1/conditions/1/entity_id/0": [ { "path": "action/0/choose/1/conditions/1/entity_id/0", "timestamp": "2026-01-13T21:30:00.256109+00:00", "result": { "result": true, "state": "off", "duration": "2026-01-13T21:10:00.256241+00:00" } } ], "action/0/choose/1/sequence/0": [ { "path": "action/0/choose/1/sequence/0", "timestamp": "2026-01-13T21:30:00.256342+00:00", "result": { "params": { "domain": "light", "service": "turn_off", "service_data": {}, "target": { "area_id": [ "woonkamer" ] } }, "running_script": false } } ] }, "config": { "id": "1764152745969", "alias": "Woonkamer verlichting automatisch", "description": "", "triggers": [ { "trigger": "sun", "event": "sunset", "offset": 0, "id": "sunset" }, { "trigger": "time", "at": "22:30:00", "id": "uit" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "sunset" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": {}, "target": { "device_id": "3bbf9bc0a07de0f76801fce9366f23fc", "entity_id": "light.lamp_kast" } }, { "action": "script.kerst_aan", "metadata": {}, "data": {} } ] }, { "conditions": [ { "condition": "trigger", "id": [ "uit" ] }, { "type": "is_not_occupied", "condition": "device", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "773342fe1c8ed884b90c7f65cd3aac41", "domain": "binary_sensor", "for": { "hours": 0, "minutes": 20, "seconds": 0 } } ], "sequence": [ { "action": "light.turn_off", "metadata": {}, "data": {}, "target": { "area_id": "woonkamer" } } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEWM805ZF462NJAPCD6B1JSZ", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "action/0/choose/1/sequence/0", "run_id": "62861724b471e6213c43df1fc145183d", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T21:30:00.255401+00:00", "finish": "2026-01-13T21:30:00.815152+00:00" }, "domain": "automation", "item_id": "1764152745969", "trigger": "time" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/1", "run_id": "abe458a87b09a274b9028367c831edf9", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T15:57:10.900982+00:00", "finish": "2026-01-14T15:57:11.047729+00:00" }, "domain": "automation", "item_id": "1764152745969", "trigger": "sunset", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T15:57:10.901010+00:00", "changed_variables": { "this": { "entity_id": "automation.woonkamer_verlichting_automatisch", "state": "on", "attributes": { "id": "1764152745969", "last_triggered": "2026-01-13T21:30:00.255515+00:00", "mode": "single", "current": 0, "friendly_name": "Woonkamer verlichting automatisch" }, "last_changed": "2026-01-14T15:48:56.988333+00:00", "last_reported": "2026-01-14T15:48:56.988333+00:00", "last_updated": "2026-01-14T15:48:56.988333+00:00", "context": { "id": "01KEYK47GW70QHC9AJ0G2SNX9K", "parent_id": null, "user_id": null } }, "trigger": { "id": "sunset", "idx": "0", "alias": null, "platform": "sun", "event": "sunset", "offset": { "__type": "", "total_seconds": 0.0 }, "description": "sunset" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T15:57:10.901395+00:00", "changed_variables": { "context": { "id": "01KEYKK9VMDNGNQVAZ33NSRXB6", "parent_id": null, "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T15:57:10.901672+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T15:57:10.901700+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-14T15:57:10.901788+00:00", "result": { "params": { "domain": "light", "service": "turn_on", "service_data": {}, "target": { "device_id": [ "3bbf9bc0a07de0f76801fce9366f23fc" ], "entity_id": [ "light.lamp_kast" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/1": [ { "path": "action/0/choose/0/sequence/1", "timestamp": "2026-01-14T15:57:11.033114+00:00", "child_id": { "domain": "script", "item_id": "kerst_aan", "run_id": "1b258f3b11fed693eb2b6470e84a021f" }, "result": { "params": { "domain": "script", "service": "kerst_aan", "service_data": {}, "target": {} }, "running_script": true } } ] }, "config": { "id": "1764152745969", "alias": "Woonkamer verlichting automatisch", "description": "", "triggers": [ { "trigger": "sun", "event": "sunset", "offset": 0, "id": "sunset" }, { "trigger": "time", "at": "22:30:00", "id": "uit" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "sunset" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": {}, "target": { "device_id": "3bbf9bc0a07de0f76801fce9366f23fc", "entity_id": "light.lamp_kast" } }, { "action": "script.kerst_aan", "metadata": {}, "data": {} } ] }, { "conditions": [ { "condition": "trigger", "id": [ "uit" ] }, { "type": "is_not_occupied", "condition": "device", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "773342fe1c8ed884b90c7f65cd3aac41", "domain": "binary_sensor", "for": { "hours": 0, "minutes": 20, "seconds": 0 } } ], "sequence": [ { "action": "light.turn_off", "metadata": {}, "data": {}, "target": { "area_id": "woonkamer" } } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEYKK9VMDNGNQVAZ33NSRXB6", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/1", "run_id": "abe458a87b09a274b9028367c831edf9", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T15:57:10.900982+00:00", "finish": "2026-01-14T15:57:11.047729+00:00" }, "domain": "automation", "item_id": "1764152745969", "trigger": "sunset" } }, { "extended_dict": { "last_step": "action/0/choose/1/sequence/0", "run_id": "2c56b9ac88dcc1da8bb6933019d7121d", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T21:30:00.115507+00:00", "finish": "2026-01-14T21:30:00.483619+00:00" }, "domain": "automation", "item_id": "1764152745969", "trigger": "time", "trace": { "trigger/1": [ { "path": "trigger/1", "timestamp": "2026-01-14T21:30:00.115539+00:00", "changed_variables": { "this": { "entity_id": "automation.woonkamer_verlichting_automatisch", "state": "on", "attributes": { "id": "1764152745969", "last_triggered": "2026-01-14T15:57:10.901141+00:00", "mode": "single", "current": 0, "friendly_name": "Woonkamer verlichting automatisch" }, "last_changed": "2026-01-14T15:48:56.988333+00:00", "last_reported": "2026-01-14T15:57:11.046778+00:00", "last_updated": "2026-01-14T15:57:11.046778+00:00", "context": { "id": "01KEYKK9VMDNGNQVAZ33NSRXB6", "parent_id": null, "user_id": null } }, "trigger": { "id": "uit", "idx": "1", "alias": null, "platform": "time", "now": "2026-01-14T22:30:00.115331+01:00", "description": "time", "entity_id": null } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T21:30:00.115840+00:00", "changed_variables": { "context": { "id": "01KEZ6MQ1KNTGTM47HECC3SZH0", "parent_id": null, "user_id": null } }, "result": { "choice": 1 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T21:30:00.115898+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T21:30:00.115927+00:00", "result": { "result": false } } ], "action/0/choose/1": [ { "path": "action/0/choose/1", "timestamp": "2026-01-14T21:30:00.115964+00:00", "result": { "result": true } } ], "action/0/choose/1/conditions/0": [ { "path": "action/0/choose/1/conditions/0", "timestamp": "2026-01-14T21:30:00.115982+00:00", "result": { "result": true } } ], "action/0/choose/1/conditions/1": [ { "path": "action/0/choose/1/conditions/1", "timestamp": "2026-01-14T21:30:00.116003+00:00", "result": { "result": true } }, { "path": "action/0/choose/1/conditions/1", "timestamp": "2026-01-14T21:30:00.116017+00:00", "result": { "result": true } } ], "action/0/choose/1/conditions/1/entity_id/0": [ { "path": "action/0/choose/1/conditions/1/entity_id/0", "timestamp": "2026-01-14T21:30:00.116032+00:00", "result": { "result": true, "state": "off", "duration": "2026-01-14T21:10:00.116119+00:00" } } ], "action/0/choose/1/sequence/0": [ { "path": "action/0/choose/1/sequence/0", "timestamp": "2026-01-14T21:30:00.116223+00:00", "result": { "params": { "domain": "light", "service": "turn_off", "service_data": {}, "target": { "area_id": [ "woonkamer" ] } }, "running_script": false } } ] }, "config": { "id": "1764152745969", "alias": "Woonkamer verlichting automatisch", "description": "", "triggers": [ { "trigger": "sun", "event": "sunset", "offset": 0, "id": "sunset" }, { "trigger": "time", "at": "22:30:00", "id": "uit" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "sunset" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": {}, "target": { "device_id": "3bbf9bc0a07de0f76801fce9366f23fc", "entity_id": "light.lamp_kast" } }, { "action": "script.kerst_aan", "metadata": {}, "data": {} } ] }, { "conditions": [ { "condition": "trigger", "id": [ "uit" ] }, { "type": "is_not_occupied", "condition": "device", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "773342fe1c8ed884b90c7f65cd3aac41", "domain": "binary_sensor", "for": { "hours": 0, "minutes": 20, "seconds": 0 } } ], "sequence": [ { "action": "light.turn_off", "metadata": {}, "data": {}, "target": { "area_id": "woonkamer" } } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEZ6MQ1KNTGTM47HECC3SZH0", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "action/0/choose/1/sequence/0", "run_id": "2c56b9ac88dcc1da8bb6933019d7121d", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T21:30:00.115507+00:00", "finish": "2026-01-14T21:30:00.483619+00:00" }, "domain": "automation", "item_id": "1764152745969", "trigger": "time" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/1", "run_id": "a0be84cf1a91399eb8251db3b0e7d17a", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-15T15:58:44.092998+00:00", "finish": "2026-01-15T15:58:44.316988+00:00" }, "domain": "automation", "item_id": "1764152745969", "trigger": "sunset", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-15T15:58:44.093021+00:00", "changed_variables": { "this": { "entity_id": "automation.woonkamer_verlichting_automatisch", "state": "on", "attributes": { "id": "1764152745969", "last_triggered": "2026-01-14T21:30:00.115612+00:00", "mode": "single", "current": 0, "friendly_name": "Woonkamer verlichting automatisch" }, "last_changed": "2026-01-15T08:04:17.793085+00:00", "last_reported": "2026-01-15T08:04:17.793085+00:00", "last_updated": "2026-01-15T08:04:17.793085+00:00", "context": { "id": "01KF0AY4R1J28E3NJYZ5QWWPJV", "parent_id": null, "user_id": null } }, "trigger": { "id": "sunset", "idx": "0", "alias": null, "platform": "sun", "event": "sunset", "offset": { "__type": "", "total_seconds": 0.0 }, "description": "sunset" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-15T15:58:44.093340+00:00", "changed_variables": { "context": { "id": "01KF162VVWNT6K74NTJCAFW7S0", "parent_id": null, "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-15T15:58:44.093701+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-15T15:58:44.093734+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-15T15:58:44.093828+00:00", "result": { "params": { "domain": "light", "service": "turn_on", "service_data": {}, "target": { "device_id": [ "3bbf9bc0a07de0f76801fce9366f23fc" ], "entity_id": [ "light.lamp_kast" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/1": [ { "path": "action/0/choose/0/sequence/1", "timestamp": "2026-01-15T15:58:44.303574+00:00", "child_id": { "domain": "script", "item_id": "kerst_aan", "run_id": "2e47fb6fc9a3d307f17ba779e9eeb26f" }, "result": { "params": { "domain": "script", "service": "kerst_aan", "service_data": {}, "target": {} }, "running_script": true } } ] }, "config": { "id": "1764152745969", "alias": "Woonkamer verlichting automatisch", "description": "", "triggers": [ { "trigger": "sun", "event": "sunset", "offset": 0, "id": "sunset" }, { "trigger": "time", "at": "22:30:00", "id": "uit" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "sunset" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": {}, "target": { "device_id": "3bbf9bc0a07de0f76801fce9366f23fc", "entity_id": "light.lamp_kast" } }, { "action": "script.kerst_aan", "metadata": {}, "data": {} } ] }, { "conditions": [ { "condition": "trigger", "id": [ "uit" ] }, { "type": "is_not_occupied", "condition": "device", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "773342fe1c8ed884b90c7f65cd3aac41", "domain": "binary_sensor", "for": { "hours": 0, "minutes": 20, "seconds": 0 } } ], "sequence": [ { "action": "light.turn_off", "metadata": {}, "data": {}, "target": { "area_id": "woonkamer" } } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF162VVWNT6K74NTJCAFW7S0", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/1", "run_id": "a0be84cf1a91399eb8251db3b0e7d17a", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-15T15:58:44.092998+00:00", "finish": "2026-01-15T15:58:44.316988+00:00" }, "domain": "automation", "item_id": "1764152745969", "trigger": "sunset" } }, { "extended_dict": { "last_step": "action/0/choose/1/sequence/0", "run_id": "cc64a188b0eb991699d86642c1a37316", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-15T21:30:00.203554+00:00", "finish": "2026-01-15T21:30:00.781607+00:00" }, "domain": "automation", "item_id": "1764152745969", "trigger": "time", "trace": { "trigger/1": [ { "path": "trigger/1", "timestamp": "2026-01-15T21:30:00.203612+00:00", "changed_variables": { "this": { "entity_id": "automation.woonkamer_verlichting_automatisch", "state": "on", "attributes": { "id": "1764152745969", "last_triggered": "2026-01-15T15:58:44.093153+00:00", "mode": "single", "current": 0, "friendly_name": "Woonkamer verlichting automatisch" }, "last_changed": "2026-01-15T08:04:17.793085+00:00", "last_reported": "2026-01-15T15:58:44.315726+00:00", "last_updated": "2026-01-15T15:58:44.315726+00:00", "context": { "id": "01KF162VVWNT6K74NTJCAFW7S0", "parent_id": null, "user_id": null } }, "trigger": { "id": "uit", "idx": "1", "alias": null, "platform": "time", "now": "2026-01-15T22:30:00.203446+01:00", "description": "time", "entity_id": null } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-15T21:30:00.203864+00:00", "changed_variables": { "context": { "id": "01KF1S1E4B1G1KXJ3EX8EFGRSQ", "parent_id": null, "user_id": null } }, "result": { "choice": 1 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-15T21:30:00.203918+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-15T21:30:00.203945+00:00", "result": { "result": false } } ], "action/0/choose/1": [ { "path": "action/0/choose/1", "timestamp": "2026-01-15T21:30:00.203980+00:00", "result": { "result": true } } ], "action/0/choose/1/conditions/0": [ { "path": "action/0/choose/1/conditions/0", "timestamp": "2026-01-15T21:30:00.203998+00:00", "result": { "result": true } } ], "action/0/choose/1/conditions/1": [ { "path": "action/0/choose/1/conditions/1", "timestamp": "2026-01-15T21:30:00.204018+00:00", "result": { "result": true } }, { "path": "action/0/choose/1/conditions/1", "timestamp": "2026-01-15T21:30:00.204034+00:00", "result": { "result": true } } ], "action/0/choose/1/conditions/1/entity_id/0": [ { "path": "action/0/choose/1/conditions/1/entity_id/0", "timestamp": "2026-01-15T21:30:00.204049+00:00", "result": { "result": true, "state": "off", "duration": "2026-01-15T21:10:00.204137+00:00" } } ], "action/0/choose/1/sequence/0": [ { "path": "action/0/choose/1/sequence/0", "timestamp": "2026-01-15T21:30:00.204235+00:00", "result": { "params": { "domain": "light", "service": "turn_off", "service_data": {}, "target": { "area_id": [ "woonkamer" ] } }, "running_script": false } } ] }, "config": { "id": "1764152745969", "alias": "Woonkamer verlichting automatisch", "description": "", "triggers": [ { "trigger": "sun", "event": "sunset", "offset": 0, "id": "sunset" }, { "trigger": "time", "at": "22:30:00", "id": "uit" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "sunset" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": {}, "target": { "device_id": "3bbf9bc0a07de0f76801fce9366f23fc", "entity_id": "light.lamp_kast" } }, { "action": "script.kerst_aan", "metadata": {}, "data": {} } ] }, { "conditions": [ { "condition": "trigger", "id": [ "uit" ] }, { "type": "is_not_occupied", "condition": "device", "device_id": "95d0118df036203c9ba9666a638f4aa7", "entity_id": "773342fe1c8ed884b90c7f65cd3aac41", "domain": "binary_sensor", "for": { "hours": 0, "minutes": 20, "seconds": 0 } } ], "sequence": [ { "action": "light.turn_off", "metadata": {}, "data": {}, "target": { "area_id": "woonkamer" } } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF1S1E4B1G1KXJ3EX8EFGRSQ", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "action/0/choose/1/sequence/0", "run_id": "cc64a188b0eb991699d86642c1a37316", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-15T21:30:00.203554+00:00", "finish": "2026-01-15T21:30:00.781607+00:00" }, "domain": "automation", "item_id": "1764152745969", "trigger": "time" } } ], "script.kerst_aan": [ { "extended_dict": { "last_step": "sequence/0", "run_id": "31f1122ebdad814b15550da910bfd634", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T15:55:39.567098+00:00", "finish": "2026-01-13T15:55:39.567883+00:00" }, "domain": "script", "item_id": "kerst_aan", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-13T15:55:39.567398+00:00", "changed_variables": { "this": { "entity_id": "script.kerst_aan", "state": "off", "attributes": { "last_triggered": "2026-01-12T15:54:09.803850+00:00", "mode": "single", "current": 0, "icon": "mdi:pine-tree", "friendly_name": "Kerst aan" }, "last_changed": "2026-01-13T12:08:44.576042+00:00", "last_reported": "2026-01-13T12:08:44.576042+00:00", "last_updated": "2026-01-13T12:08:44.576042+00:00", "context": { "id": "01KEVM49S0DQGYW9JEWYF4WKFD", "parent_id": null, "user_id": null } }, "context": { "id": "01KEW13SFAMJ00PVQWKTHE3B8Y", "parent_id": null, "user_id": null } }, "result": { "params": { "domain": "select", "service": "select_option", "service_data": { "option": "Candle Multi", "entity_id": [ "select.kerstboom_voorinstelling" ] }, "target": { "entity_id": [ "select.kerstboom_voorinstelling" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "action": "select.select_option", "metadata": {}, "target": { "entity_id": "select.kerstboom_voorinstelling" }, "data": { "option": "Candle Multi" } } ], "alias": "Kerst aan", "description": "", "icon": "mdi:pine-tree" }, "blueprint_inputs": null, "context": { "id": "01KEW13SFAMJ00PVQWKTHE3B8Y", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "sequence/0", "run_id": "31f1122ebdad814b15550da910bfd634", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T15:55:39.567098+00:00", "finish": "2026-01-13T15:55:39.567883+00:00" }, "domain": "script", "item_id": "kerst_aan" } }, { "extended_dict": { "last_step": "sequence/0", "run_id": "1b258f3b11fed693eb2b6470e84a021f", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T15:57:11.033325+00:00", "finish": "2026-01-14T15:57:11.034030+00:00" }, "domain": "script", "item_id": "kerst_aan", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-14T15:57:11.033564+00:00", "changed_variables": { "this": { "entity_id": "script.kerst_aan", "state": "off", "attributes": { "last_triggered": "2026-01-13T15:55:39.567138+00:00", "mode": "single", "current": 0, "icon": "mdi:pine-tree", "friendly_name": "Kerst aan" }, "last_changed": "2026-01-14T15:48:26.121844+00:00", "last_reported": "2026-01-14T15:48:26.121844+00:00", "last_updated": "2026-01-14T15:48:26.121844+00:00", "context": { "id": "01KEYK39C9ZTVXJWHEZTTX2BJZ", "parent_id": null, "user_id": null } }, "context": { "id": "01KEYKK9VMDNGNQVAZ33NSRXB6", "parent_id": null, "user_id": null } }, "result": { "params": { "domain": "select", "service": "select_option", "service_data": { "option": "Candle Multi", "entity_id": [ "select.kerstboom_voorinstelling" ] }, "target": { "entity_id": [ "select.kerstboom_voorinstelling" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "action": "select.select_option", "metadata": {}, "target": { "entity_id": "select.kerstboom_voorinstelling" }, "data": { "option": "Candle Multi" } } ], "alias": "Kerst aan", "description": "", "icon": "mdi:pine-tree" }, "blueprint_inputs": null, "context": { "id": "01KEYKK9VMDNGNQVAZ33NSRXB6", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "sequence/0", "run_id": "1b258f3b11fed693eb2b6470e84a021f", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T15:57:11.033325+00:00", "finish": "2026-01-14T15:57:11.034030+00:00" }, "domain": "script", "item_id": "kerst_aan" } }, { "extended_dict": { "last_step": "sequence/0", "run_id": "2e47fb6fc9a3d307f17ba779e9eeb26f", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-15T15:58:44.303776+00:00", "finish": "2026-01-15T15:58:44.304620+00:00" }, "domain": "script", "item_id": "kerst_aan", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-15T15:58:44.304108+00:00", "changed_variables": { "this": { "entity_id": "script.kerst_aan", "state": "off", "attributes": { "last_triggered": "2026-01-14T15:57:11.033371+00:00", "mode": "single", "current": 0, "icon": "mdi:pine-tree", "friendly_name": "Kerst aan" }, "last_changed": "2026-01-15T08:03:41.403635+00:00", "last_reported": "2026-01-15T08:03:41.403635+00:00", "last_updated": "2026-01-15T08:03:41.403635+00:00", "context": { "id": "01KF0AX16V5BEDBXVY2W34EWJ6", "parent_id": null, "user_id": null } }, "context": { "id": "01KF162VVWNT6K74NTJCAFW7S0", "parent_id": null, "user_id": null } }, "result": { "params": { "domain": "select", "service": "select_option", "service_data": { "option": "Candle Multi", "entity_id": [ "select.kerstboom_voorinstelling" ] }, "target": { "entity_id": [ "select.kerstboom_voorinstelling" ] } }, "running_script": false } } ] }, "config": { "sequence": [ { "action": "select.select_option", "metadata": {}, "target": { "entity_id": "select.kerstboom_voorinstelling" }, "data": { "option": "Candle Multi" } } ], "alias": "Kerst aan", "description": "", "icon": "mdi:pine-tree" }, "blueprint_inputs": null, "context": { "id": "01KF162VVWNT6K74NTJCAFW7S0", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "sequence/0", "run_id": "2e47fb6fc9a3d307f17ba779e9eeb26f", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-15T15:58:44.303776+00:00", "finish": "2026-01-15T15:58:44.304620+00:00" }, "domain": "script", "item_id": "kerst_aan" } } ], "automation.1761328588298": [ { "extended_dict": { "last_step": "action/0/choose/1/sequence/2", "run_id": "f6b33b672908de8a8325347142d4d435", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-14T05:45:00.122058+00:00", "finish": "2026-01-14T06:00:00.125828+00:00" }, "domain": "automation", "item_id": "1761328588298", "error": "two or more values in the same group of exclusion 'Color descriptors' @ data[]", "trigger": "time set in input_datetime.slaaptrainer_wakkerworden", "trace": { "trigger/1": [ { "path": "trigger/1", "timestamp": "2026-01-14T05:45:00.122089+00:00", "changed_variables": { "this": { "entity_id": "automation.slaap_trainer_tim_bedtijd", "state": "on", "attributes": { "id": "1761328588298", "last_triggered": "2026-01-13T18:00:00.084918+00:00", "mode": "single", "current": 0, "friendly_name": "slaap-trainer tim - bedtijd" }, "last_changed": "2026-01-13T12:10:27.680020+00:00", "last_reported": "2026-01-13T18:00:00.085855+00:00", "last_updated": "2026-01-13T18:00:00.085855+00:00", "context": { "id": "01KEW87FAMB9HMG23BMFYXNBWZ", "parent_id": null, "user_id": null } }, "trigger": { "id": "wakkerworden", "idx": "1", "alias": null, "platform": "time", "now": "2026-01-14T06:45:00.121915+01:00", "description": "time set in input_datetime.slaaptrainer_wakkerworden", "entity_id": "input_datetime.slaaptrainer_wakkerworden" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T05:45:00.122378+00:00", "changed_variables": { "context": { "id": "01KEXGJBYTTT36P34X3CVGJ6R2", "parent_id": null, "user_id": null } }, "error": "two or more values in the same group of exclusion 'Color descriptors' @ data[]", "result": { "choice": 1 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T05:45:00.122437+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T05:45:00.122463+00:00", "result": { "result": false } } ], "action/0/choose/1": [ { "path": "action/0/choose/1", "timestamp": "2026-01-14T05:45:00.122501+00:00", "result": { "result": true } } ], "action/0/choose/1/conditions/0": [ { "path": "action/0/choose/1/conditions/0", "timestamp": "2026-01-14T05:45:00.122518+00:00", "result": { "result": true } } ], "action/0/choose/1/sequence/0": [ { "path": "action/0/choose/1/sequence/0", "timestamp": "2026-01-14T05:45:00.122600+00:00", "result": { "params": { "domain": "light", "service": "turn_on", "service_data": { "effect": "Wipe In-green", "brightness_pct": 19, "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] }, "target": { "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] } }, "running_script": false } } ], "action/0/choose/1/sequence/1": [ { "path": "action/0/choose/1/sequence/1", "timestamp": "2026-01-14T05:45:00.122963+00:00", "result": { "delay": 900.0, "done": true } } ], "action/0/choose/1/sequence/2": [ { "path": "action/0/choose/1/sequence/2", "timestamp": "2026-01-14T06:00:00.124048+00:00", "error": "two or more values in the same group of exclusion 'Color descriptors' @ data[]", "result": { "params": { "domain": "light", "service": "turn_on", "service_data": { "color_name": "green", "brightness_pct": 16, "rgb_color": [ 102, 156, 53 ], "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] }, "target": { "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] } }, "running_script": false } } ] }, "config": { "id": "1761328588298", "alias": "slaap-trainer tim - bedtijd", "description": "", "triggers": [ { "at": "input_datetime.slaaptrainer_bedtijd", "trigger": "time", "id": "bedtijd" }, { "at": "input_datetime.slaaptrainer_wakkerworden", "trigger": "time", "id": "wakkerworden" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "bedtijd" ] } ], "sequence": [ { "target": { "entity_id": "light.slaaptrainer_slaaptrainer_leds" }, "data": { "brightness_pct": 16, "effect": "star-orange" }, "action": "light.turn_on" } ] }, { "conditions": [ { "condition": "trigger", "id": [ "wakkerworden" ] } ], "sequence": [ { "target": { "entity_id": "light.slaaptrainer_slaaptrainer_leds" }, "data": { "effect": "Wipe In-green", "brightness_pct": 19 }, "action": "light.turn_on" }, { "delay": { "hours": 0, "minutes": 15, "seconds": 0, "milliseconds": 0 } }, { "alias": "leds green", "target": { "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] }, "data": { "color_name": "green", "brightness_pct": 16, "rgb_color": [ 102, 156, 53 ] }, "action": "light.turn_on" } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEXGJBYTTT36P34X3CVGJ6R2", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "action/0/choose/1/sequence/2", "run_id": "f6b33b672908de8a8325347142d4d435", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-14T05:45:00.122058+00:00", "finish": "2026-01-14T06:00:00.125828+00:00" }, "domain": "automation", "item_id": "1761328588298", "error": "two or more values in the same group of exclusion 'Color descriptors' @ data[]", "trigger": "time set in input_datetime.slaaptrainer_wakkerworden" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/0", "run_id": "498d9ffc6190cbd20f9ff74661e4b39a", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T18:00:00.127957+00:00", "finish": "2026-01-14T18:00:00.128953+00:00" }, "domain": "automation", "item_id": "1761328588298", "trigger": "time set in input_datetime.slaaptrainer_bedtijd", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T18:00:00.127989+00:00", "changed_variables": { "this": { "entity_id": "automation.slaap_trainer_tim_bedtijd", "state": "on", "attributes": { "id": "1761328588298", "last_triggered": "2026-01-14T05:45:00.122160+00:00", "mode": "single", "current": 0, "friendly_name": "slaap-trainer tim - bedtijd" }, "last_changed": "2026-01-14T15:48:56.987726+00:00", "last_reported": "2026-01-14T15:48:56.987726+00:00", "last_updated": "2026-01-14T15:48:56.987726+00:00", "context": { "id": "01KEYK47GVM9SAZX99CV2C75W1", "parent_id": null, "user_id": null } }, "trigger": { "id": "bedtijd", "idx": "0", "alias": null, "platform": "time", "now": "2026-01-14T19:00:00.127774+01:00", "description": "time set in input_datetime.slaaptrainer_bedtijd", "entity_id": "input_datetime.slaaptrainer_bedtijd" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T18:00:00.128310+00:00", "changed_variables": { "context": { "id": "01KEYTM6BZ7DGBG21T3VTGGDQ0", "parent_id": null, "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T18:00:00.128432+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T18:00:00.128459+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-14T18:00:00.128543+00:00", "result": { "params": { "domain": "light", "service": "turn_on", "service_data": { "brightness_pct": 16, "effect": "star-orange", "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] }, "target": { "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] } }, "running_script": false } } ] }, "config": { "id": "1761328588298", "alias": "slaap-trainer tim - bedtijd", "description": "", "triggers": [ { "at": "input_datetime.slaaptrainer_bedtijd", "trigger": "time", "id": "bedtijd" }, { "at": "input_datetime.slaaptrainer_wakkerworden", "trigger": "time", "id": "wakkerworden" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "bedtijd" ] } ], "sequence": [ { "target": { "entity_id": "light.slaaptrainer_slaaptrainer_leds" }, "data": { "brightness_pct": 16, "effect": "star-orange" }, "action": "light.turn_on" } ] }, { "conditions": [ { "condition": "trigger", "id": [ "wakkerworden" ] } ], "sequence": [ { "target": { "entity_id": "light.slaaptrainer_slaaptrainer_leds" }, "data": { "effect": "Wipe In-green", "brightness_pct": 19 }, "action": "light.turn_on" }, { "delay": { "hours": 0, "minutes": 15, "seconds": 0, "milliseconds": 0 } }, { "alias": "leds green", "target": { "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] }, "data": { "color_name": "green", "brightness_pct": 16, "rgb_color": [ 102, 156, 53 ] }, "action": "light.turn_on" } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEYTM6BZ7DGBG21T3VTGGDQ0", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0", "run_id": "498d9ffc6190cbd20f9ff74661e4b39a", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T18:00:00.127957+00:00", "finish": "2026-01-14T18:00:00.128953+00:00" }, "domain": "automation", "item_id": "1761328588298", "trigger": "time set in input_datetime.slaaptrainer_bedtijd" } }, { "extended_dict": { "last_step": "action/0/choose/1/sequence/2", "run_id": "812ae159c141590d882553fb99e2f638", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-15T05:45:00.188354+00:00", "finish": "2026-01-15T06:00:00.191443+00:00" }, "domain": "automation", "item_id": "1761328588298", "error": "two or more values in the same group of exclusion 'Color descriptors' @ data[]", "trigger": "time set in input_datetime.slaaptrainer_wakkerworden", "trace": { "trigger/1": [ { "path": "trigger/1", "timestamp": "2026-01-15T05:45:00.188379+00:00", "changed_variables": { "this": { "entity_id": "automation.slaap_trainer_tim_bedtijd", "state": "on", "attributes": { "id": "1761328588298", "last_triggered": "2026-01-14T18:00:00.128065+00:00", "mode": "single", "current": 0, "friendly_name": "slaap-trainer tim - bedtijd" }, "last_changed": "2026-01-14T15:48:56.987726+00:00", "last_reported": "2026-01-14T18:00:00.128854+00:00", "last_updated": "2026-01-14T18:00:00.128854+00:00", "context": { "id": "01KEYTM6BZ7DGBG21T3VTGGDQ0", "parent_id": null, "user_id": null } }, "trigger": { "id": "wakkerworden", "idx": "1", "alias": null, "platform": "time", "now": "2026-01-15T06:45:00.188235+01:00", "description": "time set in input_datetime.slaaptrainer_wakkerworden", "entity_id": "input_datetime.slaaptrainer_wakkerworden" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-15T05:45:00.188648+00:00", "changed_variables": { "context": { "id": "01KF02Z30WNDMHPXR78SKFKVAT", "parent_id": null, "user_id": null } }, "error": "two or more values in the same group of exclusion 'Color descriptors' @ data[]", "result": { "choice": 1 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-15T05:45:00.188702+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-15T05:45:00.188729+00:00", "result": { "result": false } } ], "action/0/choose/1": [ { "path": "action/0/choose/1", "timestamp": "2026-01-15T05:45:00.188763+00:00", "result": { "result": true } } ], "action/0/choose/1/conditions/0": [ { "path": "action/0/choose/1/conditions/0", "timestamp": "2026-01-15T05:45:00.188781+00:00", "result": { "result": true } } ], "action/0/choose/1/sequence/0": [ { "path": "action/0/choose/1/sequence/0", "timestamp": "2026-01-15T05:45:00.188862+00:00", "result": { "params": { "domain": "light", "service": "turn_on", "service_data": { "effect": "Wipe In-green", "brightness_pct": 19, "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] }, "target": { "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] } }, "running_script": false } } ], "action/0/choose/1/sequence/1": [ { "path": "action/0/choose/1/sequence/1", "timestamp": "2026-01-15T05:45:00.189131+00:00", "result": { "delay": 900.0, "done": true } } ], "action/0/choose/1/sequence/2": [ { "path": "action/0/choose/1/sequence/2", "timestamp": "2026-01-15T06:00:00.189858+00:00", "error": "two or more values in the same group of exclusion 'Color descriptors' @ data[]", "result": { "params": { "domain": "light", "service": "turn_on", "service_data": { "color_name": "green", "brightness_pct": 16, "rgb_color": [ 102, 156, 53 ], "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] }, "target": { "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] } }, "running_script": false } } ] }, "config": { "id": "1761328588298", "alias": "slaap-trainer tim - bedtijd", "description": "", "triggers": [ { "at": "input_datetime.slaaptrainer_bedtijd", "trigger": "time", "id": "bedtijd" }, { "at": "input_datetime.slaaptrainer_wakkerworden", "trigger": "time", "id": "wakkerworden" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "bedtijd" ] } ], "sequence": [ { "target": { "entity_id": "light.slaaptrainer_slaaptrainer_leds" }, "data": { "brightness_pct": 16, "effect": "star-orange" }, "action": "light.turn_on" } ] }, { "conditions": [ { "condition": "trigger", "id": [ "wakkerworden" ] } ], "sequence": [ { "target": { "entity_id": "light.slaaptrainer_slaaptrainer_leds" }, "data": { "effect": "Wipe In-green", "brightness_pct": 19 }, "action": "light.turn_on" }, { "delay": { "hours": 0, "minutes": 15, "seconds": 0, "milliseconds": 0 } }, { "alias": "leds green", "target": { "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] }, "data": { "color_name": "green", "brightness_pct": 16, "rgb_color": [ 102, 156, 53 ] }, "action": "light.turn_on" } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF02Z30WNDMHPXR78SKFKVAT", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "action/0/choose/1/sequence/2", "run_id": "812ae159c141590d882553fb99e2f638", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-15T05:45:00.188354+00:00", "finish": "2026-01-15T06:00:00.191443+00:00" }, "domain": "automation", "item_id": "1761328588298", "error": "two or more values in the same group of exclusion 'Color descriptors' @ data[]", "trigger": "time set in input_datetime.slaaptrainer_wakkerworden" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/0", "run_id": "421d6a4321c594d760d202bfefde9d46", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-15T18:00:00.074546+00:00", "finish": "2026-01-15T18:00:00.076409+00:00" }, "domain": "automation", "item_id": "1761328588298", "trigger": "time set in input_datetime.slaaptrainer_bedtijd", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-15T18:00:00.074578+00:00", "changed_variables": { "this": { "entity_id": "automation.slaap_trainer_tim_bedtijd", "state": "on", "attributes": { "id": "1761328588298", "last_triggered": "2026-01-15T05:45:00.188447+00:00", "mode": "single", "current": 0, "friendly_name": "slaap-trainer tim - bedtijd" }, "last_changed": "2026-01-15T08:04:17.791567+00:00", "last_reported": "2026-01-15T08:04:17.791567+00:00", "last_updated": "2026-01-15T08:04:17.791567+00:00", "context": { "id": "01KF0AY4QZQZCFFVP0YD26X23M", "parent_id": null, "user_id": null } }, "trigger": { "id": "bedtijd", "idx": "0", "alias": null, "platform": "time", "now": "2026-01-15T19:00:00.074344+01:00", "description": "time set in input_datetime.slaaptrainer_bedtijd", "entity_id": "input_datetime.slaaptrainer_bedtijd" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-15T18:00:00.075079+00:00", "changed_variables": { "context": { "id": "01KF1D0XAAEX307NHAA943T3S0", "parent_id": null, "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-15T18:00:00.075312+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-15T18:00:00.075361+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-15T18:00:00.075519+00:00", "result": { "params": { "domain": "light", "service": "turn_on", "service_data": { "brightness_pct": 16, "effect": "star-orange", "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] }, "target": { "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] } }, "running_script": false } } ] }, "config": { "id": "1761328588298", "alias": "slaap-trainer tim - bedtijd", "description": "", "triggers": [ { "at": "input_datetime.slaaptrainer_bedtijd", "trigger": "time", "id": "bedtijd" }, { "at": "input_datetime.slaaptrainer_wakkerworden", "trigger": "time", "id": "wakkerworden" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "bedtijd" ] } ], "sequence": [ { "target": { "entity_id": "light.slaaptrainer_slaaptrainer_leds" }, "data": { "brightness_pct": 16, "effect": "star-orange" }, "action": "light.turn_on" } ] }, { "conditions": [ { "condition": "trigger", "id": [ "wakkerworden" ] } ], "sequence": [ { "target": { "entity_id": "light.slaaptrainer_slaaptrainer_leds" }, "data": { "effect": "Wipe In-green", "brightness_pct": 19 }, "action": "light.turn_on" }, { "delay": { "hours": 0, "minutes": 15, "seconds": 0, "milliseconds": 0 } }, { "alias": "leds green", "target": { "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] }, "data": { "color_name": "green", "brightness_pct": 16, "rgb_color": [ 102, 156, 53 ] }, "action": "light.turn_on" } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF1D0XAAEX307NHAA943T3S0", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0", "run_id": "421d6a4321c594d760d202bfefde9d46", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-15T18:00:00.074546+00:00", "finish": "2026-01-15T18:00:00.076409+00:00" }, "domain": "automation", "item_id": "1761328588298", "trigger": "time set in input_datetime.slaaptrainer_bedtijd" } }, { "extended_dict": { "last_step": "action/0/choose/1/sequence/2", "run_id": "2871f13614c6d34e92f380981993bcb3", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-16T05:45:00.160732+00:00", "finish": "2026-01-16T06:00:00.163951+00:00" }, "domain": "automation", "item_id": "1761328588298", "error": "two or more values in the same group of exclusion 'Color descriptors' @ data[]", "trigger": "time set in input_datetime.slaaptrainer_wakkerworden", "trace": { "trigger/1": [ { "path": "trigger/1", "timestamp": "2026-01-16T05:45:00.160787+00:00", "changed_variables": { "this": { "entity_id": "automation.slaap_trainer_tim_bedtijd", "state": "on", "attributes": { "id": "1761328588298", "last_triggered": "2026-01-15T18:00:00.074667+00:00", "mode": "single", "current": 0, "friendly_name": "slaap-trainer tim - bedtijd" }, "last_changed": "2026-01-15T08:04:17.791567+00:00", "last_reported": "2026-01-15T18:00:00.076128+00:00", "last_updated": "2026-01-15T18:00:00.076128+00:00", "context": { "id": "01KF1D0XAAEX307NHAA943T3S0", "parent_id": null, "user_id": null } }, "trigger": { "id": "wakkerworden", "idx": "1", "alias": null, "platform": "time", "now": "2026-01-16T06:45:00.160562+01:00", "description": "time set in input_datetime.slaaptrainer_wakkerworden", "entity_id": "input_datetime.slaaptrainer_wakkerworden" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-16T05:45:00.161057+00:00", "changed_variables": { "context": { "id": "01KF2NBT00DR1ZM5CMEXYXBYME", "parent_id": null, "user_id": null } }, "error": "two or more values in the same group of exclusion 'Color descriptors' @ data[]", "result": { "choice": 1 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-16T05:45:00.161123+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-16T05:45:00.161153+00:00", "result": { "result": false } } ], "action/0/choose/1": [ { "path": "action/0/choose/1", "timestamp": "2026-01-16T05:45:00.161205+00:00", "result": { "result": true } } ], "action/0/choose/1/conditions/0": [ { "path": "action/0/choose/1/conditions/0", "timestamp": "2026-01-16T05:45:00.161223+00:00", "result": { "result": true } } ], "action/0/choose/1/sequence/0": [ { "path": "action/0/choose/1/sequence/0", "timestamp": "2026-01-16T05:45:00.161310+00:00", "result": { "params": { "domain": "light", "service": "turn_on", "service_data": { "effect": "Wipe In-green", "brightness_pct": 19, "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] }, "target": { "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] } }, "running_script": false } } ], "action/0/choose/1/sequence/1": [ { "path": "action/0/choose/1/sequence/1", "timestamp": "2026-01-16T05:45:00.161604+00:00", "result": { "delay": 900.0, "done": true } } ], "action/0/choose/1/sequence/2": [ { "path": "action/0/choose/1/sequence/2", "timestamp": "2026-01-16T06:00:00.162319+00:00", "error": "two or more values in the same group of exclusion 'Color descriptors' @ data[]", "result": { "params": { "domain": "light", "service": "turn_on", "service_data": { "color_name": "green", "brightness_pct": 16, "rgb_color": [ 102, 156, 53 ], "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] }, "target": { "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] } }, "running_script": false } } ] }, "config": { "id": "1761328588298", "alias": "slaap-trainer tim - bedtijd", "description": "", "triggers": [ { "at": "input_datetime.slaaptrainer_bedtijd", "trigger": "time", "id": "bedtijd" }, { "at": "input_datetime.slaaptrainer_wakkerworden", "trigger": "time", "id": "wakkerworden" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "bedtijd" ] } ], "sequence": [ { "target": { "entity_id": "light.slaaptrainer_slaaptrainer_leds" }, "data": { "brightness_pct": 16, "effect": "star-orange" }, "action": "light.turn_on" } ] }, { "conditions": [ { "condition": "trigger", "id": [ "wakkerworden" ] } ], "sequence": [ { "target": { "entity_id": "light.slaaptrainer_slaaptrainer_leds" }, "data": { "effect": "Wipe In-green", "brightness_pct": 19 }, "action": "light.turn_on" }, { "delay": { "hours": 0, "minutes": 15, "seconds": 0, "milliseconds": 0 } }, { "alias": "leds green", "target": { "entity_id": [ "light.slaaptrainer_slaaptrainer_leds" ] }, "data": { "color_name": "green", "brightness_pct": 16, "rgb_color": [ 102, 156, 53 ] }, "action": "light.turn_on" } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF2NBT00DR1ZM5CMEXYXBYME", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "action/0/choose/1/sequence/2", "run_id": "2871f13614c6d34e92f380981993bcb3", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-16T05:45:00.160732+00:00", "finish": "2026-01-16T06:00:00.163951+00:00" }, "domain": "automation", "item_id": "1761328588298", "error": "two or more values in the same group of exclusion 'Color descriptors' @ data[]", "trigger": "time set in input_datetime.slaaptrainer_wakkerworden" } } ], "automation.1753967772982": [ { "extended_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "39c4a8cc9f3a7b660d63f9cdf714640c", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T22:44:16.164586+00:00", "finish": "2026-01-13T22:53:24.817506+00:00" }, "domain": "automation", "item_id": "1753967772982", "trigger": "state of binary_sensor.beweging_toilet", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-13T22:44:16.164762+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_toilet", "state": "on", "attributes": { "id": "1753967772982", "last_triggered": "2026-01-12T07:43:56.803103+00:00", "mode": "restart", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Toilet [BP]" }, "last_changed": "2026-01-13T12:10:27.677790+00:00", "last_reported": "2026-01-13T12:10:27.677790+00:00", "last_updated": "2026-01-13T12:10:27.677790+00:00", "context": { "id": "01KEVM7EEXA1VQY9VAF16AQZ2F", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "from_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "unavailable", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-13T12:10:25.730377+00:00", "last_reported": "2026-01-13T12:10:25.730377+00:00", "last_updated": "2026-01-13T12:10:25.730377+00:00", "context": { "id": "01KEVM7CJ22S08MWMZRTVY6CW3", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-13T22:44:16.163104+00:00", "last_reported": "2026-01-13T22:44:16.163104+00:00", "last_updated": "2026-01-13T22:44:16.163104+00:00", "context": { "id": "01KEWRFZN3JTJ83TZCGZEZ2M68", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_toilet" }, "target_entity": "light.lamp_toilet", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.beweging_toilet_timer", "entity_domain": "light", "turn_off_blocker_entity": null, "target_off_entity": null, "sun_condition": "Always" } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-13T22:44:16.164783+00:00", "result": { "result": true, "entities": [ "light.lamp_toilet" ] } } ], "condition/1": [ { "path": "condition/1", "timestamp": "2026-01-13T22:44:16.164928+00:00", "result": { "result": true, "entities": [] } } ], "condition/2": [ { "path": "condition/2", "timestamp": "2026-01-13T22:44:16.164979+00:00", "result": { "result": true, "entities": [] } } ], "condition/3": [ { "path": "condition/3", "timestamp": "2026-01-13T22:44:16.165144+00:00", "result": { "result": true, "entities": [ "sun.sun" ] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-13T22:44:16.165585+00:00", "changed_variables": { "context": { "id": "01KEWRFZN42RBTM16YM63QYZS2", "parent_id": "01KEWRFZN3JTJ83TZCGZEZ2M68", "user_id": null } }, "result": { "params": { "domain": "homeassistant", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "light.lamp_toilet" ] } }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-13T22:44:16.324301+00:00", "changed_variables": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "from_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-13T22:44:16.163104+00:00", "last_reported": "2026-01-13T22:44:16.163104+00:00", "last_updated": "2026-01-13T22:44:16.163104+00:00", "context": { "id": "01KEWRFZN3JTJ83TZCGZEZ2M68", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-13T22:47:24.687440+00:00", "last_reported": "2026-01-13T22:47:24.687440+00:00", "last_updated": "2026-01-13T22:47:24.687440+00:00", "context": { "id": "01KEWRNQRFFDWGDQTGRK75EEDS", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_toilet" } } }, "result": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "from_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-13T22:44:16.163104+00:00", "last_reported": "2026-01-13T22:44:16.163104+00:00", "last_updated": "2026-01-13T22:44:16.163104+00:00", "context": { "id": "01KEWRFZN3JTJ83TZCGZEZ2M68", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-13T22:47:24.687440+00:00", "last_reported": "2026-01-13T22:47:24.687440+00:00", "last_updated": "2026-01-13T22:47:24.687440+00:00", "context": { "id": "01KEWRNQRFFDWGDQTGRK75EEDS", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_toilet" } } } } ], "action/2": [ { "path": "action/2", "timestamp": "2026-01-13T22:47:24.688066+00:00", "result": { "choice": 2 } } ], "action/2/choose/0": [ { "path": "action/2/choose/0", "timestamp": "2026-01-13T22:47:24.688278+00:00", "result": { "result": false } } ], "action/2/choose/0/conditions/0": [ { "path": "action/2/choose/0/conditions/0", "timestamp": "2026-01-13T22:47:24.688368+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/1": [ { "path": "action/2/choose/1", "timestamp": "2026-01-13T22:47:24.688638+00:00", "result": { "result": false } } ], "action/2/choose/1/conditions/0": [ { "path": "action/2/choose/1/conditions/0", "timestamp": "2026-01-13T22:47:24.688734+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/2": [ { "path": "action/2/choose/2", "timestamp": "2026-01-13T22:47:24.688892+00:00", "result": { "result": true } } ], "action/2/choose/2/conditions/0": [ { "path": "action/2/choose/2/conditions/0", "timestamp": "2026-01-13T22:47:24.688930+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/0": [ { "path": "action/2/choose/2/sequence/0", "timestamp": "2026-01-13T22:47:24.689199+00:00", "result": { "delay": 360.0, "done": true } } ], "action/2/choose/2/sequence/1": [ { "path": "action/2/choose/2/sequence/1", "timestamp": "2026-01-13T22:53:24.690009+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/2": [ { "path": "action/2/choose/2/sequence/2", "timestamp": "2026-01-13T22:53:24.690258+00:00", "result": { "params": { "domain": "homeassistant", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.lamp_toilet" ] } }, "running_script": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "target_entity": "light.lamp_toilet", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.beweging_toilet_timer", "entity_domain": "{{ states[target_entity].domain }}", "turn_off_blocker_entity": null, "target_off_entity": null, "sun_condition": "Always" }, "triggers": { "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "to": "on" }, "actions": [ { "entity_id": "light.lamp_toilet", "action": "homeassistant.turn_on" }, { "wait_for_trigger": { "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "from": "on", "to": "off" } }, { "choose": [ { "alias": "Motion wait not defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity == none }}" } ], "sequence": [ { "entity_id": "light.lamp_toilet", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait not defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity != none }}" } ], "sequence": [ { "entity_id": null, "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity == none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": "light.lamp_toilet", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity != none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": null, "action": "homeassistant.turn_off" } ] } ] } ], "conditions": [ { "condition": "template", "alias": "Check for illuminance conditions", "value_template": "{% set illuminance_defined = illuminance_currently != none and illuminance_cutoff != none %} {% set illuminance_defined_and_low = (illuminance_defined and (states(illuminance_currently) | int(0) < states(illuminance_cutoff) | int(0))) %}\n{% set target_entity_domain_supports_on_state_check = entity_domain != 'scene' and entity_domain != 'script' %} {% set target_entity_is_scene = entity_domain == 'scene' %} {% set scene_target_entities = state_attr(target_entity, 'entity_id') %} {% set singular_scene_entity_is_on = scene_target_entities is not none and scene_target_entities | count == 1 and scene_target_entities | first == 'on' %} {{ ( target_entity_domain_supports_on_state_check and states(target_entity) == 'on') or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and not illuminance_defined) or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and not illuminance_defined) or ( target_entity_is_scene and singular_scene_entity_is_on) }}\n" }, { "condition": "template", "alias": "Check for blocker entity", "value_template": "{{ (blocker_entity == none) or (states(blocker_entity) == 'off') }}" }, { "condition": "template", "alias": "Check for time limits", "value_template": "{% set current_time = now().strftime(\"%H:%M\") %}\n{% if time_limit_before == none and time_limit_after == none %} true {% endif %}\n{% if time_limit_before != none and time_limit_after == none %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {{ current_time_is_before_limit }} {% elif time_limit_before == none and time_limit_after != none %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {{ current_time_is_after_limit }} {% endif %}\n{% if time_limit_before != none and time_limit_after != none %} {% set before_limit_is_tomorrow = states(time_limit_before) < states(time_limit_after) %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {% set time_window_spans_midnight = states(time_limit_after) > states(time_limit_before) %}\n {% if time_window_spans_midnight != none and time_window_spans_midnight and before_limit_is_tomorrow %}\n {{ current_time_is_after_limit or current_time_is_before_limit }}\n {% elif time_window_spans_midnight != none and not time_window_spans_midnight %}\n {{ current_time_is_before_limit and current_time_is_after_limit }}\n {% endif %}\n{% endif %}\n" }, { "condition": "template", "alias": "Check for sun state", "value_template": "{# Prevent breaking when no sun condition is set in existing automations #} {% if not sun_condition is defined %} {% set sun_condition = 'Always' %} {% endif %} {# Get current sun state #} {% set current_sun_condition = states['sun.sun'].state %}\n{# Checks for current sun state #} {% set sun_state_is_below_horizon = current_sun_condition == 'below_horizon' %} {% set sun_state_is_above_horizon = current_sun_condition == 'above_horizon' %}\n{# Check to see if a condition for sunstate is set by user #} {% set no_sun_condition = sun_condition is defined and sun_condition == 'Always' %} {# Check to see if the user wants automation to trigger below horizon #} {% set sun_condition_is_below_horizon = sun_condition == 'Below horizon' %} {# Check to see if the user wants automation to trigger above horizon #} {% set sun_condition_is_above_horizon = sun_condition == 'Above horizon' %}\n{# Checks to see if sunstate matches up with users condition #} {% set sun_condition_below_horizon_match = sun_state_is_below_horizon and sun_condition_is_below_horizon %} {% set sun_condition_above_horizon_match = sun_state_is_above_horizon and sun_condition_is_above_horizon %} {% set sun_condition_matching = sun_condition_below_horizon_match or sun_condition_above_horizon_match or no_sun_condition %} {{ sun_condition_matching }}\n{# Debug values: (uncomment to check in template dev tool) ## Set at top of template: {% set sun_condition = 'Above horizon' %} Current sun condition: {{current_sun_condition}} Sun state is below horizon: {{ sun_state_is_below_horizon }} Sun state is above horizon: {{ sun_state_is_above_horizon }} Sun condition is set to always: {{ sun_condition_always }} Sun condition is below horizon: {{ sun_condition_is_below_horizon }} Sun condition is above horizon: {{ sun_condition_is_above_horizon }} Sun condition is below horizon match: {{ sun_condition_below_horizon_match }} Sun condition is above horizon match: {{ sun_condition_above_horizon_match }} Sun condition is a match: {{ sun_condition_matching }} #}\n" } ], "id": "1753967772982", "alias": "Beweging toilet", "description": "" }, "blueprint_inputs": { "id": "1753967772982", "alias": "Beweging toilet", "description": "", "use_blueprint": { "path": "freakshock88/motion_illuminance_activated_entity.yaml", "input": { "motion_sensor": "binary_sensor.beweging_toilet", "target_entity": "light.lamp_toilet", "no_motion_wait": "input_number.beweging_toilet_timer" } } }, "context": { "id": "01KEWRFZN42RBTM16YM63QYZS2", "parent_id": "01KEWRFZN3JTJ83TZCGZEZ2M68", "user_id": null } }, "short_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "39c4a8cc9f3a7b660d63f9cdf714640c", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T22:44:16.164586+00:00", "finish": "2026-01-13T22:53:24.817506+00:00" }, "domain": "automation", "item_id": "1753967772982", "trigger": "state of binary_sensor.beweging_toilet" } }, { "extended_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "42c6e20acd7b290bf7493502f0202d1c", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T08:23:14.471439+00:00", "finish": "2026-01-14T08:41:08.479320+00:00" }, "domain": "automation", "item_id": "1753967772982", "trigger": "state of binary_sensor.beweging_toilet", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T08:23:14.471579+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_toilet", "state": "on", "attributes": { "id": "1753967772982", "last_triggered": "2026-01-13T22:44:16.165351+00:00", "mode": "restart", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Toilet [BP]" }, "last_changed": "2026-01-13T12:10:27.677790+00:00", "last_reported": "2026-01-13T22:53:24.816939+00:00", "last_updated": "2026-01-13T22:53:24.816939+00:00", "context": { "id": "01KEWS0QEG199WVTY5ZSSYBWT0", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "from_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "unavailable", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-14T04:48:58.187114+00:00", "last_reported": "2026-01-14T04:48:58.187114+00:00", "last_updated": "2026-01-14T04:48:58.187114+00:00", "context": { "id": "01KEXDBRTB55GEJ9BP8NZ9PJ7A", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-14T08:23:14.469946+00:00", "last_reported": "2026-01-14T08:23:14.469946+00:00", "last_updated": "2026-01-14T08:23:14.469946+00:00", "context": { "id": "01KEXSM3S5CRYTV9YSEYTHJF0E", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_toilet" }, "target_entity": "light.lamp_toilet", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.beweging_toilet_timer", "entity_domain": "light", "turn_off_blocker_entity": null, "target_off_entity": null, "sun_condition": "Always" } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T08:23:14.471600+00:00", "result": { "result": true, "entities": [ "light.lamp_toilet" ] } } ], "condition/1": [ { "path": "condition/1", "timestamp": "2026-01-14T08:23:14.471691+00:00", "result": { "result": true, "entities": [] } } ], "condition/2": [ { "path": "condition/2", "timestamp": "2026-01-14T08:23:14.471732+00:00", "result": { "result": true, "entities": [] } } ], "condition/3": [ { "path": "condition/3", "timestamp": "2026-01-14T08:23:14.471817+00:00", "result": { "result": true, "entities": [ "sun.sun" ] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T08:23:14.472054+00:00", "changed_variables": { "context": { "id": "01KEXSM3S7ZFTKM771W2FXY6CT", "parent_id": "01KEXSM3S5CRYTV9YSEYTHJF0E", "user_id": null } }, "result": { "params": { "domain": "homeassistant", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "light.lamp_toilet" ] } }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-14T08:23:14.652065+00:00", "changed_variables": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "from_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-14T08:23:14.469946+00:00", "last_reported": "2026-01-14T08:23:14.469946+00:00", "last_updated": "2026-01-14T08:23:14.469946+00:00", "context": { "id": "01KEXSM3S5CRYTV9YSEYTHJF0E", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-14T08:35:08.336624+00:00", "last_reported": "2026-01-14T08:35:08.336624+00:00", "last_updated": "2026-01-14T08:35:08.336624+00:00", "context": { "id": "01KEXT9WXGA1NHTGEDKHSA2ADD", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_toilet" } } }, "result": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "from_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-14T08:23:14.469946+00:00", "last_reported": "2026-01-14T08:23:14.469946+00:00", "last_updated": "2026-01-14T08:23:14.469946+00:00", "context": { "id": "01KEXSM3S5CRYTV9YSEYTHJF0E", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-14T08:35:08.336624+00:00", "last_reported": "2026-01-14T08:35:08.336624+00:00", "last_updated": "2026-01-14T08:35:08.336624+00:00", "context": { "id": "01KEXT9WXGA1NHTGEDKHSA2ADD", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_toilet" } } } } ], "action/2": [ { "path": "action/2", "timestamp": "2026-01-14T08:35:08.337729+00:00", "result": { "choice": 2 } } ], "action/2/choose/0": [ { "path": "action/2/choose/0", "timestamp": "2026-01-14T08:35:08.337821+00:00", "result": { "result": false } } ], "action/2/choose/0/conditions/0": [ { "path": "action/2/choose/0/conditions/0", "timestamp": "2026-01-14T08:35:08.337959+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/1": [ { "path": "action/2/choose/1", "timestamp": "2026-01-14T08:35:08.338199+00:00", "result": { "result": false } } ], "action/2/choose/1/conditions/0": [ { "path": "action/2/choose/1/conditions/0", "timestamp": "2026-01-14T08:35:08.338250+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/2": [ { "path": "action/2/choose/2", "timestamp": "2026-01-14T08:35:08.338344+00:00", "result": { "result": true } } ], "action/2/choose/2/conditions/0": [ { "path": "action/2/choose/2/conditions/0", "timestamp": "2026-01-14T08:35:08.338379+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/0": [ { "path": "action/2/choose/2/sequence/0", "timestamp": "2026-01-14T08:35:08.338541+00:00", "result": { "delay": 360.0, "done": true } } ], "action/2/choose/2/sequence/1": [ { "path": "action/2/choose/2/sequence/1", "timestamp": "2026-01-14T08:41:08.339293+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/2": [ { "path": "action/2/choose/2/sequence/2", "timestamp": "2026-01-14T08:41:08.339509+00:00", "result": { "params": { "domain": "homeassistant", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.lamp_toilet" ] } }, "running_script": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "target_entity": "light.lamp_toilet", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.beweging_toilet_timer", "entity_domain": "{{ states[target_entity].domain }}", "turn_off_blocker_entity": null, "target_off_entity": null, "sun_condition": "Always" }, "triggers": { "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "to": "on" }, "actions": [ { "entity_id": "light.lamp_toilet", "action": "homeassistant.turn_on" }, { "wait_for_trigger": { "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "from": "on", "to": "off" } }, { "choose": [ { "alias": "Motion wait not defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity == none }}" } ], "sequence": [ { "entity_id": "light.lamp_toilet", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait not defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity != none }}" } ], "sequence": [ { "entity_id": null, "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity == none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": "light.lamp_toilet", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity != none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": null, "action": "homeassistant.turn_off" } ] } ] } ], "conditions": [ { "condition": "template", "alias": "Check for illuminance conditions", "value_template": "{% set illuminance_defined = illuminance_currently != none and illuminance_cutoff != none %} {% set illuminance_defined_and_low = (illuminance_defined and (states(illuminance_currently) | int(0) < states(illuminance_cutoff) | int(0))) %}\n{% set target_entity_domain_supports_on_state_check = entity_domain != 'scene' and entity_domain != 'script' %} {% set target_entity_is_scene = entity_domain == 'scene' %} {% set scene_target_entities = state_attr(target_entity, 'entity_id') %} {% set singular_scene_entity_is_on = scene_target_entities is not none and scene_target_entities | count == 1 and scene_target_entities | first == 'on' %} {{ ( target_entity_domain_supports_on_state_check and states(target_entity) == 'on') or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and not illuminance_defined) or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and not illuminance_defined) or ( target_entity_is_scene and singular_scene_entity_is_on) }}\n" }, { "condition": "template", "alias": "Check for blocker entity", "value_template": "{{ (blocker_entity == none) or (states(blocker_entity) == 'off') }}" }, { "condition": "template", "alias": "Check for time limits", "value_template": "{% set current_time = now().strftime(\"%H:%M\") %}\n{% if time_limit_before == none and time_limit_after == none %} true {% endif %}\n{% if time_limit_before != none and time_limit_after == none %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {{ current_time_is_before_limit }} {% elif time_limit_before == none and time_limit_after != none %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {{ current_time_is_after_limit }} {% endif %}\n{% if time_limit_before != none and time_limit_after != none %} {% set before_limit_is_tomorrow = states(time_limit_before) < states(time_limit_after) %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {% set time_window_spans_midnight = states(time_limit_after) > states(time_limit_before) %}\n {% if time_window_spans_midnight != none and time_window_spans_midnight and before_limit_is_tomorrow %}\n {{ current_time_is_after_limit or current_time_is_before_limit }}\n {% elif time_window_spans_midnight != none and not time_window_spans_midnight %}\n {{ current_time_is_before_limit and current_time_is_after_limit }}\n {% endif %}\n{% endif %}\n" }, { "condition": "template", "alias": "Check for sun state", "value_template": "{# Prevent breaking when no sun condition is set in existing automations #} {% if not sun_condition is defined %} {% set sun_condition = 'Always' %} {% endif %} {# Get current sun state #} {% set current_sun_condition = states['sun.sun'].state %}\n{# Checks for current sun state #} {% set sun_state_is_below_horizon = current_sun_condition == 'below_horizon' %} {% set sun_state_is_above_horizon = current_sun_condition == 'above_horizon' %}\n{# Check to see if a condition for sunstate is set by user #} {% set no_sun_condition = sun_condition is defined and sun_condition == 'Always' %} {# Check to see if the user wants automation to trigger below horizon #} {% set sun_condition_is_below_horizon = sun_condition == 'Below horizon' %} {# Check to see if the user wants automation to trigger above horizon #} {% set sun_condition_is_above_horizon = sun_condition == 'Above horizon' %}\n{# Checks to see if sunstate matches up with users condition #} {% set sun_condition_below_horizon_match = sun_state_is_below_horizon and sun_condition_is_below_horizon %} {% set sun_condition_above_horizon_match = sun_state_is_above_horizon and sun_condition_is_above_horizon %} {% set sun_condition_matching = sun_condition_below_horizon_match or sun_condition_above_horizon_match or no_sun_condition %} {{ sun_condition_matching }}\n{# Debug values: (uncomment to check in template dev tool) ## Set at top of template: {% set sun_condition = 'Above horizon' %} Current sun condition: {{current_sun_condition}} Sun state is below horizon: {{ sun_state_is_below_horizon }} Sun state is above horizon: {{ sun_state_is_above_horizon }} Sun condition is set to always: {{ sun_condition_always }} Sun condition is below horizon: {{ sun_condition_is_below_horizon }} Sun condition is above horizon: {{ sun_condition_is_above_horizon }} Sun condition is below horizon match: {{ sun_condition_below_horizon_match }} Sun condition is above horizon match: {{ sun_condition_above_horizon_match }} Sun condition is a match: {{ sun_condition_matching }} #}\n" } ], "id": "1753967772982", "alias": "Beweging toilet", "description": "" }, "blueprint_inputs": { "id": "1753967772982", "alias": "Beweging toilet", "description": "", "use_blueprint": { "path": "freakshock88/motion_illuminance_activated_entity.yaml", "input": { "motion_sensor": "binary_sensor.beweging_toilet", "target_entity": "light.lamp_toilet", "no_motion_wait": "input_number.beweging_toilet_timer" } } }, "context": { "id": "01KEXSM3S7ZFTKM771W2FXY6CT", "parent_id": "01KEXSM3S5CRYTV9YSEYTHJF0E", "user_id": null } }, "short_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "42c6e20acd7b290bf7493502f0202d1c", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T08:23:14.471439+00:00", "finish": "2026-01-14T08:41:08.479320+00:00" }, "domain": "automation", "item_id": "1753967772982", "trigger": "state of binary_sensor.beweging_toilet" } }, { "extended_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "a7c9fbdcb6b82c44317822e80e722ad5", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T12:38:03.522180+00:00", "finish": "2026-01-14T12:47:35.632899+00:00" }, "domain": "automation", "item_id": "1753967772982", "trigger": "state of binary_sensor.beweging_toilet", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T12:38:03.522331+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_toilet", "state": "on", "attributes": { "id": "1753967772982", "last_triggered": "2026-01-14T08:23:14.471924+00:00", "mode": "restart", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Toilet [BP]" }, "last_changed": "2026-01-13T12:10:27.677790+00:00", "last_reported": "2026-01-14T08:41:08.478524+00:00", "last_updated": "2026-01-14T08:41:08.478524+00:00", "context": { "id": "01KEXTMWKY9A8BART5PSWHVWSV", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "from_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-14T08:35:08.336624+00:00", "last_reported": "2026-01-14T08:35:08.336624+00:00", "last_updated": "2026-01-14T08:35:08.336624+00:00", "context": { "id": "01KEXT9WXGA1NHTGEDKHSA2ADD", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-14T12:38:03.521403+00:00", "last_reported": "2026-01-14T12:38:03.521403+00:00", "last_updated": "2026-01-14T12:38:03.521403+00:00", "context": { "id": "01KEY86PG11KEE761PS56KSMEF", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_toilet" }, "target_entity": "light.lamp_toilet", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.beweging_toilet_timer", "entity_domain": "light", "turn_off_blocker_entity": null, "target_off_entity": null, "sun_condition": "Always" } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T12:38:03.522352+00:00", "result": { "result": true, "entities": [ "light.lamp_toilet" ] } } ], "condition/1": [ { "path": "condition/1", "timestamp": "2026-01-14T12:38:03.522447+00:00", "result": { "result": true, "entities": [] } } ], "condition/2": [ { "path": "condition/2", "timestamp": "2026-01-14T12:38:03.522489+00:00", "result": { "result": true, "entities": [] } } ], "condition/3": [ { "path": "condition/3", "timestamp": "2026-01-14T12:38:03.522578+00:00", "result": { "result": true, "entities": [ "sun.sun" ] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T12:38:03.522821+00:00", "changed_variables": { "context": { "id": "01KEY86PG2EJGNJYZRCAN02C2B", "parent_id": "01KEY86PG11KEE761PS56KSMEF", "user_id": null } }, "result": { "params": { "domain": "homeassistant", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "light.lamp_toilet" ] } }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-14T12:38:03.669119+00:00", "changed_variables": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "from_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-14T12:38:03.521403+00:00", "last_reported": "2026-01-14T12:38:03.521403+00:00", "last_updated": "2026-01-14T12:38:03.521403+00:00", "context": { "id": "01KEY86PG11KEE761PS56KSMEF", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-14T12:41:35.483847+00:00", "last_reported": "2026-01-14T12:41:35.483847+00:00", "last_updated": "2026-01-14T12:41:35.483847+00:00", "context": { "id": "01KEY8D5FVPQ28J1XHY03QMWXM", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_toilet" } } }, "result": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "from_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-14T12:38:03.521403+00:00", "last_reported": "2026-01-14T12:38:03.521403+00:00", "last_updated": "2026-01-14T12:38:03.521403+00:00", "context": { "id": "01KEY86PG11KEE761PS56KSMEF", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-14T12:41:35.483847+00:00", "last_reported": "2026-01-14T12:41:35.483847+00:00", "last_updated": "2026-01-14T12:41:35.483847+00:00", "context": { "id": "01KEY8D5FVPQ28J1XHY03QMWXM", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_toilet" } } } } ], "action/2": [ { "path": "action/2", "timestamp": "2026-01-14T12:41:35.484848+00:00", "result": { "choice": 2 } } ], "action/2/choose/0": [ { "path": "action/2/choose/0", "timestamp": "2026-01-14T12:41:35.485012+00:00", "result": { "result": false } } ], "action/2/choose/0/conditions/0": [ { "path": "action/2/choose/0/conditions/0", "timestamp": "2026-01-14T12:41:35.485096+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/1": [ { "path": "action/2/choose/1", "timestamp": "2026-01-14T12:41:35.485304+00:00", "result": { "result": false } } ], "action/2/choose/1/conditions/0": [ { "path": "action/2/choose/1/conditions/0", "timestamp": "2026-01-14T12:41:35.485352+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/2": [ { "path": "action/2/choose/2", "timestamp": "2026-01-14T12:41:35.485442+00:00", "result": { "result": true } } ], "action/2/choose/2/conditions/0": [ { "path": "action/2/choose/2/conditions/0", "timestamp": "2026-01-14T12:41:35.485477+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/0": [ { "path": "action/2/choose/2/sequence/0", "timestamp": "2026-01-14T12:41:35.485637+00:00", "result": { "delay": 360.0, "done": true } } ], "action/2/choose/2/sequence/1": [ { "path": "action/2/choose/2/sequence/1", "timestamp": "2026-01-14T12:47:35.486387+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/2": [ { "path": "action/2/choose/2/sequence/2", "timestamp": "2026-01-14T12:47:35.486677+00:00", "result": { "params": { "domain": "homeassistant", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.lamp_toilet" ] } }, "running_script": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "target_entity": "light.lamp_toilet", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.beweging_toilet_timer", "entity_domain": "{{ states[target_entity].domain }}", "turn_off_blocker_entity": null, "target_off_entity": null, "sun_condition": "Always" }, "triggers": { "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "to": "on" }, "actions": [ { "entity_id": "light.lamp_toilet", "action": "homeassistant.turn_on" }, { "wait_for_trigger": { "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "from": "on", "to": "off" } }, { "choose": [ { "alias": "Motion wait not defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity == none }}" } ], "sequence": [ { "entity_id": "light.lamp_toilet", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait not defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity != none }}" } ], "sequence": [ { "entity_id": null, "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity == none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": "light.lamp_toilet", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity != none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": null, "action": "homeassistant.turn_off" } ] } ] } ], "conditions": [ { "condition": "template", "alias": "Check for illuminance conditions", "value_template": "{% set illuminance_defined = illuminance_currently != none and illuminance_cutoff != none %} {% set illuminance_defined_and_low = (illuminance_defined and (states(illuminance_currently) | int(0) < states(illuminance_cutoff) | int(0))) %}\n{% set target_entity_domain_supports_on_state_check = entity_domain != 'scene' and entity_domain != 'script' %} {% set target_entity_is_scene = entity_domain == 'scene' %} {% set scene_target_entities = state_attr(target_entity, 'entity_id') %} {% set singular_scene_entity_is_on = scene_target_entities is not none and scene_target_entities | count == 1 and scene_target_entities | first == 'on' %} {{ ( target_entity_domain_supports_on_state_check and states(target_entity) == 'on') or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and not illuminance_defined) or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and not illuminance_defined) or ( target_entity_is_scene and singular_scene_entity_is_on) }}\n" }, { "condition": "template", "alias": "Check for blocker entity", "value_template": "{{ (blocker_entity == none) or (states(blocker_entity) == 'off') }}" }, { "condition": "template", "alias": "Check for time limits", "value_template": "{% set current_time = now().strftime(\"%H:%M\") %}\n{% if time_limit_before == none and time_limit_after == none %} true {% endif %}\n{% if time_limit_before != none and time_limit_after == none %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {{ current_time_is_before_limit }} {% elif time_limit_before == none and time_limit_after != none %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {{ current_time_is_after_limit }} {% endif %}\n{% if time_limit_before != none and time_limit_after != none %} {% set before_limit_is_tomorrow = states(time_limit_before) < states(time_limit_after) %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {% set time_window_spans_midnight = states(time_limit_after) > states(time_limit_before) %}\n {% if time_window_spans_midnight != none and time_window_spans_midnight and before_limit_is_tomorrow %}\n {{ current_time_is_after_limit or current_time_is_before_limit }}\n {% elif time_window_spans_midnight != none and not time_window_spans_midnight %}\n {{ current_time_is_before_limit and current_time_is_after_limit }}\n {% endif %}\n{% endif %}\n" }, { "condition": "template", "alias": "Check for sun state", "value_template": "{# Prevent breaking when no sun condition is set in existing automations #} {% if not sun_condition is defined %} {% set sun_condition = 'Always' %} {% endif %} {# Get current sun state #} {% set current_sun_condition = states['sun.sun'].state %}\n{# Checks for current sun state #} {% set sun_state_is_below_horizon = current_sun_condition == 'below_horizon' %} {% set sun_state_is_above_horizon = current_sun_condition == 'above_horizon' %}\n{# Check to see if a condition for sunstate is set by user #} {% set no_sun_condition = sun_condition is defined and sun_condition == 'Always' %} {# Check to see if the user wants automation to trigger below horizon #} {% set sun_condition_is_below_horizon = sun_condition == 'Below horizon' %} {# Check to see if the user wants automation to trigger above horizon #} {% set sun_condition_is_above_horizon = sun_condition == 'Above horizon' %}\n{# Checks to see if sunstate matches up with users condition #} {% set sun_condition_below_horizon_match = sun_state_is_below_horizon and sun_condition_is_below_horizon %} {% set sun_condition_above_horizon_match = sun_state_is_above_horizon and sun_condition_is_above_horizon %} {% set sun_condition_matching = sun_condition_below_horizon_match or sun_condition_above_horizon_match or no_sun_condition %} {{ sun_condition_matching }}\n{# Debug values: (uncomment to check in template dev tool) ## Set at top of template: {% set sun_condition = 'Above horizon' %} Current sun condition: {{current_sun_condition}} Sun state is below horizon: {{ sun_state_is_below_horizon }} Sun state is above horizon: {{ sun_state_is_above_horizon }} Sun condition is set to always: {{ sun_condition_always }} Sun condition is below horizon: {{ sun_condition_is_below_horizon }} Sun condition is above horizon: {{ sun_condition_is_above_horizon }} Sun condition is below horizon match: {{ sun_condition_below_horizon_match }} Sun condition is above horizon match: {{ sun_condition_above_horizon_match }} Sun condition is a match: {{ sun_condition_matching }} #}\n" } ], "id": "1753967772982", "alias": "Beweging toilet", "description": "" }, "blueprint_inputs": { "id": "1753967772982", "alias": "Beweging toilet", "description": "", "use_blueprint": { "path": "freakshock88/motion_illuminance_activated_entity.yaml", "input": { "motion_sensor": "binary_sensor.beweging_toilet", "target_entity": "light.lamp_toilet", "no_motion_wait": "input_number.beweging_toilet_timer" } } }, "context": { "id": "01KEY86PG2EJGNJYZRCAN02C2B", "parent_id": "01KEY86PG11KEE761PS56KSMEF", "user_id": null } }, "short_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "a7c9fbdcb6b82c44317822e80e722ad5", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T12:38:03.522180+00:00", "finish": "2026-01-14T12:47:35.632899+00:00" }, "domain": "automation", "item_id": "1753967772982", "trigger": "state of binary_sensor.beweging_toilet" } }, { "extended_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "e9ba4362b3ff496b0a79b2ff60664080", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T09:07:33.571177+00:00", "finish": "2026-01-16T09:23:26.004340+00:00" }, "domain": "automation", "item_id": "1753967772982", "trigger": "state of binary_sensor.beweging_toilet", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-16T09:07:33.573958+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_toilet", "state": "on", "attributes": { "id": "1753967772982", "last_triggered": "2026-01-14T12:38:03.522683+00:00", "mode": "restart", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Toilet [BP]" }, "last_changed": "2026-01-15T08:04:17.789165+00:00", "last_reported": "2026-01-15T08:04:17.789165+00:00", "last_updated": "2026-01-15T08:04:17.789165+00:00", "context": { "id": "01KF0AY4QXCJMRHSR2ASY4HVNZ", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "from_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "unavailable", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-15T08:04:16.907879+00:00", "last_reported": "2026-01-16T08:59:38.335633+00:00", "last_updated": "2026-01-16T08:59:38.335633+00:00", "context": { "id": "01KF30G6EZNSCM4YWDPZ72FQRC", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-16T09:07:33.569684+00:00", "last_reported": "2026-01-16T09:07:33.569684+00:00", "last_updated": "2026-01-16T09:07:33.569684+00:00", "context": { "id": "01KF30YPJ1SS2G6NMRTHAKQJSP", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_toilet" }, "target_entity": "light.lamp_toilet", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.beweging_toilet_timer", "entity_domain": "light", "turn_off_blocker_entity": null, "target_off_entity": null, "sun_condition": "Always" } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-16T09:07:33.573979+00:00", "result": { "result": true, "entities": [ "light.lamp_toilet" ] } } ], "condition/1": [ { "path": "condition/1", "timestamp": "2026-01-16T09:07:33.574097+00:00", "result": { "result": true, "entities": [] } } ], "condition/2": [ { "path": "condition/2", "timestamp": "2026-01-16T09:07:33.574150+00:00", "result": { "result": true, "entities": [] } } ], "condition/3": [ { "path": "condition/3", "timestamp": "2026-01-16T09:07:33.574469+00:00", "result": { "result": true, "entities": [ "sun.sun" ] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-16T09:07:33.574779+00:00", "changed_variables": { "context": { "id": "01KF30YPJ3QG52AKXFMR8VBK4W", "parent_id": "01KF30YPJ1SS2G6NMRTHAKQJSP", "user_id": null } }, "result": { "params": { "domain": "homeassistant", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "light.lamp_toilet" ] } }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-16T09:07:33.887586+00:00", "changed_variables": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "from_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-16T09:07:33.569684+00:00", "last_reported": "2026-01-16T09:07:33.569684+00:00", "last_updated": "2026-01-16T09:07:33.569684+00:00", "context": { "id": "01KF30YPJ1SS2G6NMRTHAKQJSP", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-16T09:17:25.867497+00:00", "last_reported": "2026-01-16T09:17:25.867497+00:00", "last_updated": "2026-01-16T09:17:25.867497+00:00", "context": { "id": "01KF31GRZBD6TGDMNDHKF84YVQ", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_toilet" } } }, "result": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "from_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-16T09:07:33.569684+00:00", "last_reported": "2026-01-16T09:07:33.569684+00:00", "last_updated": "2026-01-16T09:07:33.569684+00:00", "context": { "id": "01KF30YPJ1SS2G6NMRTHAKQJSP", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.beweging_toilet", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging toilet" }, "last_changed": "2026-01-16T09:17:25.867497+00:00", "last_reported": "2026-01-16T09:17:25.867497+00:00", "last_updated": "2026-01-16T09:17:25.867497+00:00", "context": { "id": "01KF31GRZBD6TGDMNDHKF84YVQ", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.beweging_toilet" } } } } ], "action/2": [ { "path": "action/2", "timestamp": "2026-01-16T09:17:25.868628+00:00", "result": { "choice": 2 } } ], "action/2/choose/0": [ { "path": "action/2/choose/0", "timestamp": "2026-01-16T09:17:25.868857+00:00", "result": { "result": false } } ], "action/2/choose/0/conditions/0": [ { "path": "action/2/choose/0/conditions/0", "timestamp": "2026-01-16T09:17:25.868903+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/1": [ { "path": "action/2/choose/1", "timestamp": "2026-01-16T09:17:25.869039+00:00", "result": { "result": false } } ], "action/2/choose/1/conditions/0": [ { "path": "action/2/choose/1/conditions/0", "timestamp": "2026-01-16T09:17:25.869076+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/2": [ { "path": "action/2/choose/2", "timestamp": "2026-01-16T09:17:25.869166+00:00", "result": { "result": true } } ], "action/2/choose/2/conditions/0": [ { "path": "action/2/choose/2/conditions/0", "timestamp": "2026-01-16T09:17:25.869211+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/0": [ { "path": "action/2/choose/2/sequence/0", "timestamp": "2026-01-16T09:17:25.869374+00:00", "result": { "delay": 360.0, "done": true } } ], "action/2/choose/2/sequence/1": [ { "path": "action/2/choose/2/sequence/1", "timestamp": "2026-01-16T09:23:25.870566+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/2": [ { "path": "action/2/choose/2/sequence/2", "timestamp": "2026-01-16T09:23:25.870797+00:00", "result": { "params": { "domain": "homeassistant", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.lamp_toilet" ] } }, "running_script": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "target_entity": "light.lamp_toilet", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.beweging_toilet_timer", "entity_domain": "{{ states[target_entity].domain }}", "turn_off_blocker_entity": null, "target_off_entity": null, "sun_condition": "Always" }, "triggers": { "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "to": "on" }, "actions": [ { "entity_id": "light.lamp_toilet", "action": "homeassistant.turn_on" }, { "wait_for_trigger": { "platform": "state", "entity_id": "binary_sensor.beweging_toilet", "from": "on", "to": "off" } }, { "choose": [ { "alias": "Motion wait not defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity == none }}" } ], "sequence": [ { "entity_id": "light.lamp_toilet", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait not defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity != none }}" } ], "sequence": [ { "entity_id": null, "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity == none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": "light.lamp_toilet", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity != none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": null, "action": "homeassistant.turn_off" } ] } ] } ], "conditions": [ { "condition": "template", "alias": "Check for illuminance conditions", "value_template": "{% set illuminance_defined = illuminance_currently != none and illuminance_cutoff != none %} {% set illuminance_defined_and_low = (illuminance_defined and (states(illuminance_currently) | int(0) < states(illuminance_cutoff) | int(0))) %}\n{% set target_entity_domain_supports_on_state_check = entity_domain != 'scene' and entity_domain != 'script' %} {% set target_entity_is_scene = entity_domain == 'scene' %} {% set scene_target_entities = state_attr(target_entity, 'entity_id') %} {% set singular_scene_entity_is_on = scene_target_entities is not none and scene_target_entities | count == 1 and scene_target_entities | first == 'on' %} {{ ( target_entity_domain_supports_on_state_check and states(target_entity) == 'on') or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and not illuminance_defined) or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and not illuminance_defined) or ( target_entity_is_scene and singular_scene_entity_is_on) }}\n" }, { "condition": "template", "alias": "Check for blocker entity", "value_template": "{{ (blocker_entity == none) or (states(blocker_entity) == 'off') }}" }, { "condition": "template", "alias": "Check for time limits", "value_template": "{% set current_time = now().strftime(\"%H:%M\") %}\n{% if time_limit_before == none and time_limit_after == none %} true {% endif %}\n{% if time_limit_before != none and time_limit_after == none %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {{ current_time_is_before_limit }} {% elif time_limit_before == none and time_limit_after != none %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {{ current_time_is_after_limit }} {% endif %}\n{% if time_limit_before != none and time_limit_after != none %} {% set before_limit_is_tomorrow = states(time_limit_before) < states(time_limit_after) %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {% set time_window_spans_midnight = states(time_limit_after) > states(time_limit_before) %}\n {% if time_window_spans_midnight != none and time_window_spans_midnight and before_limit_is_tomorrow %}\n {{ current_time_is_after_limit or current_time_is_before_limit }}\n {% elif time_window_spans_midnight != none and not time_window_spans_midnight %}\n {{ current_time_is_before_limit and current_time_is_after_limit }}\n {% endif %}\n{% endif %}\n" }, { "condition": "template", "alias": "Check for sun state", "value_template": "{# Prevent breaking when no sun condition is set in existing automations #} {% if not sun_condition is defined %} {% set sun_condition = 'Always' %} {% endif %} {# Get current sun state #} {% set current_sun_condition = states['sun.sun'].state %}\n{# Checks for current sun state #} {% set sun_state_is_below_horizon = current_sun_condition == 'below_horizon' %} {% set sun_state_is_above_horizon = current_sun_condition == 'above_horizon' %}\n{# Check to see if a condition for sunstate is set by user #} {% set no_sun_condition = sun_condition is defined and sun_condition == 'Always' %} {# Check to see if the user wants automation to trigger below horizon #} {% set sun_condition_is_below_horizon = sun_condition == 'Below horizon' %} {# Check to see if the user wants automation to trigger above horizon #} {% set sun_condition_is_above_horizon = sun_condition == 'Above horizon' %}\n{# Checks to see if sunstate matches up with users condition #} {% set sun_condition_below_horizon_match = sun_state_is_below_horizon and sun_condition_is_below_horizon %} {% set sun_condition_above_horizon_match = sun_state_is_above_horizon and sun_condition_is_above_horizon %} {% set sun_condition_matching = sun_condition_below_horizon_match or sun_condition_above_horizon_match or no_sun_condition %} {{ sun_condition_matching }}\n{# Debug values: (uncomment to check in template dev tool) ## Set at top of template: {% set sun_condition = 'Above horizon' %} Current sun condition: {{current_sun_condition}} Sun state is below horizon: {{ sun_state_is_below_horizon }} Sun state is above horizon: {{ sun_state_is_above_horizon }} Sun condition is set to always: {{ sun_condition_always }} Sun condition is below horizon: {{ sun_condition_is_below_horizon }} Sun condition is above horizon: {{ sun_condition_is_above_horizon }} Sun condition is below horizon match: {{ sun_condition_below_horizon_match }} Sun condition is above horizon match: {{ sun_condition_above_horizon_match }} Sun condition is a match: {{ sun_condition_matching }} #}\n" } ], "id": "1753967772982", "alias": "Beweging toilet", "description": "" }, "blueprint_inputs": { "id": "1753967772982", "alias": "Beweging toilet", "description": "", "use_blueprint": { "path": "freakshock88/motion_illuminance_activated_entity.yaml", "input": { "motion_sensor": "binary_sensor.beweging_toilet", "target_entity": "light.lamp_toilet", "no_motion_wait": "input_number.beweging_toilet_timer" } } }, "context": { "id": "01KF30YPJ3QG52AKXFMR8VBK4W", "parent_id": "01KF30YPJ1SS2G6NMRTHAKQJSP", "user_id": null } }, "short_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "e9ba4362b3ff496b0a79b2ff60664080", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T09:07:33.571177+00:00", "finish": "2026-01-16T09:23:26.004340+00:00" }, "domain": "automation", "item_id": "1753967772982", "trigger": "state of binary_sensor.beweging_toilet" } } ], "automation.1761406177545": [ { "extended_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0", "run_id": "05704a6945bbec3e44726cd3636275b8", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T23:17:38.157333+00:00", "finish": "2026-01-13T23:17:38.316523+00:00" }, "domain": "automation", "item_id": "1761406177545", "trigger": "state of binary_sensor.schakelaar_bed_links_1", "trace": { "trigger/1": [ { "path": "trigger/1", "timestamp": "2026-01-13T23:17:38.157381+00:00", "changed_variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_bed_links_dim", "primary_input_var": "binary_sensor.schakelaar_bed_links_1", "secondary_input_var": "input_boolean.dummy", "confirm_switch_var": null, "this": { "entity_id": "automation.lamp_bed_links", "state": "on", "attributes": { "id": "1761406177545", "last_triggered": "2026-01-04T08:43:35.111033+00:00", "mode": "single", "current": 0, "friendly_name": "Schakelaar bed links" }, "last_changed": "2026-01-13T12:10:27.680142+00:00", "last_reported": "2026-01-13T12:10:27.680142+00:00", "last_updated": "2026-01-13T12:10:27.680142+00:00", "context": { "id": "01KEVM7EF07706K58C5QCDWCFX", "parent_id": null, "user_id": null } }, "trigger": { "id": "1", "idx": "1", "alias": null, "platform": "state", "entity_id": "binary_sensor.schakelaar_bed_links_1", "from_state": { "entity_id": "binary_sensor.schakelaar_bed_links_1", "state": "on", "attributes": { "device_class": "power", "icon": "mdi:toggle-switch-variant-off", "friendly_name": "Schakelaar bed links 1" }, "last_changed": "2026-01-13T12:09:35.851368+00:00", "last_reported": "2026-01-13T12:11:00.111101+00:00", "last_updated": "2026-01-13T12:09:35.851368+00:00", "context": { "id": "01KEVM5VVBGAXS483RVQ22DF6H", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.schakelaar_bed_links_1", "state": "off", "attributes": { "device_class": "power", "icon": "mdi:toggle-switch-variant-off", "friendly_name": "Schakelaar bed links 1" }, "last_changed": "2026-01-13T23:17:38.156786+00:00", "last_reported": "2026-01-13T23:17:38.156786+00:00", "last_updated": "2026-01-13T23:17:38.156786+00:00", "context": { "id": "01KEWTD2QC3HCY2YPPSPDCV3RH", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.schakelaar_bed_links_1" } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-13T23:17:38.157401+00:00", "result": { "result": true, "entities": [] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-13T23:17:38.157711+00:00", "changed_variables": { "context": { "id": "01KEWTD2QDZSH3JNC4352R0DFS", "parent_id": "01KEWTD2QC3HCY2YPPSPDCV3RH", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-13T23:17:38.157828+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-13T23:17:38.157884+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-13T23:17:38.158031+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-13T23:17:38.158114+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-13T23:17:38.158144+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-13T23:17:38.158311+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-13T23:17:38.158374+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-13T23:17:38.158403+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-13T23:17:38.158545+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": {}, "target": { "entity_id": [ "light.lamp_bed_links_dim" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1", "timestamp": "2026-01-13T23:17:38.315058+00:00" } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0", "timestamp": "2026-01-13T23:17:38.315195+00:00", "result": { "result": false } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0", "timestamp": "2026-01-13T23:17:38.315260+00:00", "result": { "result": false, "entities": [] } } ] }, "config": { "variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_bed_links_dim", "primary_input_var": "binary_sensor.schakelaar_bed_links_1", "secondary_input_var": "input_boolean.dummy", "confirm_switch_var": null }, "mode": "single", "triggers": [ { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_links_1", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_links_1", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "on", "to": "off" } ], "actions": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'lamp' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id == primary_input_var and\n (switch_type_selected == 'toggle' or\n (switch_type_selected == 'momentary' and trigger.to_state.state == 'on')) }}\n" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ lamp_entity_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ lamp_entity_var }}" }, "action": "light.toggle" } ] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ secondary_input_var != 'input_boolean.dummy' and\n trigger.entity_id == secondary_input_var and\n (switch_type_selected == 'toggle' or\n (switch_type_selected == 'momentary' and trigger.to_state.state == 'on')) }}\n" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ lamp_entity_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ lamp_entity_var }}" }, "action": "light.toggle" } ] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'custom' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id == primary_input_var and\n trigger.to_state.state == 'on' and\n (switch_type_selected == 'toggle' or switch_type_selected == 'momentary') }}\n" } ], "sequence": [] }, { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id == primary_input_var and\n trigger.to_state.state == 'off' and\n switch_type_selected == 'toggle' }}\n" } ], "sequence": [] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ secondary_input_var != 'input_boolean.dummy' and\n trigger.entity_id == secondary_input_var and\n trigger.to_state.state == 'on' and\n (switch_type_selected == 'toggle' or switch_type_selected == 'momentary') }}\n" } ], "sequence": [] }, { "conditions": [ { "condition": "template", "value_template": "{{ secondary_input_var != 'input_boolean.dummy' and\n trigger.entity_id == secondary_input_var and\n trigger.to_state.state == 'off' and\n switch_type_selected == 'toggle' }}\n" } ], "sequence": [] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ], "conditions": [ { "condition": "template", "value_template": "{{ trigger.from_state.state in ['on', 'off'] and\n trigger.to_state.state in ['on', 'off'] }}\n" } ], "id": "1761406177545", "alias": "Lamp bed links", "description": "" }, "blueprint_inputs": { "id": "1761406177545", "alias": "Lamp bed links", "description": "", "use_blueprint": { "path": "willumpie82/shelly-detached-input.yaml", "input": { "primary_input": "binary_sensor.schakelaar_bed_links_1", "lamp_entity": "light.lamp_bed_links_dim" } } }, "context": { "id": "01KEWTD2QDZSH3JNC4352R0DFS", "parent_id": "01KEWTD2QC3HCY2YPPSPDCV3RH", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0", "run_id": "05704a6945bbec3e44726cd3636275b8", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T23:17:38.157333+00:00", "finish": "2026-01-13T23:17:38.316523+00:00" }, "domain": "automation", "item_id": "1761406177545", "trigger": "state of binary_sensor.schakelaar_bed_links_1" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0", "run_id": "0b1ab5a11a0026c6588429e578da8375", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T06:54:13.198215+00:00", "finish": "2026-01-14T06:54:13.331062+00:00" }, "domain": "automation", "item_id": "1761406177545", "trigger": "state of binary_sensor.schakelaar_bed_links_1", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T06:54:13.198247+00:00", "changed_variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_bed_links_dim", "primary_input_var": "binary_sensor.schakelaar_bed_links_1", "secondary_input_var": "input_boolean.dummy", "confirm_switch_var": null, "this": { "entity_id": "automation.lamp_bed_links", "state": "on", "attributes": { "id": "1761406177545", "last_triggered": "2026-01-13T23:17:38.157561+00:00", "mode": "single", "current": 0, "friendly_name": "Schakelaar bed links" }, "last_changed": "2026-01-13T12:10:27.680142+00:00", "last_reported": "2026-01-13T23:17:38.315736+00:00", "last_updated": "2026-01-13T23:17:38.315736+00:00", "context": { "id": "01KEWTD2QDZSH3JNC4352R0DFS", "parent_id": "01KEWTD2QC3HCY2YPPSPDCV3RH", "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.schakelaar_bed_links_1", "from_state": { "entity_id": "binary_sensor.schakelaar_bed_links_1", "state": "off", "attributes": { "device_class": "power", "icon": "mdi:toggle-switch-variant-off", "friendly_name": "Schakelaar bed links 1" }, "last_changed": "2026-01-13T23:17:38.156786+00:00", "last_reported": "2026-01-13T23:17:38.156786+00:00", "last_updated": "2026-01-13T23:17:38.156786+00:00", "context": { "id": "01KEWTD2QC3HCY2YPPSPDCV3RH", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.schakelaar_bed_links_1", "state": "on", "attributes": { "device_class": "power", "icon": "mdi:toggle-switch-variant-off", "friendly_name": "Schakelaar bed links 1" }, "last_changed": "2026-01-14T06:54:13.197700+00:00", "last_reported": "2026-01-14T06:54:13.197700+00:00", "last_updated": "2026-01-14T06:54:13.197700+00:00", "context": { "id": "01KEXMH3PD1A6C4VGK9GA54PKB", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.schakelaar_bed_links_1" } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T06:54:13.198268+00:00", "result": { "result": true, "entities": [] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T06:54:13.198538+00:00", "changed_variables": { "context": { "id": "01KEXMH3PEVW2P50NKTYRK7SKA", "parent_id": "01KEXMH3PD1A6C4VGK9GA54PKB", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T06:54:13.198590+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T06:54:13.198625+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-14T06:54:13.198747+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-14T06:54:13.198780+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-14T06:54:13.198808+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-14T06:54:13.198925+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-14T06:54:13.198957+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-14T06:54:13.198984+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-14T06:54:13.199091+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": {}, "target": { "entity_id": [ "light.lamp_bed_links_dim" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1", "timestamp": "2026-01-14T06:54:13.329449+00:00" } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0", "timestamp": "2026-01-14T06:54:13.329533+00:00", "result": { "result": false } } ], "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0", "timestamp": "2026-01-14T06:54:13.329599+00:00", "result": { "result": false, "entities": [] } } ] }, "config": { "variables": { "mode_selected": "lamp", "switch_type_selected": "toggle", "lamp_entity_var": "light.lamp_bed_links_dim", "primary_input_var": "binary_sensor.schakelaar_bed_links_1", "secondary_input_var": "input_boolean.dummy", "confirm_switch_var": null }, "mode": "single", "triggers": [ { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_links_1", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "binary_sensor.schakelaar_bed_links_1", "from": "on", "to": "off" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "off", "to": "on" }, { "trigger": "state", "entity_id": "input_boolean.dummy", "from": "on", "to": "off" } ], "actions": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'lamp' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id == primary_input_var and\n (switch_type_selected == 'toggle' or\n (switch_type_selected == 'momentary' and trigger.to_state.state == 'on')) }}\n" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ lamp_entity_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ lamp_entity_var }}" }, "action": "light.toggle" } ] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ secondary_input_var != 'input_boolean.dummy' and\n trigger.entity_id == secondary_input_var and\n (switch_type_selected == 'toggle' or\n (switch_type_selected == 'momentary' and trigger.to_state.state == 'on')) }}\n" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ lamp_entity_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ lamp_entity_var }}" }, "action": "light.toggle" } ] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ mode_selected == 'custom' }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id == primary_input_var and\n trigger.to_state.state == 'on' and\n (switch_type_selected == 'toggle' or switch_type_selected == 'momentary') }}\n" } ], "sequence": [] }, { "conditions": [ { "condition": "template", "value_template": "{{ trigger.entity_id == primary_input_var and\n trigger.to_state.state == 'off' and\n switch_type_selected == 'toggle' }}\n" } ], "sequence": [] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ secondary_input_var != 'input_boolean.dummy' and\n trigger.entity_id == secondary_input_var and\n trigger.to_state.state == 'on' and\n (switch_type_selected == 'toggle' or switch_type_selected == 'momentary') }}\n" } ], "sequence": [] }, { "conditions": [ { "condition": "template", "value_template": "{{ secondary_input_var != 'input_boolean.dummy' and\n trigger.entity_id == secondary_input_var and\n trigger.to_state.state == 'off' and\n switch_type_selected == 'toggle' }}\n" } ], "sequence": [] } ] }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ confirm_switch_var is not none }}" } ], "sequence": [ { "target": { "entity_id": "{{ confirm_switch_var }}" }, "action": "switch.turn_on" } ] } ] } ] } ] } ], "conditions": [ { "condition": "template", "value_template": "{{ trigger.from_state.state in ['on', 'off'] and\n trigger.to_state.state in ['on', 'off'] }}\n" } ], "id": "1761406177545", "alias": "Lamp bed links", "description": "" }, "blueprint_inputs": { "id": "1761406177545", "alias": "Lamp bed links", "description": "", "use_blueprint": { "path": "willumpie82/shelly-detached-input.yaml", "input": { "primary_input": "binary_sensor.schakelaar_bed_links_1", "lamp_entity": "light.lamp_bed_links_dim" } } }, "context": { "id": "01KEXMH3PEVW2P50NKTYRK7SKA", "parent_id": "01KEXMH3PD1A6C4VGK9GA54PKB", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/1/choose/0/conditions/0", "run_id": "0b1ab5a11a0026c6588429e578da8375", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T06:54:13.198215+00:00", "finish": "2026-01-14T06:54:13.331062+00:00" }, "domain": "automation", "item_id": "1761406177545", "trigger": "state of binary_sensor.schakelaar_bed_links_1" } } ], "automation.1764319487898": [ { "extended_dict": { "last_step": "action/0/choose/1/sequence/0", "run_id": "a405bc612eec210f4817406a692b1f70", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T23:48:08.538810+00:00", "finish": "2026-01-13T23:48:08.656860+00:00" }, "domain": "automation", "item_id": "1764319487898", "trigger": "event 'bthome_ble_event'", "trace": { "trigger/5": [ { "path": "trigger/5", "timestamp": "2026-01-13T23:48:08.538839+00:00", "changed_variables": { "this": { "entity_id": "automation.knoppen_bed_links", "state": "on", "attributes": { "id": "1764319487898", "last_triggered": "2026-01-13T23:19:13.748245+00:00", "mode": "single", "current": 0, "friendly_name": "knoppen bed links" }, "last_changed": "2026-01-13T12:10:27.680870+00:00", "last_reported": "2026-01-13T23:19:13.869583+00:00", "last_updated": "2026-01-13T23:19:13.869583+00:00", "context": { "id": "01KEWTG02M557060B9T7391DQ7", "parent_id": "01KEWTG02K6BA161SKW0CHTGZ7", "user_id": null } }, "trigger": { "id": "right_up_single", "idx": "5", "alias": "right up single", "platform": "device", "event": { "event_type": "bthome_ble_event", "data": { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "address": "7C:C6:B6:9F:A3:BB", "event_class": "button_3", "event_type": "press", "event_properties": null }, "origin": "LOCAL", "time_fired": "2026-01-13T23:48:08.538483+00:00", "context": { "id": "01KEWW4Y6TYE9KSE2R3NZ4XDCJ", "parent_id": null, "user_id": null } }, "description": "event 'bthome_ble_event'" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-13T23:48:08.539036+00:00", "changed_variables": { "context": { "id": "01KEWW4Y6T7DXGWMGJQM10HHFF", "parent_id": "01KEWW4Y6TYE9KSE2R3NZ4XDCJ", "user_id": null } }, "result": { "choice": 1 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-13T23:48:08.539120+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-13T23:48:08.539191+00:00", "result": { "result": false } } ], "action/0/choose/1": [ { "path": "action/0/choose/1", "timestamp": "2026-01-13T23:48:08.539234+00:00", "result": { "result": true } } ], "action/0/choose/1/conditions/0": [ { "path": "action/0/choose/1/conditions/0", "timestamp": "2026-01-13T23:48:08.539253+00:00", "result": { "result": true } } ], "action/0/choose/1/sequence/0": [ { "path": "action/0/choose/1/sequence/0", "timestamp": "2026-01-13T23:48:08.539331+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": { "brightness_pct": 41, "entity_id": [ "light.lamp_slaapkamer_2" ] }, "target": { "entity_id": [ "light.lamp_slaapkamer_2" ] } }, "running_script": false } } ] }, "config": { "id": "1764319487898", "alias": "knoppen bed links", "description": "", "triggers": [ { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_2", "subtype": "press", "trigger": "device", "id": "left_down_single", "alias": "left down_single" }, { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_1", "subtype": "press", "trigger": "device", "id": "left_up_single", "alias": "left up single" }, { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_1", "subtype": "double_press", "trigger": "device", "id": "left_up_double", "alias": "left up double" }, { "alias": "left up double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_2", "subtype": "double_press", "trigger": "device", "id": "left_down_double" }, { "alias": "right up double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_3", "subtype": "long_press", "trigger": "device", "id": "right_up_double" }, { "alias": "right up single", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_3", "subtype": "press", "trigger": "device", "id": "right_up_single" }, { "alias": "right down single", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_4", "subtype": "press", "trigger": "device", "id": "right_down_single" }, { "alias": "right down double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_4", "subtype": "double_press", "trigger": "device", "id": "right_down_double" }, { "alias": "right down double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_4", "subtype": "long_press", "trigger": "device", "id": "Left_down_long" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "left_up_single" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "data": { "brightness_pct": 41 }, "target": { "entity_id": "light.lamp_bed_links_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "right_up_single" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "data": { "brightness_pct": 41 }, "target": { "entity_id": "light.lamp_slaapkamer_2" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "left_up_single" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "data": { "brightness_pct": 26 }, "target": { "entity_id": "light.lanp_bed_rechts_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "right_down_single" ] } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "or", "conditions": [ { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_open" }, { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_opening" } ] } ], "sequence": [ { "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "close" } ] }, { "conditions": [ { "condition": "or", "conditions": [ { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_closed" }, { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_closing" } ] } ], "sequence": [ { "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "open" } ] } ] } ] }, { "conditions": [ { "condition": "trigger", "id": [ "left_up_double" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 99 }, "target": { "entity_id": "light.lamp_bed_links_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "right_up_double" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 99 }, "target": { "entity_id": "light.lamp_slaapkamer_2" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "left_up_double" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 99 }, "target": { "entity_id": "light.lanp_bed_rechts_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "Left_down_long" ] } ], "sequence": [ { "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "stop" } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEWW4Y6T7DXGWMGJQM10HHFF", "parent_id": "01KEWW4Y6TYE9KSE2R3NZ4XDCJ", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/1/sequence/0", "run_id": "a405bc612eec210f4817406a692b1f70", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T23:48:08.538810+00:00", "finish": "2026-01-13T23:48:08.656860+00:00" }, "domain": "automation", "item_id": "1764319487898", "trigger": "event 'bthome_ble_event'" } }, { "extended_dict": { "last_step": "action/0/choose/3/sequence/0/choose/1/sequence/0", "run_id": "c6b322cbbe3229c458242305c664dd3b", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T23:48:10.264798+00:00", "finish": "2026-01-13T23:48:10.289873+00:00" }, "domain": "automation", "item_id": "1764319487898", "trigger": "event 'bthome_ble_event'", "trace": { "trigger/6": [ { "path": "trigger/6", "timestamp": "2026-01-13T23:48:10.264824+00:00", "changed_variables": { "this": { "entity_id": "automation.knoppen_bed_links", "state": "on", "attributes": { "id": "1764319487898", "last_triggered": "2026-01-13T23:48:08.538897+00:00", "mode": "single", "current": 0, "friendly_name": "knoppen bed links" }, "last_changed": "2026-01-13T12:10:27.680870+00:00", "last_reported": "2026-01-13T23:48:08.656135+00:00", "last_updated": "2026-01-13T23:48:08.656135+00:00", "context": { "id": "01KEWW4Y6T7DXGWMGJQM10HHFF", "parent_id": "01KEWW4Y6TYE9KSE2R3NZ4XDCJ", "user_id": null } }, "trigger": { "id": "right_down_single", "idx": "6", "alias": "right down single", "platform": "device", "event": { "event_type": "bthome_ble_event", "data": { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "address": "7C:C6:B6:9F:A3:BB", "event_class": "button_4", "event_type": "press", "event_properties": null }, "origin": "LOCAL", "time_fired": "2026-01-13T23:48:10.264443+00:00", "context": { "id": "01KEWW4ZWR4V43J6KQ1CKSK2E6", "parent_id": null, "user_id": null } }, "description": "event 'bthome_ble_event'" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-13T23:48:10.265024+00:00", "changed_variables": { "context": { "id": "01KEWW4ZWRXEEK74THMT0VEBH3", "parent_id": "01KEWW4ZWR4V43J6KQ1CKSK2E6", "user_id": null } }, "result": { "choice": 3 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-13T23:48:10.265085+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-13T23:48:10.265129+00:00", "result": { "result": false } } ], "action/0/choose/1": [ { "path": "action/0/choose/1", "timestamp": "2026-01-13T23:48:10.265200+00:00", "result": { "result": false } } ], "action/0/choose/1/conditions/0": [ { "path": "action/0/choose/1/conditions/0", "timestamp": "2026-01-13T23:48:10.265233+00:00", "result": { "result": false } } ], "action/0/choose/2": [ { "path": "action/0/choose/2", "timestamp": "2026-01-13T23:48:10.265283+00:00", "result": { "result": false } } ], "action/0/choose/2/conditions/0": [ { "path": "action/0/choose/2/conditions/0", "timestamp": "2026-01-13T23:48:10.265315+00:00", "result": { "result": false } } ], "action/0/choose/3": [ { "path": "action/0/choose/3", "timestamp": "2026-01-13T23:48:10.265364+00:00", "result": { "result": true } } ], "action/0/choose/3/conditions/0": [ { "path": "action/0/choose/3/conditions/0", "timestamp": "2026-01-13T23:48:10.265395+00:00", "result": { "result": true } } ], "action/0/choose/3/sequence/0": [ { "path": "action/0/choose/3/sequence/0", "timestamp": "2026-01-13T23:48:10.265512+00:00", "result": { "choice": 1 } } ], "action/0/choose/3/sequence/0/choose/0": [ { "path": "action/0/choose/3/sequence/0/choose/0", "timestamp": "2026-01-13T23:48:10.265562+00:00", "result": { "result": false } } ], "action/0/choose/3/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/3/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-13T23:48:10.265602+00:00", "result": { "result": false } } ], "action/0/choose/3/sequence/0/choose/0/conditions/0/conditions/0": [ { "path": "action/0/choose/3/sequence/0/choose/0/conditions/0/conditions/0", "timestamp": "2026-01-13T23:48:10.265634+00:00", "result": { "result": false, "state": "closed", "wanted_state": "open" } } ], "action/0/choose/3/sequence/0/choose/0/conditions/0/conditions/1": [ { "path": "action/0/choose/3/sequence/0/choose/0/conditions/0/conditions/1", "timestamp": "2026-01-13T23:48:10.265696+00:00", "result": { "result": false, "state": "closed", "wanted_state": "opening" } } ], "action/0/choose/3/sequence/0/choose/1": [ { "path": "action/0/choose/3/sequence/0/choose/1", "timestamp": "2026-01-13T23:48:10.265766+00:00", "result": { "result": true } } ], "action/0/choose/3/sequence/0/choose/1/conditions/0": [ { "path": "action/0/choose/3/sequence/0/choose/1/conditions/0", "timestamp": "2026-01-13T23:48:10.265799+00:00", "result": { "result": true } } ], "action/0/choose/3/sequence/0/choose/1/conditions/0/conditions/0": [ { "path": "action/0/choose/3/sequence/0/choose/1/conditions/0/conditions/0", "timestamp": "2026-01-13T23:48:10.265829+00:00", "result": { "result": true, "state": "closed", "wanted_state": "closed" } } ], "action/0/choose/3/sequence/0/choose/1/sequence/0": [ { "path": "action/0/choose/3/sequence/0/choose/1/sequence/0", "timestamp": "2026-01-13T23:48:10.265953+00:00" } ] }, "config": { "id": "1764319487898", "alias": "knoppen bed links", "description": "", "triggers": [ { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_2", "subtype": "press", "trigger": "device", "id": "left_down_single", "alias": "left down_single" }, { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_1", "subtype": "press", "trigger": "device", "id": "left_up_single", "alias": "left up single" }, { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_1", "subtype": "double_press", "trigger": "device", "id": "left_up_double", "alias": "left up double" }, { "alias": "left up double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_2", "subtype": "double_press", "trigger": "device", "id": "left_down_double" }, { "alias": "right up double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_3", "subtype": "long_press", "trigger": "device", "id": "right_up_double" }, { "alias": "right up single", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_3", "subtype": "press", "trigger": "device", "id": "right_up_single" }, { "alias": "right down single", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_4", "subtype": "press", "trigger": "device", "id": "right_down_single" }, { "alias": "right down double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_4", "subtype": "double_press", "trigger": "device", "id": "right_down_double" }, { "alias": "right down double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_4", "subtype": "long_press", "trigger": "device", "id": "Left_down_long" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "left_up_single" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "data": { "brightness_pct": 41 }, "target": { "entity_id": "light.lamp_bed_links_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "right_up_single" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "data": { "brightness_pct": 41 }, "target": { "entity_id": "light.lamp_slaapkamer_2" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "left_up_single" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "data": { "brightness_pct": 26 }, "target": { "entity_id": "light.lanp_bed_rechts_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "right_down_single" ] } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "or", "conditions": [ { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_open" }, { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_opening" } ] } ], "sequence": [ { "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "close" } ] }, { "conditions": [ { "condition": "or", "conditions": [ { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_closed" }, { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_closing" } ] } ], "sequence": [ { "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "open" } ] } ] } ] }, { "conditions": [ { "condition": "trigger", "id": [ "left_up_double" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 99 }, "target": { "entity_id": "light.lamp_bed_links_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "right_up_double" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 99 }, "target": { "entity_id": "light.lamp_slaapkamer_2" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "left_up_double" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 99 }, "target": { "entity_id": "light.lanp_bed_rechts_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "Left_down_long" ] } ], "sequence": [ { "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "stop" } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEWW4ZWRXEEK74THMT0VEBH3", "parent_id": "01KEWW4ZWR4V43J6KQ1CKSK2E6", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/3/sequence/0/choose/1/sequence/0", "run_id": "c6b322cbbe3229c458242305c664dd3b", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T23:48:10.264798+00:00", "finish": "2026-01-13T23:48:10.289873+00:00" }, "domain": "automation", "item_id": "1764319487898", "trigger": "event 'bthome_ble_event'" } }, { "extended_dict": { "last_step": "action/0/choose/1/sequence/0", "run_id": "0f790345b6dc77322f7ac6b4133081e6", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T23:48:11.019979+00:00", "finish": "2026-01-13T23:48:11.108927+00:00" }, "domain": "automation", "item_id": "1764319487898", "trigger": "event 'bthome_ble_event'", "trace": { "trigger/5": [ { "path": "trigger/5", "timestamp": "2026-01-13T23:48:11.020006+00:00", "changed_variables": { "this": { "entity_id": "automation.knoppen_bed_links", "state": "on", "attributes": { "id": "1764319487898", "last_triggered": "2026-01-13T23:48:10.264877+00:00", "mode": "single", "current": 0, "friendly_name": "knoppen bed links" }, "last_changed": "2026-01-13T12:10:27.680870+00:00", "last_reported": "2026-01-13T23:48:10.289138+00:00", "last_updated": "2026-01-13T23:48:10.289138+00:00", "context": { "id": "01KEWW4ZWRXEEK74THMT0VEBH3", "parent_id": "01KEWW4ZWR4V43J6KQ1CKSK2E6", "user_id": null } }, "trigger": { "id": "right_up_single", "idx": "5", "alias": "right up single", "platform": "device", "event": { "event_type": "bthome_ble_event", "data": { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "address": "7C:C6:B6:9F:A3:BB", "event_class": "button_3", "event_type": "press", "event_properties": null }, "origin": "LOCAL", "time_fired": "2026-01-13T23:48:11.019593+00:00", "context": { "id": "01KEWW50MB8R5C11GW623NJ0X3", "parent_id": null, "user_id": null } }, "description": "event 'bthome_ble_event'" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-13T23:48:11.020205+00:00", "changed_variables": { "context": { "id": "01KEWW50MBGP8F680G846PXZ4V", "parent_id": "01KEWW50MB8R5C11GW623NJ0X3", "user_id": null } }, "result": { "choice": 1 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-13T23:48:11.020257+00:00", "result": { "result": false } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-13T23:48:11.020281+00:00", "result": { "result": false } } ], "action/0/choose/1": [ { "path": "action/0/choose/1", "timestamp": "2026-01-13T23:48:11.020317+00:00", "result": { "result": true } } ], "action/0/choose/1/conditions/0": [ { "path": "action/0/choose/1/conditions/0", "timestamp": "2026-01-13T23:48:11.020334+00:00", "result": { "result": true } } ], "action/0/choose/1/sequence/0": [ { "path": "action/0/choose/1/sequence/0", "timestamp": "2026-01-13T23:48:11.020404+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": { "brightness_pct": 41, "entity_id": [ "light.lamp_slaapkamer_2" ] }, "target": { "entity_id": [ "light.lamp_slaapkamer_2" ] } }, "running_script": false } } ] }, "config": { "id": "1764319487898", "alias": "knoppen bed links", "description": "", "triggers": [ { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_2", "subtype": "press", "trigger": "device", "id": "left_down_single", "alias": "left down_single" }, { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_1", "subtype": "press", "trigger": "device", "id": "left_up_single", "alias": "left up single" }, { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_1", "subtype": "double_press", "trigger": "device", "id": "left_up_double", "alias": "left up double" }, { "alias": "left up double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_2", "subtype": "double_press", "trigger": "device", "id": "left_down_double" }, { "alias": "right up double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_3", "subtype": "long_press", "trigger": "device", "id": "right_up_double" }, { "alias": "right up single", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_3", "subtype": "press", "trigger": "device", "id": "right_up_single" }, { "alias": "right down single", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_4", "subtype": "press", "trigger": "device", "id": "right_down_single" }, { "alias": "right down double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_4", "subtype": "double_press", "trigger": "device", "id": "right_down_double" }, { "alias": "right down double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_4", "subtype": "long_press", "trigger": "device", "id": "Left_down_long" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "left_up_single" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "data": { "brightness_pct": 41 }, "target": { "entity_id": "light.lamp_bed_links_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "right_up_single" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "data": { "brightness_pct": 41 }, "target": { "entity_id": "light.lamp_slaapkamer_2" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "left_up_single" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "data": { "brightness_pct": 26 }, "target": { "entity_id": "light.lanp_bed_rechts_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "right_down_single" ] } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "or", "conditions": [ { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_open" }, { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_opening" } ] } ], "sequence": [ { "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "close" } ] }, { "conditions": [ { "condition": "or", "conditions": [ { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_closed" }, { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_closing" } ] } ], "sequence": [ { "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "open" } ] } ] } ] }, { "conditions": [ { "condition": "trigger", "id": [ "left_up_double" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 99 }, "target": { "entity_id": "light.lamp_bed_links_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "right_up_double" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 99 }, "target": { "entity_id": "light.lamp_slaapkamer_2" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "left_up_double" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 99 }, "target": { "entity_id": "light.lanp_bed_rechts_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "Left_down_long" ] } ], "sequence": [ { "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "stop" } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEWW50MBGP8F680G846PXZ4V", "parent_id": "01KEWW50MB8R5C11GW623NJ0X3", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/1/sequence/0", "run_id": "0f790345b6dc77322f7ac6b4133081e6", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T23:48:11.019979+00:00", "finish": "2026-01-13T23:48:11.108927+00:00" }, "domain": "automation", "item_id": "1764319487898", "trigger": "event 'bthome_ble_event'" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/0", "run_id": "64b83f3181778e1513f148ef0c4de12c", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T23:48:18.434315+00:00", "finish": "2026-01-13T23:48:18.576226+00:00" }, "domain": "automation", "item_id": "1764319487898", "trigger": "event 'bthome_ble_event'", "trace": { "trigger/1": [ { "path": "trigger/1", "timestamp": "2026-01-13T23:48:18.434390+00:00", "changed_variables": { "this": { "entity_id": "automation.knoppen_bed_links", "state": "on", "attributes": { "id": "1764319487898", "last_triggered": "2026-01-13T23:48:11.020056+00:00", "mode": "single", "current": 0, "friendly_name": "knoppen bed links" }, "last_changed": "2026-01-13T12:10:27.680870+00:00", "last_reported": "2026-01-13T23:48:11.108338+00:00", "last_updated": "2026-01-13T23:48:11.108338+00:00", "context": { "id": "01KEWW50MBGP8F680G846PXZ4V", "parent_id": "01KEWW50MB8R5C11GW623NJ0X3", "user_id": null } }, "trigger": { "id": "left_up_single", "idx": "1", "alias": "left up single", "platform": "device", "event": { "event_type": "bthome_ble_event", "data": { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "address": "7C:C6:B6:9F:A3:BB", "event_class": "button_1", "event_type": "press", "event_properties": null }, "origin": "LOCAL", "time_fired": "2026-01-13T23:48:18.433641+00:00", "context": { "id": "01KEWW57W16AEKAVTTZBHGVJT1", "parent_id": null, "user_id": null } }, "description": "event 'bthome_ble_event'" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-13T23:48:18.434713+00:00", "changed_variables": { "context": { "id": "01KEWW57W29NVP0JCG3BHBP9TK", "parent_id": "01KEWW57W16AEKAVTTZBHGVJT1", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-13T23:48:18.434810+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-13T23:48:18.434865+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-13T23:48:18.435022+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": { "brightness_pct": 41, "entity_id": [ "light.lamp_bed_links_dim" ] }, "target": { "entity_id": [ "light.lamp_bed_links_dim" ] } }, "running_script": false } } ] }, "config": { "id": "1764319487898", "alias": "knoppen bed links", "description": "", "triggers": [ { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_2", "subtype": "press", "trigger": "device", "id": "left_down_single", "alias": "left down_single" }, { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_1", "subtype": "press", "trigger": "device", "id": "left_up_single", "alias": "left up single" }, { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_1", "subtype": "double_press", "trigger": "device", "id": "left_up_double", "alias": "left up double" }, { "alias": "left up double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_2", "subtype": "double_press", "trigger": "device", "id": "left_down_double" }, { "alias": "right up double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_3", "subtype": "long_press", "trigger": "device", "id": "right_up_double" }, { "alias": "right up single", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_3", "subtype": "press", "trigger": "device", "id": "right_up_single" }, { "alias": "right down single", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_4", "subtype": "press", "trigger": "device", "id": "right_down_single" }, { "alias": "right down double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_4", "subtype": "double_press", "trigger": "device", "id": "right_down_double" }, { "alias": "right down double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_4", "subtype": "long_press", "trigger": "device", "id": "Left_down_long" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "left_up_single" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "data": { "brightness_pct": 41 }, "target": { "entity_id": "light.lamp_bed_links_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "right_up_single" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "data": { "brightness_pct": 41 }, "target": { "entity_id": "light.lamp_slaapkamer_2" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "left_up_single" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "data": { "brightness_pct": 26 }, "target": { "entity_id": "light.lanp_bed_rechts_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "right_down_single" ] } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "or", "conditions": [ { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_open" }, { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_opening" } ] } ], "sequence": [ { "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "close" } ] }, { "conditions": [ { "condition": "or", "conditions": [ { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_closed" }, { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_closing" } ] } ], "sequence": [ { "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "open" } ] } ] } ] }, { "conditions": [ { "condition": "trigger", "id": [ "left_up_double" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 99 }, "target": { "entity_id": "light.lamp_bed_links_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "right_up_double" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 99 }, "target": { "entity_id": "light.lamp_slaapkamer_2" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "left_up_double" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 99 }, "target": { "entity_id": "light.lanp_bed_rechts_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "Left_down_long" ] } ], "sequence": [ { "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "stop" } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEWW57W29NVP0JCG3BHBP9TK", "parent_id": "01KEWW57W16AEKAVTTZBHGVJT1", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0", "run_id": "64b83f3181778e1513f148ef0c4de12c", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-13T23:48:18.434315+00:00", "finish": "2026-01-13T23:48:18.576226+00:00" }, "domain": "automation", "item_id": "1764319487898", "trigger": "event 'bthome_ble_event'" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/0", "run_id": "6197b3ef17e28182dedaf5992bcb40ed", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T06:30:57.301410+00:00", "finish": "2026-01-14T06:30:57.452284+00:00" }, "domain": "automation", "item_id": "1764319487898", "trigger": "event 'bthome_ble_event'", "trace": { "trigger/1": [ { "path": "trigger/1", "timestamp": "2026-01-14T06:30:57.301479+00:00", "changed_variables": { "this": { "entity_id": "automation.knoppen_bed_links", "state": "on", "attributes": { "id": "1764319487898", "last_triggered": "2026-01-13T23:48:18.434468+00:00", "mode": "single", "current": 0, "friendly_name": "knoppen bed links" }, "last_changed": "2026-01-13T12:10:27.680870+00:00", "last_reported": "2026-01-13T23:48:18.575616+00:00", "last_updated": "2026-01-13T23:48:18.575616+00:00", "context": { "id": "01KEWW57W29NVP0JCG3BHBP9TK", "parent_id": "01KEWW57W16AEKAVTTZBHGVJT1", "user_id": null } }, "trigger": { "id": "left_up_single", "idx": "1", "alias": "left up single", "platform": "device", "event": { "event_type": "bthome_ble_event", "data": { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "address": "7C:C6:B6:9F:A3:BB", "event_class": "button_1", "event_type": "press", "event_properties": null }, "origin": "LOCAL", "time_fired": "2026-01-14T06:30:57.300927+00:00", "context": { "id": "01KEXK6GGMVZ99YY3DGHY1GVJK", "parent_id": null, "user_id": null } }, "description": "event 'bthome_ble_event'" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T06:30:57.301661+00:00", "changed_variables": { "context": { "id": "01KEXK6GGNBVDM7Y7DETRNZCHB", "parent_id": "01KEXK6GGMVZ99YY3DGHY1GVJK", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T06:30:57.301716+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T06:30:57.301742+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-14T06:30:57.301817+00:00", "result": { "params": { "domain": "light", "service": "toggle", "service_data": { "brightness_pct": 41, "entity_id": [ "light.lamp_bed_links_dim" ] }, "target": { "entity_id": [ "light.lamp_bed_links_dim" ] } }, "running_script": false } } ] }, "config": { "id": "1764319487898", "alias": "knoppen bed links", "description": "", "triggers": [ { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_2", "subtype": "press", "trigger": "device", "id": "left_down_single", "alias": "left down_single" }, { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_1", "subtype": "press", "trigger": "device", "id": "left_up_single", "alias": "left up single" }, { "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_1", "subtype": "double_press", "trigger": "device", "id": "left_up_double", "alias": "left up double" }, { "alias": "left up double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_2", "subtype": "double_press", "trigger": "device", "id": "left_down_double" }, { "alias": "right up double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_3", "subtype": "long_press", "trigger": "device", "id": "right_up_double" }, { "alias": "right up single", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_3", "subtype": "press", "trigger": "device", "id": "right_up_single" }, { "alias": "right down single", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_4", "subtype": "press", "trigger": "device", "id": "right_down_single" }, { "alias": "right down double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_4", "subtype": "double_press", "trigger": "device", "id": "right_down_double" }, { "alias": "right down double", "device_id": "2649e0fd343836ce7fe8323b5a93655c", "domain": "bthome", "type": "button_4", "subtype": "long_press", "trigger": "device", "id": "Left_down_long" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": [ "left_up_single" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "data": { "brightness_pct": 41 }, "target": { "entity_id": "light.lamp_bed_links_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "right_up_single" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "data": { "brightness_pct": 41 }, "target": { "entity_id": "light.lamp_slaapkamer_2" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "left_up_single" ] } ], "sequence": [ { "action": "light.toggle", "metadata": {}, "data": { "brightness_pct": 26 }, "target": { "entity_id": "light.lanp_bed_rechts_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "right_down_single" ] } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "or", "conditions": [ { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_open" }, { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_opening" } ] } ], "sequence": [ { "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "close" } ] }, { "conditions": [ { "condition": "or", "conditions": [ { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_closed" }, { "condition": "device", "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "is_closing" } ] } ], "sequence": [ { "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "open" } ] } ] } ] }, { "conditions": [ { "condition": "trigger", "id": [ "left_up_double" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 99 }, "target": { "entity_id": "light.lamp_bed_links_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "right_up_double" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 99 }, "target": { "entity_id": "light.lamp_slaapkamer_2" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "left_up_double" ] } ], "sequence": [ { "action": "light.turn_on", "metadata": {}, "data": { "brightness_pct": 99 }, "target": { "entity_id": "light.lanp_bed_rechts_dim" } } ] }, { "conditions": [ { "condition": "trigger", "id": [ "Left_down_long" ] } ], "sequence": [ { "device_id": "ed986b7daa26aca29c5636403fecec82", "domain": "cover", "entity_id": "cf5f60186168615423f7c8c4ca976ecd", "type": "stop" } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEXK6GGNBVDM7Y7DETRNZCHB", "parent_id": "01KEXK6GGMVZ99YY3DGHY1GVJK", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0", "run_id": "6197b3ef17e28182dedaf5992bcb40ed", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T06:30:57.301410+00:00", "finish": "2026-01-14T06:30:57.452284+00:00" }, "domain": "automation", "item_id": "1764319487898", "trigger": "event 'bthome_ble_event'" } } ], "script.verwerk_iphone_wekkers": [ { "extended_dict": { "last_step": "sequence/3", "run_id": "c4a2fceaefdb2089c753534a1b97afab", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T07:02:23.557189+00:00", "finish": "2026-01-14T07:02:23.559012+00:00" }, "domain": "script", "item_id": "verwerk_iphone_wekkers", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-14T07:02:23.557486+00:00", "changed_variables": { "this": { "entity_id": "script.verwerk_iphone_wekkers", "state": "off", "attributes": { "last_triggered": "2026-01-14T07:01:17.574868+00:00", "mode": "single", "current": 0, "friendly_name": "verwerk iphone wekkers" }, "last_changed": "2026-01-14T07:01:17.580553+00:00", "last_reported": "2026-01-14T07:01:17.580553+00:00", "last_updated": "2026-01-14T07:01:17.580553+00:00", "context": { "id": "01KEXMY24600Y8EG19PGRAQPAD", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "wekkers": [], "context": { "id": "01KEXN02J5ZNVKAH289JBKPPVM", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" }, "vandaag_nl": "woensdag", "morgen_nl": "donderdag", "datum_vandaag": "2026-01-14", "datum_morgen": "2026-01-15" } } ], "sequence/1": [ { "path": "sequence/1", "timestamp": "2026-01-14T07:02:23.557953+00:00", "changed_variables": { "gekozen_wekker": null } } ], "sequence/2": [ { "path": "sequence/2", "timestamp": "2026-01-14T07:02:23.558163+00:00", "result": { "params": { "domain": "input_datetime", "service": "set_datetime", "service_data": { "datetime": "2026-01-14 00:00:00", "entity_id": [ "input_datetime.iphone_next_alarm" ] }, "target": { "entity_id": [ "input_datetime.iphone_next_alarm" ] } }, "running_script": false } } ], "sequence/3": [ { "path": "sequence/3", "timestamp": "2026-01-14T07:02:23.558661+00:00", "result": { "params": { "domain": "system_log", "service": "write", "service_data": { "level": "info", "logger": "custom_iphone_alarm", "message": "Debug: Vandaag=woensdag, Morgen=donderdag, Gekozen=None" }, "target": {} }, "running_script": false } } ] }, "config": { "fields": { "wekkers": { "description": "Lijst met wekkers van iPhone" } }, "alias": "verwerk iphone wekkers", "description": "", "sequence": [ { "variables": { "vandaag_nl": "{% set dagen = ['maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', 'zondag'] %} {{ dagen[now().weekday()] }}\n", "morgen_nl": "{% set dagen = ['maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', 'zondag'] %} {% set m_idx = now().weekday() + 1 %} {{ dagen[0 if m_idx == 7 else m_idx] }}\n", "datum_vandaag": "{{ now().strftime('%Y-%m-%d') }}", "datum_morgen": "{{ (now() + timedelta(days=1)).strftime('%Y-%m-%d') }}" } }, { "variables": { "gekozen_wekker": "{% set lijst = namespace(items=[]) %} {% set wekker_data = wekkers if wekkers is iterable and wekkers is not string else [wekkers] %} {% for w in wekker_data %}\n {% set dagen = w.dagen | lower %}\n {% if dagen == \"\" or vandaag_nl in dagen or morgen_nl in dagen %}\n {% set t = w.tijd if w.tijd.count(':') == 2 else w.tijd + ':00' %}\n {% set lijst.items = lijst.items + [t] %}\n {% endif %}\n{% endfor %} {{ lijst.items | sort | first | default(none) }}\n" } }, { "target": { "entity_id": "input_datetime.iphone_next_alarm" }, "data": { "datetime": "{% if gekozen_wekker is not none %}\n {% if today_at(gekozen_wekker) < now() %}\n {{ datum_morgen }} {{ gekozen_wekker }}\n {% else %}\n {{ datum_vandaag }} {{ gekozen_wekker }}\n {% endif %}\n{% else %}\n {{ datum_vandaag }} 00:00:00\n{% endif %}\n" }, "action": "input_datetime.set_datetime" }, { "data": { "level": "info", "logger": "custom_iphone_alarm", "message": "Debug: Vandaag={{ vandaag_nl }}, Morgen={{ morgen_nl }}, Gekozen={{ gekozen_wekker | default('Geen') }}" }, "action": "system_log.write" } ] }, "blueprint_inputs": null, "context": { "id": "01KEXN02J5ZNVKAH289JBKPPVM", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "short_dict": { "last_step": "sequence/3", "run_id": "c4a2fceaefdb2089c753534a1b97afab", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T07:02:23.557189+00:00", "finish": "2026-01-14T07:02:23.559012+00:00" }, "domain": "script", "item_id": "verwerk_iphone_wekkers" } }, { "extended_dict": { "last_step": "sequence/3", "run_id": "ce4598bc4dc6d059e0fc1c6326b439c7", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T07:02:26.694688+00:00", "finish": "2026-01-14T07:02:26.696020+00:00" }, "domain": "script", "item_id": "verwerk_iphone_wekkers", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-14T07:02:26.694916+00:00", "changed_variables": { "this": { "entity_id": "script.verwerk_iphone_wekkers", "state": "off", "attributes": { "last_triggered": "2026-01-14T07:02:23.557258+00:00", "mode": "single", "current": 0, "friendly_name": "verwerk iphone wekkers" }, "last_changed": "2026-01-14T07:02:23.558891+00:00", "last_reported": "2026-01-14T07:02:23.558891+00:00", "last_updated": "2026-01-14T07:02:23.558891+00:00", "context": { "id": "01KEXN02J5ZNVKAH289JBKPPVM", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "wekkers": [], "context": { "id": "01KEXN05M6V3JQH417GQE01RYW", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" }, "vandaag_nl": "woensdag", "morgen_nl": "donderdag", "datum_vandaag": "2026-01-14", "datum_morgen": "2026-01-15" } } ], "sequence/1": [ { "path": "sequence/1", "timestamp": "2026-01-14T07:02:26.695296+00:00", "changed_variables": { "gekozen_wekker": null } } ], "sequence/2": [ { "path": "sequence/2", "timestamp": "2026-01-14T07:02:26.695414+00:00", "result": { "params": { "domain": "input_datetime", "service": "set_datetime", "service_data": { "datetime": "2026-01-14 00:00:00", "entity_id": [ "input_datetime.iphone_next_alarm" ] }, "target": { "entity_id": [ "input_datetime.iphone_next_alarm" ] } }, "running_script": false } } ], "sequence/3": [ { "path": "sequence/3", "timestamp": "2026-01-14T07:02:26.695763+00:00", "result": { "params": { "domain": "system_log", "service": "write", "service_data": { "level": "info", "logger": "custom_iphone_alarm", "message": "Debug: Vandaag=woensdag, Morgen=donderdag, Gekozen=None" }, "target": {} }, "running_script": false } } ] }, "config": { "fields": { "wekkers": { "description": "Lijst met wekkers van iPhone" } }, "alias": "verwerk iphone wekkers", "description": "", "sequence": [ { "variables": { "vandaag_nl": "{% set dagen = ['maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', 'zondag'] %} {{ dagen[now().weekday()] }}\n", "morgen_nl": "{% set dagen = ['maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', 'zondag'] %} {% set m_idx = now().weekday() + 1 %} {{ dagen[0 if m_idx == 7 else m_idx] }}\n", "datum_vandaag": "{{ now().strftime('%Y-%m-%d') }}", "datum_morgen": "{{ (now() + timedelta(days=1)).strftime('%Y-%m-%d') }}" } }, { "variables": { "gekozen_wekker": "{% set lijst = namespace(items=[]) %} {% set wekker_data = wekkers if wekkers is iterable and wekkers is not string else [wekkers] %} {% for w in wekker_data %}\n {% set dagen = w.dagen | lower %}\n {% if dagen == \"\" or vandaag_nl in dagen or morgen_nl in dagen %}\n {% set t = w.tijd if w.tijd.count(':') == 2 else w.tijd + ':00' %}\n {% set lijst.items = lijst.items + [t] %}\n {% endif %}\n{% endfor %} {{ lijst.items | sort | first | default(none) }}\n" } }, { "target": { "entity_id": "input_datetime.iphone_next_alarm" }, "data": { "datetime": "{% if gekozen_wekker is not none %}\n {% if today_at(gekozen_wekker) < now() %}\n {{ datum_morgen }} {{ gekozen_wekker }}\n {% else %}\n {{ datum_vandaag }} {{ gekozen_wekker }}\n {% endif %}\n{% else %}\n {{ datum_vandaag }} 00:00:00\n{% endif %}\n" }, "action": "input_datetime.set_datetime" }, { "data": { "level": "info", "logger": "custom_iphone_alarm", "message": "Debug: Vandaag={{ vandaag_nl }}, Morgen={{ morgen_nl }}, Gekozen={{ gekozen_wekker | default('Geen') }}" }, "action": "system_log.write" } ] }, "blueprint_inputs": null, "context": { "id": "01KEXN05M6V3JQH417GQE01RYW", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "short_dict": { "last_step": "sequence/3", "run_id": "ce4598bc4dc6d059e0fc1c6326b439c7", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T07:02:26.694688+00:00", "finish": "2026-01-14T07:02:26.696020+00:00" }, "domain": "script", "item_id": "verwerk_iphone_wekkers" } }, { "extended_dict": { "last_step": "sequence/3", "run_id": "e983cf9e96a9ba66539fe8a8637c7253", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T08:01:20.429883+00:00", "finish": "2026-01-14T08:01:20.431755+00:00" }, "domain": "script", "item_id": "verwerk_iphone_wekkers", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-14T08:01:20.430272+00:00", "changed_variables": { "this": { "entity_id": "script.verwerk_iphone_wekkers", "state": "off", "attributes": { "last_triggered": "2026-01-14T07:02:26.694741+00:00", "mode": "single", "current": 0, "friendly_name": "verwerk iphone wekkers" }, "last_changed": "2026-01-14T07:02:26.695930+00:00", "last_reported": "2026-01-14T07:02:26.695930+00:00", "last_updated": "2026-01-14T07:02:26.695930+00:00", "context": { "id": "01KEXN05M6V3JQH417GQE01RYW", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "wekkers": [], "context": { "id": "01KEXRC0HDMZBRRCA0ZRJ78CAY", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" }, "vandaag_nl": "woensdag", "morgen_nl": "donderdag", "datum_vandaag": "2026-01-14", "datum_morgen": "2026-01-15" } } ], "sequence/1": [ { "path": "sequence/1", "timestamp": "2026-01-14T08:01:20.430679+00:00", "changed_variables": { "gekozen_wekker": null } } ], "sequence/2": [ { "path": "sequence/2", "timestamp": "2026-01-14T08:01:20.430818+00:00", "result": { "params": { "domain": "input_datetime", "service": "set_datetime", "service_data": { "datetime": "2026-01-14 00:00:00", "entity_id": [ "input_datetime.iphone_next_alarm" ] }, "target": { "entity_id": [ "input_datetime.iphone_next_alarm" ] } }, "running_script": false } } ], "sequence/3": [ { "path": "sequence/3", "timestamp": "2026-01-14T08:01:20.431357+00:00", "result": { "params": { "domain": "system_log", "service": "write", "service_data": { "level": "info", "logger": "custom_iphone_alarm", "message": "Debug: Vandaag=woensdag, Morgen=donderdag, Gekozen=None" }, "target": {} }, "running_script": false } } ] }, "config": { "fields": { "wekkers": { "description": "Lijst met wekkers van iPhone" } }, "alias": "verwerk iphone wekkers", "description": "", "sequence": [ { "variables": { "vandaag_nl": "{% set dagen = ['maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', 'zondag'] %} {{ dagen[now().weekday()] }}\n", "morgen_nl": "{% set dagen = ['maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', 'zondag'] %} {% set m_idx = now().weekday() + 1 %} {{ dagen[0 if m_idx == 7 else m_idx] }}\n", "datum_vandaag": "{{ now().strftime('%Y-%m-%d') }}", "datum_morgen": "{{ (now() + timedelta(days=1)).strftime('%Y-%m-%d') }}" } }, { "variables": { "gekozen_wekker": "{% set lijst = namespace(items=[]) %} {% set wekker_data = wekkers if wekkers is iterable and wekkers is not string else [wekkers] %} {% for w in wekker_data %}\n {% set dagen = w.dagen | lower %}\n {% if dagen == \"\" or vandaag_nl in dagen or morgen_nl in dagen %}\n {% set t = w.tijd if w.tijd.count(':') == 2 else w.tijd + ':00' %}\n {% set lijst.items = lijst.items + [t] %}\n {% endif %}\n{% endfor %} {{ lijst.items | sort | first | default(none) }}\n" } }, { "target": { "entity_id": "input_datetime.iphone_next_alarm" }, "data": { "datetime": "{% if gekozen_wekker is not none %}\n {% if today_at(gekozen_wekker) < now() %}\n {{ datum_morgen }} {{ gekozen_wekker }}\n {% else %}\n {{ datum_vandaag }} {{ gekozen_wekker }}\n {% endif %}\n{% else %}\n {{ datum_vandaag }} 00:00:00\n{% endif %}\n" }, "action": "input_datetime.set_datetime" }, { "data": { "level": "info", "logger": "custom_iphone_alarm", "message": "Debug: Vandaag={{ vandaag_nl }}, Morgen={{ morgen_nl }}, Gekozen={{ gekozen_wekker | default('Geen') }}" }, "action": "system_log.write" } ] }, "blueprint_inputs": null, "context": { "id": "01KEXRC0HDMZBRRCA0ZRJ78CAY", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "short_dict": { "last_step": "sequence/3", "run_id": "e983cf9e96a9ba66539fe8a8637c7253", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T08:01:20.429883+00:00", "finish": "2026-01-14T08:01:20.431755+00:00" }, "domain": "script", "item_id": "verwerk_iphone_wekkers" } }, { "extended_dict": { "last_step": "sequence/3", "run_id": "400534c207b8f20d3cdae5652d506039", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T08:02:18.034961+00:00", "finish": "2026-01-14T08:02:18.036523+00:00" }, "domain": "script", "item_id": "verwerk_iphone_wekkers", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-14T08:02:18.035325+00:00", "changed_variables": { "this": { "entity_id": "script.verwerk_iphone_wekkers", "state": "off", "attributes": { "last_triggered": "2026-01-14T08:01:20.429974+00:00", "mode": "single", "current": 0, "friendly_name": "verwerk iphone wekkers" }, "last_changed": "2026-01-14T08:01:20.431601+00:00", "last_reported": "2026-01-14T08:01:20.431601+00:00", "last_updated": "2026-01-14T08:01:20.431601+00:00", "context": { "id": "01KEXRC0HDMZBRRCA0ZRJ78CAY", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "wekkers": [], "context": { "id": "01KEXRDRSJ5B41YD551W8BGYHV", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" }, "vandaag_nl": "woensdag", "morgen_nl": "donderdag", "datum_vandaag": "2026-01-14", "datum_morgen": "2026-01-15" } } ], "sequence/1": [ { "path": "sequence/1", "timestamp": "2026-01-14T08:02:18.035697+00:00", "changed_variables": { "gekozen_wekker": null } } ], "sequence/2": [ { "path": "sequence/2", "timestamp": "2026-01-14T08:02:18.035821+00:00", "result": { "params": { "domain": "input_datetime", "service": "set_datetime", "service_data": { "datetime": "2026-01-14 00:00:00", "entity_id": [ "input_datetime.iphone_next_alarm" ] }, "target": { "entity_id": [ "input_datetime.iphone_next_alarm" ] } }, "running_script": false } } ], "sequence/3": [ { "path": "sequence/3", "timestamp": "2026-01-14T08:02:18.036245+00:00", "result": { "params": { "domain": "system_log", "service": "write", "service_data": { "level": "info", "logger": "custom_iphone_alarm", "message": "Debug: Vandaag=woensdag, Morgen=donderdag, Gekozen=None" }, "target": {} }, "running_script": false } } ] }, "config": { "fields": { "wekkers": { "description": "Lijst met wekkers van iPhone" } }, "alias": "verwerk iphone wekkers", "description": "", "sequence": [ { "variables": { "vandaag_nl": "{% set dagen = ['maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', 'zondag'] %} {{ dagen[now().weekday()] }}\n", "morgen_nl": "{% set dagen = ['maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', 'zondag'] %} {% set m_idx = now().weekday() + 1 %} {{ dagen[0 if m_idx == 7 else m_idx] }}\n", "datum_vandaag": "{{ now().strftime('%Y-%m-%d') }}", "datum_morgen": "{{ (now() + timedelta(days=1)).strftime('%Y-%m-%d') }}" } }, { "variables": { "gekozen_wekker": "{% set lijst = namespace(items=[]) %} {% set wekker_data = wekkers if wekkers is iterable and wekkers is not string else [wekkers] %} {% for w in wekker_data %}\n {% set dagen = w.dagen | lower %}\n {% if dagen == \"\" or vandaag_nl in dagen or morgen_nl in dagen %}\n {% set t = w.tijd if w.tijd.count(':') == 2 else w.tijd + ':00' %}\n {% set lijst.items = lijst.items + [t] %}\n {% endif %}\n{% endfor %} {{ lijst.items | sort | first | default(none) }}\n" } }, { "target": { "entity_id": "input_datetime.iphone_next_alarm" }, "data": { "datetime": "{% if gekozen_wekker is not none %}\n {% if today_at(gekozen_wekker) < now() %}\n {{ datum_morgen }} {{ gekozen_wekker }}\n {% else %}\n {{ datum_vandaag }} {{ gekozen_wekker }}\n {% endif %}\n{% else %}\n {{ datum_vandaag }} 00:00:00\n{% endif %}\n" }, "action": "input_datetime.set_datetime" }, { "data": { "level": "info", "logger": "custom_iphone_alarm", "message": "Debug: Vandaag={{ vandaag_nl }}, Morgen={{ morgen_nl }}, Gekozen={{ gekozen_wekker | default('Geen') }}" }, "action": "system_log.write" } ] }, "blueprint_inputs": null, "context": { "id": "01KEXRDRSJ5B41YD551W8BGYHV", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "short_dict": { "last_step": "sequence/3", "run_id": "400534c207b8f20d3cdae5652d506039", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T08:02:18.034961+00:00", "finish": "2026-01-14T08:02:18.036523+00:00" }, "domain": "script", "item_id": "verwerk_iphone_wekkers" } }, { "extended_dict": { "last_step": "sequence/3", "run_id": "78a54063baa120f15748e84da9c3b7ae", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-15T00:00:03.576683+00:00", "finish": "2026-01-15T00:00:03.578392+00:00" }, "domain": "script", "item_id": "verwerk_iphone_wekkers", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-15T00:00:03.576955+00:00", "changed_variables": { "this": { "entity_id": "script.verwerk_iphone_wekkers", "state": "off", "attributes": { "last_triggered": "2026-01-14T08:02:18.035034+00:00", "mode": "single", "current": 0, "friendly_name": "verwerk iphone wekkers" }, "last_changed": "2026-01-14T15:48:26.122061+00:00", "last_reported": "2026-01-14T15:48:26.122061+00:00", "last_updated": "2026-01-14T15:48:26.122061+00:00", "context": { "id": "01KEYK39CADXCGZG7Y2S527XCC", "parent_id": null, "user_id": null } }, "wekkers": [], "context": { "id": "01KEZF7FFR7VHHAQB926KAPFPR", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" }, "vandaag_nl": "donderdag", "morgen_nl": "vrijdag", "datum_vandaag": "2026-01-15", "datum_morgen": "2026-01-16" } } ], "sequence/1": [ { "path": "sequence/1", "timestamp": "2026-01-15T00:00:03.577433+00:00", "changed_variables": { "gekozen_wekker": null } } ], "sequence/2": [ { "path": "sequence/2", "timestamp": "2026-01-15T00:00:03.577607+00:00", "result": { "params": { "domain": "input_datetime", "service": "set_datetime", "service_data": { "datetime": "2026-01-15 00:00:00", "entity_id": [ "input_datetime.iphone_next_alarm" ] }, "target": { "entity_id": [ "input_datetime.iphone_next_alarm" ] } }, "running_script": false } } ], "sequence/3": [ { "path": "sequence/3", "timestamp": "2026-01-15T00:00:03.578111+00:00", "result": { "params": { "domain": "system_log", "service": "write", "service_data": { "level": "info", "logger": "custom_iphone_alarm", "message": "Debug: Vandaag=donderdag, Morgen=vrijdag, Gekozen=None" }, "target": {} }, "running_script": false } } ] }, "config": { "fields": { "wekkers": { "description": "Lijst met wekkers van iPhone" } }, "alias": "verwerk iphone wekkers", "description": "", "sequence": [ { "variables": { "vandaag_nl": "{% set dagen = ['maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', 'zondag'] %} {{ dagen[now().weekday()] }}\n", "morgen_nl": "{% set dagen = ['maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', 'zondag'] %} {% set m_idx = now().weekday() + 1 %} {{ dagen[0 if m_idx == 7 else m_idx] }}\n", "datum_vandaag": "{{ now().strftime('%Y-%m-%d') }}", "datum_morgen": "{{ (now() + timedelta(days=1)).strftime('%Y-%m-%d') }}" } }, { "variables": { "gekozen_wekker": "{% set lijst = namespace(items=[]) %} {% set wekker_data = wekkers if wekkers is iterable and wekkers is not string else [wekkers] %} {% for w in wekker_data %}\n {% set dagen = w.dagen | lower %}\n {% if dagen == \"\" or vandaag_nl in dagen or morgen_nl in dagen %}\n {% set t = w.tijd if w.tijd.count(':') == 2 else w.tijd + ':00' %}\n {% set lijst.items = lijst.items + [t] %}\n {% endif %}\n{% endfor %} {{ lijst.items | sort | first | default(none) }}\n" } }, { "target": { "entity_id": "input_datetime.iphone_next_alarm" }, "data": { "datetime": "{% if gekozen_wekker is not none %}\n {% if today_at(gekozen_wekker) < now() %}\n {{ datum_morgen }} {{ gekozen_wekker }}\n {% else %}\n {{ datum_vandaag }} {{ gekozen_wekker }}\n {% endif %}\n{% else %}\n {{ datum_vandaag }} 00:00:00\n{% endif %}\n" }, "action": "input_datetime.set_datetime" }, { "data": { "level": "info", "logger": "custom_iphone_alarm", "message": "Debug: Vandaag={{ vandaag_nl }}, Morgen={{ morgen_nl }}, Gekozen={{ gekozen_wekker | default('Geen') }}" }, "action": "system_log.write" } ] }, "blueprint_inputs": null, "context": { "id": "01KEZF7FFR7VHHAQB926KAPFPR", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "short_dict": { "last_step": "sequence/3", "run_id": "78a54063baa120f15748e84da9c3b7ae", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-15T00:00:03.576683+00:00", "finish": "2026-01-15T00:00:03.578392+00:00" }, "domain": "script", "item_id": "verwerk_iphone_wekkers" } } ], "automation.1756826045048": [ { "extended_dict": { "last_step": "condition/0", "run_id": "9f86a2fa059f7bebb0f3737be1cba002", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-14T07:00:00.055111+00:00", "finish": "2026-01-14T07:00:00.055339+00:00" }, "domain": "automation", "item_id": "1756826045048", "trigger": "time", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T07:00:00.055144+00:00", "changed_variables": { "this": { "entity_id": "automation.container_reset_op_1e_van_de_maand", "state": "on", "attributes": { "id": "1756826045048", "last_triggered": "2026-01-01T07:00:00.121985+00:00", "mode": "single", "current": 0, "friendly_name": "Container reset op 1e van de maand" }, "last_changed": "2026-01-13T12:10:27.678890+00:00", "last_reported": "2026-01-13T12:10:27.678890+00:00", "last_updated": "2026-01-13T12:10:27.678890+00:00", "context": { "id": "01KEVM7EEYD65HWEQN9A8Q5G9S", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "time", "now": "2026-01-14T08:00:00.054915+01:00", "description": "time", "entity_id": null } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T07:00:00.055190+00:00", "result": { "result": false, "entities": [] } } ] }, "config": { "id": "1756826045048", "alias": "Container reset op 1e van de maand", "description": "", "triggers": [ { "trigger": "time", "at": "08:00:00" } ], "conditions": [ { "condition": "template", "value_template": "{{ now().day == 1 }}" } ], "actions": [ { "action": "counter.reset", "metadata": {}, "data": {}, "target": { "entity_id": "counter.container_lichting" } }, { "action": "notify.mobile_app_iphone_van_willem", "metadata": {}, "data": { "message": "container gereset", "title": "container" } } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEXMVPDQD6PXEVRQ365B7HA2", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "condition/0", "run_id": "9f86a2fa059f7bebb0f3737be1cba002", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-14T07:00:00.055111+00:00", "finish": "2026-01-14T07:00:00.055339+00:00" }, "domain": "automation", "item_id": "1756826045048", "trigger": "time" } }, { "extended_dict": { "last_step": "condition/0", "run_id": "25b07fe1c1f32c8121a02aa7153e8c3b", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-15T07:00:00.098407+00:00", "finish": "2026-01-15T07:00:00.098646+00:00" }, "domain": "automation", "item_id": "1756826045048", "trigger": "time", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-15T07:00:00.098437+00:00", "changed_variables": { "this": { "entity_id": "automation.container_reset_op_1e_van_de_maand", "state": "on", "attributes": { "id": "1756826045048", "last_triggered": "2026-01-01T07:00:00.121985+00:00", "mode": "single", "current": 0, "friendly_name": "Container reset op 1e van de maand" }, "last_changed": "2026-01-14T15:48:56.986635+00:00", "last_reported": "2026-01-14T15:48:56.986635+00:00", "last_updated": "2026-01-14T15:48:56.986635+00:00", "context": { "id": "01KEYK47GT73X0FZ61TYGH327Y", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "time", "now": "2026-01-15T08:00:00.098248+01:00", "description": "time", "entity_id": null } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-15T07:00:00.098460+00:00", "result": { "result": false, "entities": [] } } ] }, "config": { "id": "1756826045048", "alias": "Container reset op 1e van de maand", "description": "", "triggers": [ { "trigger": "time", "at": "08:00:00" } ], "conditions": [ { "condition": "template", "value_template": "{{ now().day == 1 }}" } ], "actions": [ { "action": "counter.reset", "metadata": {}, "data": {}, "target": { "entity_id": "counter.container_lichting" } }, { "action": "notify.mobile_app_iphone_van_willem", "metadata": {}, "data": { "message": "container gereset", "title": "container" } } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF078DF2T4ZK3V39XQCHWWFJ", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "condition/0", "run_id": "25b07fe1c1f32c8121a02aa7153e8c3b", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-15T07:00:00.098407+00:00", "finish": "2026-01-15T07:00:00.098646+00:00" }, "domain": "automation", "item_id": "1756826045048", "trigger": "time" } }, { "extended_dict": { "last_step": "condition/0", "run_id": "02cd74c4c1375cecbd1a622ea3198c36", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T07:00:00.427631+00:00", "finish": "2026-01-16T07:00:00.428225+00:00" }, "domain": "automation", "item_id": "1756826045048", "trigger": "time", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-16T07:00:00.427659+00:00", "changed_variables": { "this": { "entity_id": "automation.container_reset_op_1e_van_de_maand", "state": "on", "attributes": { "id": "1756826045048", "last_triggered": "2026-01-01T07:00:00.121985+00:00", "mode": "single", "current": 0, "friendly_name": "Container reset op 1e van de maand" }, "last_changed": "2026-01-15T08:04:17.789938+00:00", "last_reported": "2026-01-15T08:04:17.789938+00:00", "last_updated": "2026-01-15T08:04:17.789938+00:00", "context": { "id": "01KF0AY4QX48SH8EC0MQZ50NS3", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "time", "now": "2026-01-16T08:00:00.427468+01:00", "description": "time", "entity_id": null } } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-16T07:00:00.427679+00:00", "result": { "result": false, "entities": [] } } ] }, "config": { "id": "1756826045048", "alias": "Container reset op 1e van de maand", "description": "", "triggers": [ { "trigger": "time", "at": "08:00:00" } ], "conditions": [ { "condition": "template", "value_template": "{{ now().day == 1 }}" } ], "actions": [ { "action": "counter.reset", "metadata": {}, "data": {}, "target": { "entity_id": "counter.container_lichting" } }, { "action": "notify.mobile_app_iphone_van_willem", "metadata": {}, "data": { "message": "container gereset", "title": "container" } } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF2SN4SBN6FD67MMXNBVG5YV", "parent_id": null, "user_id": null } }, "short_dict": { "last_step": "condition/0", "run_id": "02cd74c4c1375cecbd1a622ea3198c36", "state": "stopped", "script_execution": "failed_conditions", "timestamp": { "start": "2026-01-16T07:00:00.427631+00:00", "finish": "2026-01-16T07:00:00.428225+00:00" }, "domain": "automation", "item_id": "1756826045048", "trigger": "time" } } ], "script.thermostaat_woonkamer_toggle": [ { "extended_dict": { "last_step": "sequence/0", "run_id": "ac114325198338760368f7d66b448b00", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T08:43:02.124092+00:00", "finish": "2026-01-14T08:43:02.124902+00:00" }, "domain": "script", "item_id": "thermostaat_woonkamer_toggle", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-14T08:43:02.124393+00:00", "changed_variables": { "this": { "entity_id": "script.thermostaat_woonkamer_toggle", "state": "off", "attributes": { "last_triggered": "2026-01-14T08:41:29.159368+00:00", "mode": "single", "current": 0, "friendly_name": "Thermostaat woonkamer toggle" }, "last_changed": "2026-01-14T08:41:29.159978+00:00", "last_reported": "2026-01-14T08:41:29.159978+00:00", "last_updated": "2026-01-14T08:41:29.159978+00:00", "context": { "id": "01KEXTNGT7TASDKN2M0P7Q5RSM", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "context": { "id": "01KEXTRBKB9GF10WCQ0F83ZG8S", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "result": { "params": { "domain": "climate", "service": "set_temperature", "service_data": { "temperature": 15, "entity_id": [ "climate.verwarming_woonkamer" ] }, "target": { "entity_id": [ "climate.verwarming_woonkamer" ] } }, "running_script": false } } ] }, "config": { "alias": "Thermostaat woonkamer toggle", "mode": "single", "sequence": [ { "target": { "entity_id": "climate.verwarming_woonkamer" }, "data": { "temperature": "{% set t = state_attr('climate.verwarming_woonkamer_blu', 'temperature') | default(18) | float %} {% if t <= 15 %}\n 18\n{% elif t <= 18 %}\n 20\n{% else %}\n 15\n{% endif %}\n" }, "action": "climate.set_temperature" } ], "description": "" }, "blueprint_inputs": null, "context": { "id": "01KEXTRBKB9GF10WCQ0F83ZG8S", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "short_dict": { "last_step": "sequence/0", "run_id": "ac114325198338760368f7d66b448b00", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T08:43:02.124092+00:00", "finish": "2026-01-14T08:43:02.124902+00:00" }, "domain": "script", "item_id": "thermostaat_woonkamer_toggle" } }, { "extended_dict": { "last_step": "sequence/0", "run_id": "3f936598bd578a2730b7f57d6cc35b94", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T08:47:05.653823+00:00", "finish": "2026-01-14T08:47:13.890275+00:00" }, "domain": "script", "item_id": "thermostaat_woonkamer_toggle", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-14T08:47:05.654164+00:00", "changed_variables": { "this": { "entity_id": "script.thermostaat_woonkamer_toggle", "state": "off", "attributes": { "last_triggered": "2026-01-14T08:43:02.124159+00:00", "mode": "single", "current": 0, "friendly_name": "Thermostaat woonkamer toggle" }, "last_changed": "2026-01-14T08:46:32.495354+00:00", "last_reported": "2026-01-14T08:46:32.495354+00:00", "last_updated": "2026-01-14T08:46:32.495354+00:00", "context": { "id": "01KEXTYS1FKHSRQA59N9SNSQAV", "parent_id": null, "user_id": null } }, "context": { "id": "01KEXTZSDNZEXPBHFWRVTFC88C", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "result": { "params": { "domain": "climate", "service": "set_temperature", "service_data": { "temperature": 15, "entity_id": [ "climate.verwarming_woonkamer_blu" ] }, "target": { "entity_id": [ "climate.verwarming_woonkamer_blu" ] } }, "running_script": false } } ] }, "config": { "alias": "Thermostaat woonkamer toggle", "mode": "single", "sequence": [ { "target": { "entity_id": "climate.verwarming_woonkamer_blu" }, "data": { "temperature": "{% set t = state_attr('climate.verwarming_woonkamer_blu', 'temperature') | float(18) %} {% if t <= 15 %}\n 18\n{% elif t <= 18 %}\n 20\n{% else %}\n 15\n{% endif %}\n" }, "action": "climate.set_temperature" } ], "description": "" }, "blueprint_inputs": null, "context": { "id": "01KEXTZSDNZEXPBHFWRVTFC88C", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "short_dict": { "last_step": "sequence/0", "run_id": "3f936598bd578a2730b7f57d6cc35b94", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T08:47:05.653823+00:00", "finish": "2026-01-14T08:47:13.890275+00:00" }, "domain": "script", "item_id": "thermostaat_woonkamer_toggle" } }, { "extended_dict": { "last_step": null, "run_id": "35a91a943fd789537709e141bc135659", "state": "stopped", "script_execution": "failed_single", "timestamp": { "start": "2026-01-14T08:47:13.006933+00:00", "finish": "2026-01-14T08:47:13.007108+00:00" }, "domain": "script", "item_id": "thermostaat_woonkamer_toggle", "trace": {}, "config": { "alias": "Thermostaat woonkamer toggle", "mode": "single", "sequence": [ { "target": { "entity_id": "climate.verwarming_woonkamer_blu" }, "data": { "temperature": "{% set t = state_attr('climate.verwarming_woonkamer_blu', 'temperature') | float(18) %} {% if t <= 15 %}\n 18\n{% elif t <= 18 %}\n 20\n{% else %}\n 15\n{% endif %}\n" }, "action": "climate.set_temperature" } ], "description": "" }, "blueprint_inputs": null, "context": { "id": "01KEXV00KE4BK7HZ451KNFMKD4", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "short_dict": { "last_step": null, "run_id": "35a91a943fd789537709e141bc135659", "state": "stopped", "script_execution": "failed_single", "timestamp": { "start": "2026-01-14T08:47:13.006933+00:00", "finish": "2026-01-14T08:47:13.007108+00:00" }, "domain": "script", "item_id": "thermostaat_woonkamer_toggle" } }, { "extended_dict": { "last_step": "sequence/0", "run_id": "bf63868c0bdd2749ce974a3ddfc238e4", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T08:48:25.698858+00:00", "finish": "2026-01-14T08:48:33.727851+00:00" }, "domain": "script", "item_id": "thermostaat_woonkamer_toggle", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-14T08:48:25.699121+00:00", "changed_variables": { "this": { "entity_id": "script.thermostaat_woonkamer_toggle", "state": "off", "attributes": { "last_triggered": "2026-01-14T08:47:05.653899+00:00", "mode": "single", "current": 0, "friendly_name": "Thermostaat woonkamer toggle" }, "last_changed": "2026-01-14T08:47:13.889670+00:00", "last_reported": "2026-01-14T08:47:13.889670+00:00", "last_updated": "2026-01-14T08:47:13.889670+00:00", "context": { "id": "01KEXV00KE4BK7HZ451KNFMKD4", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "context": { "id": "01KEXV27K2J0RTYYG9TE4CH7FT", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "result": { "params": { "domain": "climate", "service": "set_temperature", "service_data": { "temperature": 18, "entity_id": [ "climate.verwarming_woonkamer_blu" ] }, "target": { "entity_id": [ "climate.verwarming_woonkamer_blu" ] } }, "running_script": false } } ] }, "config": { "alias": "Thermostaat woonkamer toggle", "mode": "single", "sequence": [ { "target": { "entity_id": "climate.verwarming_woonkamer_blu" }, "data": { "temperature": "{% set t = state_attr('climate.verwarming_woonkamer_blu', 'temperature') | float(18) %} {% if t <= 15 %}\n 18\n{% elif t <= 18 %}\n 20\n{% else %}\n 15\n{% endif %}\n" }, "action": "climate.set_temperature" } ], "description": "" }, "blueprint_inputs": null, "context": { "id": "01KEXV27K2J0RTYYG9TE4CH7FT", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "short_dict": { "last_step": "sequence/0", "run_id": "bf63868c0bdd2749ce974a3ddfc238e4", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T08:48:25.698858+00:00", "finish": "2026-01-14T08:48:33.727851+00:00" }, "domain": "script", "item_id": "thermostaat_woonkamer_toggle" } }, { "extended_dict": { "last_step": "sequence/0", "run_id": "adcbbbaa3db75a7701bbb57eb8ad6ca5", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-16T08:43:51.755342+00:00", "finish": "2026-01-16T08:44:51.757436+00:00" }, "domain": "script", "item_id": "thermostaat_woonkamer_toggle", "error": "Device communication error occurred while calling action for climate.verwarming_woonkamer_blu of shellyblugwg3-34cdb077a0b4", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-16T08:43:51.755647+00:00", "changed_variables": { "this": { "entity_id": "script.thermostaat_woonkamer_toggle", "state": "off", "attributes": { "last_triggered": "2026-01-14T08:48:25.698936+00:00", "mode": "single", "current": 0, "friendly_name": "Thermostaat woonkamer toggle" }, "last_changed": "2026-01-15T08:03:41.404033+00:00", "last_reported": "2026-01-15T08:03:41.404033+00:00", "last_updated": "2026-01-15T08:03:41.404033+00:00", "context": { "id": "01KF0AX16W6QN457HFWDCJ8WK1", "parent_id": null, "user_id": null } }, "context": { "id": "01KF2ZKA2BPRQK5QM1FQVWS49C", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "error": "Device communication error occurred while calling action for climate.verwarming_woonkamer_blu of shellyblugwg3-34cdb077a0b4", "result": { "params": { "domain": "climate", "service": "set_temperature", "service_data": { "temperature": 18, "entity_id": [ "climate.verwarming_woonkamer_blu" ] }, "target": { "entity_id": [ "climate.verwarming_woonkamer_blu" ] } }, "running_script": false } } ] }, "config": { "alias": "Thermostaat woonkamer toggle", "mode": "single", "sequence": [ { "target": { "entity_id": "climate.verwarming_woonkamer_blu" }, "data": { "temperature": "{% set t = state_attr('climate.verwarming_woonkamer_blu', 'temperature') | float(18) %} {% if t <= 15 %}\n 18\n{% elif t <= 18 %}\n 20\n{% else %}\n 15\n{% endif %}\n" }, "action": "climate.set_temperature" } ], "description": "" }, "blueprint_inputs": null, "context": { "id": "01KF2ZKA2BPRQK5QM1FQVWS49C", "parent_id": null, "user_id": "9bf8b1236c854d0b81e22d53e7a1ca90" } }, "short_dict": { "last_step": "sequence/0", "run_id": "adcbbbaa3db75a7701bbb57eb8ad6ca5", "state": "stopped", "script_execution": "error", "timestamp": { "start": "2026-01-16T08:43:51.755342+00:00", "finish": "2026-01-16T08:44:51.757436+00:00" }, "domain": "script", "item_id": "thermostaat_woonkamer_toggle", "error": "Device communication error occurred while calling action for climate.verwarming_woonkamer_blu of shellyblugwg3-34cdb077a0b4" } } ], "automation.1768375873128": [ { "extended_dict": { "last_step": "action/0", "run_id": "05988bbacc449454d0f10e2d6c06d8ad", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T09:20:03.967027+00:00", "finish": "2026-01-16T09:20:05.410471+00:00" }, "domain": "automation", "item_id": "1768375873128", "trigger": "state of sensor.temperatuur_woonkamer_temperatuur", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-16T09:20:03.967076+00:00", "changed_variables": { "this": { "entity_id": "automation.set_woonkamer_trv_external_temperature", "state": "on", "attributes": { "id": "1768375873128", "last_triggered": "2026-01-16T09:16:41.930130+00:00", "mode": "single", "current": 0, "friendly_name": "set woonkamer TRV external temperature" }, "last_changed": "2026-01-15T08:04:17.795152+00:00", "last_reported": "2026-01-16T09:16:46.959238+00:00", "last_updated": "2026-01-16T09:16:46.959238+00:00", "context": { "id": "01KF31FJZFZ1GR3WYVGHKEZHRW", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "from_state": { "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "state": "17.2", "attributes": { "state_class": "measurement", "unit_of_measurement": "\u00b0C", "device_class": "temperature", "friendly_name": "Temperatuur woonkamer Temperatuur" }, "last_changed": "2026-01-16T09:16:11.925316+00:00", "last_reported": "2026-01-16T09:16:11.925316+00:00", "last_updated": "2026-01-16T09:16:11.925316+00:00", "context": { "id": "01KF31EGRNFY8CZDQX8QTBG2S6", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "state": "17.7", "attributes": { "state_class": "measurement", "unit_of_measurement": "\u00b0C", "device_class": "temperature", "friendly_name": "Temperatuur woonkamer Temperatuur" }, "last_changed": "2026-01-16T09:19:33.962046+00:00", "last_reported": "2026-01-16T09:19:33.962046+00:00", "last_updated": "2026-01-16T09:19:33.962046+00:00", "context": { "id": "01KF31MP2AY5MF51BMFQKMYNHR", "parent_id": null, "user_id": null } }, "for": { "__type": "", "total_seconds": 30.0 }, "attribute": null, "description": "state of sensor.temperatuur_woonkamer_temperatuur" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-16T09:20:03.967392+00:00", "changed_variables": { "context": { "id": "01KF31NKBZ3V95RCEY2Y7MWA54", "parent_id": "01KF31MP2AY5MF51BMFQKMYNHR", "user_id": null } }, "result": { "params": { "domain": "number", "service": "set_value", "service_data": { "value": 17.7, "entity_id": [ "number.verwarming_woonkamer_blu_external_temperature" ] }, "target": { "entity_id": [ "number.verwarming_woonkamer_blu_external_temperature" ] } }, "running_script": false } } ] }, "config": { "id": "1768375873128", "alias": "set woonkamer TRV external temperature", "description": "", "triggers": [ { "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "for": "00:00:30", "trigger": "state" } ], "conditions": [], "actions": [ { "target": { "entity_id": "number.verwarming_woonkamer_blu_external_temperature" }, "data": { "value": "{{ states('sensor.temperatuur_woonkamer_temperatuur') | float(20) }}" }, "action": "number.set_value" } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF31NKBZ3V95RCEY2Y7MWA54", "parent_id": "01KF31MP2AY5MF51BMFQKMYNHR", "user_id": null } }, "short_dict": { "last_step": "action/0", "run_id": "05988bbacc449454d0f10e2d6c06d8ad", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T09:20:03.967027+00:00", "finish": "2026-01-16T09:20:05.410471+00:00" }, "domain": "automation", "item_id": "1768375873128", "trigger": "state of sensor.temperatuur_woonkamer_temperatuur" } }, { "extended_dict": { "last_step": "action/0", "run_id": "35d6c56e036c98433627cb585c22e296", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T09:23:10.948113+00:00", "finish": "2026-01-16T09:23:28.659635+00:00" }, "domain": "automation", "item_id": "1768375873128", "trigger": "state of sensor.temperatuur_woonkamer_temperatuur", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-16T09:23:10.948190+00:00", "changed_variables": { "this": { "entity_id": "automation.set_woonkamer_trv_external_temperature", "state": "on", "attributes": { "id": "1768375873128", "last_triggered": "2026-01-16T09:20:03.967143+00:00", "mode": "single", "current": 0, "friendly_name": "set woonkamer TRV external temperature" }, "last_changed": "2026-01-15T08:04:17.795152+00:00", "last_reported": "2026-01-16T09:20:05.406434+00:00", "last_updated": "2026-01-16T09:20:05.406434+00:00", "context": { "id": "01KF31NKBZ3V95RCEY2Y7MWA54", "parent_id": "01KF31MP2AY5MF51BMFQKMYNHR", "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "from_state": { "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "state": "17.7", "attributes": { "state_class": "measurement", "unit_of_measurement": "\u00b0C", "device_class": "temperature", "friendly_name": "Temperatuur woonkamer Temperatuur" }, "last_changed": "2026-01-16T09:19:33.962046+00:00", "last_reported": "2026-01-16T09:19:33.962046+00:00", "last_updated": "2026-01-16T09:19:33.962046+00:00", "context": { "id": "01KF31MP2AY5MF51BMFQKMYNHR", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "state": "18.2", "attributes": { "state_class": "measurement", "unit_of_measurement": "\u00b0C", "device_class": "temperature", "friendly_name": "Temperatuur woonkamer Temperatuur" }, "last_changed": "2026-01-16T09:22:40.940509+00:00", "last_reported": "2026-01-16T09:22:40.940509+00:00", "last_updated": "2026-01-16T09:22:40.940509+00:00", "context": { "id": "01KF31TCNCTGT2R88M9PJQWJ31", "parent_id": null, "user_id": null } }, "for": { "__type": "", "total_seconds": 30.0 }, "attribute": null, "description": "state of sensor.temperatuur_woonkamer_temperatuur" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-16T09:23:10.948545+00:00", "changed_variables": { "context": { "id": "01KF31V9Z4HZ2J9HP798GPE36E", "parent_id": "01KF31TCNCTGT2R88M9PJQWJ31", "user_id": null } }, "result": { "params": { "domain": "number", "service": "set_value", "service_data": { "value": 18.2, "entity_id": [ "number.verwarming_woonkamer_blu_external_temperature" ] }, "target": { "entity_id": [ "number.verwarming_woonkamer_blu_external_temperature" ] } }, "running_script": false } } ] }, "config": { "id": "1768375873128", "alias": "set woonkamer TRV external temperature", "description": "", "triggers": [ { "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "for": "00:00:30", "trigger": "state" } ], "conditions": [], "actions": [ { "target": { "entity_id": "number.verwarming_woonkamer_blu_external_temperature" }, "data": { "value": "{{ states('sensor.temperatuur_woonkamer_temperatuur') | float(20) }}" }, "action": "number.set_value" } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF31V9Z4HZ2J9HP798GPE36E", "parent_id": "01KF31TCNCTGT2R88M9PJQWJ31", "user_id": null } }, "short_dict": { "last_step": "action/0", "run_id": "35d6c56e036c98433627cb585c22e296", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T09:23:10.948113+00:00", "finish": "2026-01-16T09:23:28.659635+00:00" }, "domain": "automation", "item_id": "1768375873128", "trigger": "state of sensor.temperatuur_woonkamer_temperatuur" } }, { "extended_dict": { "last_step": "action/0", "run_id": "b1faff09195fa2b458c6254b8c1d62e3", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T09:25:52.565092+00:00", "finish": "2026-01-16T09:25:59.405214+00:00" }, "domain": "automation", "item_id": "1768375873128", "trigger": "state of sensor.temperatuur_woonkamer_temperatuur", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-16T09:25:52.565126+00:00", "changed_variables": { "this": { "entity_id": "automation.set_woonkamer_trv_external_temperature", "state": "on", "attributes": { "id": "1768375873128", "last_triggered": "2026-01-16T09:23:10.948263+00:00", "mode": "single", "current": 0, "friendly_name": "set woonkamer TRV external temperature" }, "last_changed": "2026-01-15T08:04:17.795152+00:00", "last_reported": "2026-01-16T09:23:28.655850+00:00", "last_updated": "2026-01-16T09:23:28.655850+00:00", "context": { "id": "01KF31VV8FQKGRBCJ2MDPF2D4T", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "from_state": { "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "state": "18.2", "attributes": { "state_class": "measurement", "unit_of_measurement": "\u00b0C", "device_class": "temperature", "friendly_name": "Temperatuur woonkamer Temperatuur" }, "last_changed": "2026-01-16T09:22:40.940509+00:00", "last_reported": "2026-01-16T09:22:40.940509+00:00", "last_updated": "2026-01-16T09:22:40.940509+00:00", "context": { "id": "01KF31TCNCTGT2R88M9PJQWJ31", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "state": "18.7", "attributes": { "state_class": "measurement", "unit_of_measurement": "\u00b0C", "device_class": "temperature", "friendly_name": "Temperatuur woonkamer Temperatuur" }, "last_changed": "2026-01-16T09:25:22.559311+00:00", "last_reported": "2026-01-16T09:25:22.559311+00:00", "last_updated": "2026-01-16T09:25:22.559311+00:00", "context": { "id": "01KF31ZAFZ19446NFQDZMWN8RE", "parent_id": null, "user_id": null } }, "for": { "__type": "", "total_seconds": 30.0 }, "attribute": null, "description": "state of sensor.temperatuur_woonkamer_temperatuur" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-16T09:25:52.565517+00:00", "changed_variables": { "context": { "id": "01KF3207SN0384R45YJKFT76HV", "parent_id": "01KF31ZAFZ19446NFQDZMWN8RE", "user_id": null } }, "result": { "params": { "domain": "number", "service": "set_value", "service_data": { "value": 18.7, "entity_id": [ "number.verwarming_woonkamer_blu_external_temperature" ] }, "target": { "entity_id": [ "number.verwarming_woonkamer_blu_external_temperature" ] } }, "running_script": false } } ] }, "config": { "id": "1768375873128", "alias": "set woonkamer TRV external temperature", "description": "", "triggers": [ { "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "for": "00:00:30", "trigger": "state" } ], "conditions": [], "actions": [ { "target": { "entity_id": "number.verwarming_woonkamer_blu_external_temperature" }, "data": { "value": "{{ states('sensor.temperatuur_woonkamer_temperatuur') | float(20) }}" }, "action": "number.set_value" } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF3207SN0384R45YJKFT76HV", "parent_id": "01KF31ZAFZ19446NFQDZMWN8RE", "user_id": null } }, "short_dict": { "last_step": "action/0", "run_id": "b1faff09195fa2b458c6254b8c1d62e3", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T09:25:52.565092+00:00", "finish": "2026-01-16T09:25:59.405214+00:00" }, "domain": "automation", "item_id": "1768375873128", "trigger": "state of sensor.temperatuur_woonkamer_temperatuur" } }, { "extended_dict": { "last_step": "action/0", "run_id": "004433d5dd7c6177f99032ed20692555", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T09:29:39.903611+00:00", "finish": "2026-01-16T09:30:00.489559+00:00" }, "domain": "automation", "item_id": "1768375873128", "trigger": "state of sensor.temperatuur_woonkamer_temperatuur", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-16T09:29:39.903659+00:00", "changed_variables": { "this": { "entity_id": "automation.set_woonkamer_trv_external_temperature", "state": "on", "attributes": { "id": "1768375873128", "last_triggered": "2026-01-16T09:25:52.565228+00:00", "mode": "single", "current": 0, "friendly_name": "set woonkamer TRV external temperature" }, "last_changed": "2026-01-15T08:04:17.795152+00:00", "last_reported": "2026-01-16T09:25:59.400059+00:00", "last_updated": "2026-01-16T09:25:59.400059+00:00", "context": { "id": "01KF320EF8S346FFXBZFHP3QR1", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "from_state": { "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "state": "18.7", "attributes": { "state_class": "measurement", "unit_of_measurement": "\u00b0C", "device_class": "temperature", "friendly_name": "Temperatuur woonkamer Temperatuur" }, "last_changed": "2026-01-16T09:25:22.559311+00:00", "last_reported": "2026-01-16T09:25:22.559311+00:00", "last_updated": "2026-01-16T09:25:22.559311+00:00", "context": { "id": "01KF31ZAFZ19446NFQDZMWN8RE", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "state": "19.2", "attributes": { "state_class": "measurement", "unit_of_measurement": "\u00b0C", "device_class": "temperature", "friendly_name": "Temperatuur woonkamer Temperatuur" }, "last_changed": "2026-01-16T09:29:09.878744+00:00", "last_reported": "2026-01-16T09:29:09.878744+00:00", "last_updated": "2026-01-16T09:29:09.878744+00:00", "context": { "id": "01KF3268FPRAFPRZE1RWJDZN4R", "parent_id": null, "user_id": null } }, "for": { "__type": "", "total_seconds": 30.0 }, "attribute": null, "description": "state of sensor.temperatuur_woonkamer_temperatuur" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-16T09:29:39.903967+00:00", "changed_variables": { "context": { "id": "01KF3275SZ8WB1JMWBQDP63G57", "parent_id": "01KF3268FPRAFPRZE1RWJDZN4R", "user_id": null } }, "result": { "params": { "domain": "number", "service": "set_value", "service_data": { "value": 19.2, "entity_id": [ "number.verwarming_woonkamer_blu_external_temperature" ] }, "target": { "entity_id": [ "number.verwarming_woonkamer_blu_external_temperature" ] } }, "running_script": false } } ] }, "config": { "id": "1768375873128", "alias": "set woonkamer TRV external temperature", "description": "", "triggers": [ { "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "for": "00:00:30", "trigger": "state" } ], "conditions": [], "actions": [ { "target": { "entity_id": "number.verwarming_woonkamer_blu_external_temperature" }, "data": { "value": "{{ states('sensor.temperatuur_woonkamer_temperatuur') | float(20) }}" }, "action": "number.set_value" } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF3275SZ8WB1JMWBQDP63G57", "parent_id": "01KF3268FPRAFPRZE1RWJDZN4R", "user_id": null } }, "short_dict": { "last_step": "action/0", "run_id": "004433d5dd7c6177f99032ed20692555", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T09:29:39.903611+00:00", "finish": "2026-01-16T09:30:00.489559+00:00" }, "domain": "automation", "item_id": "1768375873128", "trigger": "state of sensor.temperatuur_woonkamer_temperatuur" } }, { "extended_dict": { "last_step": "action/0", "run_id": "777f7aa2af3d835126b2bd416f7137e4", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T09:34:53.103407+00:00", "finish": "2026-01-16T09:35:11.579594+00:00" }, "domain": "automation", "item_id": "1768375873128", "trigger": "state of sensor.temperatuur_woonkamer_temperatuur", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-16T09:34:53.103460+00:00", "changed_variables": { "this": { "entity_id": "automation.set_woonkamer_trv_external_temperature", "state": "on", "attributes": { "id": "1768375873128", "last_triggered": "2026-01-16T09:29:39.903738+00:00", "mode": "single", "current": 0, "friendly_name": "set woonkamer TRV external temperature" }, "last_changed": "2026-01-15T08:04:17.795152+00:00", "last_reported": "2026-01-16T09:30:00.485371+00:00", "last_updated": "2026-01-16T09:30:00.485371+00:00", "context": { "id": "01KF327SX5J8DWJW05KNWVJ149", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "from_state": { "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "state": "19.2", "attributes": { "state_class": "measurement", "unit_of_measurement": "\u00b0C", "device_class": "temperature", "friendly_name": "Temperatuur woonkamer Temperatuur" }, "last_changed": "2026-01-16T09:29:09.878744+00:00", "last_reported": "2026-01-16T09:29:09.878744+00:00", "last_updated": "2026-01-16T09:29:09.878744+00:00", "context": { "id": "01KF3268FPRAFPRZE1RWJDZN4R", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "state": "19.7", "attributes": { "state_class": "measurement", "unit_of_measurement": "\u00b0C", "device_class": "temperature", "friendly_name": "Temperatuur woonkamer Temperatuur" }, "last_changed": "2026-01-16T09:34:23.098235+00:00", "last_reported": "2026-01-16T09:34:23.098235+00:00", "last_updated": "2026-01-16T09:34:23.098235+00:00", "context": { "id": "01KF32FTBTPRGYXYYJMPY6247J", "parent_id": null, "user_id": null } }, "for": { "__type": "", "total_seconds": 30.0 }, "attribute": null, "description": "state of sensor.temperatuur_woonkamer_temperatuur" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-16T09:34:53.103773+00:00", "changed_variables": { "context": { "id": "01KF32GQNFNBBB405SPFA1EDR6", "parent_id": "01KF32FTBTPRGYXYYJMPY6247J", "user_id": null } }, "result": { "params": { "domain": "number", "service": "set_value", "service_data": { "value": 19.7, "entity_id": [ "number.verwarming_woonkamer_blu_external_temperature" ] }, "target": { "entity_id": [ "number.verwarming_woonkamer_blu_external_temperature" ] } }, "running_script": false } } ] }, "config": { "id": "1768375873128", "alias": "set woonkamer TRV external temperature", "description": "", "triggers": [ { "entity_id": "sensor.temperatuur_woonkamer_temperatuur", "for": "00:00:30", "trigger": "state" } ], "conditions": [], "actions": [ { "target": { "entity_id": "number.verwarming_woonkamer_blu_external_temperature" }, "data": { "value": "{{ states('sensor.temperatuur_woonkamer_temperatuur') | float(20) }}" }, "action": "number.set_value" } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KF32GQNFNBBB405SPFA1EDR6", "parent_id": "01KF32FTBTPRGYXYYJMPY6247J", "user_id": null } }, "short_dict": { "last_step": "action/0", "run_id": "777f7aa2af3d835126b2bd416f7137e4", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T09:34:53.103407+00:00", "finish": "2026-01-16T09:35:11.579594+00:00" }, "domain": "automation", "item_id": "1768375873128", "trigger": "state of sensor.temperatuur_woonkamer_temperatuur" } } ], "automation.1760174572626": [ { "extended_dict": { "last_step": "action/0/choose/0/sequence/3/entity_id/0", "run_id": "5e4643acdfedb69ebdc05dc3bf2af199", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T08:44:54.576253+00:00", "finish": "2026-01-14T09:15:53.611653+00:00" }, "domain": "automation", "item_id": "1760174572626", "trigger": "update.meterkastinterface_firmware via template", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T08:44:54.576276+00:00", "changed_variables": { "this": { "entity_id": "automation.esphome_update_checker", "state": "on", "attributes": { "id": "1760174572626", "last_triggered": "2026-01-08T21:32:23.000954+00:00", "mode": "single", "current": 0, "friendly_name": "ESPHome Update Checker" }, "last_changed": "2026-01-13T12:10:27.679828+00:00", "last_reported": "2026-01-13T12:10:27.679828+00:00", "last_updated": "2026-01-13T12:10:27.679828+00:00", "context": { "id": "01KEVM7EEZJHTQBN3KP545TEJ2", "parent_id": null, "user_id": null } }, "trigger": { "platform": "template", "entity_id": "update.meterkastinterface_firmware", "from_state": { "entity_id": "update.meterkastinterface_firmware", "state": "unavailable", "attributes": { "device_class": "firmware", "entity_picture": "https://brands.home-assistant.io/_/esphome/icon.png", "friendly_name": "meterkastinterface Firmware", "supported_features": 0 }, "last_changed": "2026-01-14T08:39:54.568048+00:00", "last_reported": "2026-01-14T08:39:54.568048+00:00", "last_updated": "2026-01-14T08:39:54.568048+00:00", "context": { "id": "01KEXTJME8RTQ8Q09V8KWWE8SB", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "update.meterkastinterface_firmware", "state": "on", "attributes": { "auto_update": false, "display_precision": 0, "installed_version": "2025.12.5", "in_progress": false, "latest_version": "2025.12.6", "release_summary": null, "release_url": "https://esphome.io/changelog/", "skipped_version": null, "title": "ESPHome", "update_percentage": null, "device_class": "firmware", "entity_picture": "https://brands.home-assistant.io/_/esphome/icon.png", "friendly_name": "meterkastinterface Firmware", "supported_features": 1 }, "last_changed": "2026-01-14T08:44:54.572463+00:00", "last_reported": "2026-01-14T08:44:54.572463+00:00", "last_updated": "2026-01-14T08:44:54.572463+00:00", "context": { "id": "01KEXTVSDC4E5YP9ENNRWT6WZE", "parent_id": null, "user_id": null } }, "id": "0", "idx": "0", "alias": null, "for": null, "description": "update.meterkastinterface_firmware via template" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T08:44:54.576470+00:00", "changed_variables": { "context": { "id": "01KEXTVSDG8QDVHHBT44SKTJ0P", "parent_id": "01KEXTVSDC4E5YP9ENNRWT6WZE", "user_id": null }, "wait": { "remaining": 0.0, "completed": false } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T08:44:54.576621+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T08:44:54.576649+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0/conditions/0", "timestamp": "2026-01-14T08:44:54.576666+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-14T08:44:54.576806+00:00", "result": { "params": { "domain": "timer", "service": "start", "service_data": { "duration": "00:05:00", "entity_id": [ "timer.esphome_updates_timer" ] }, "target": { "entity_id": [ "timer.esphome_updates_timer" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/1": [ { "path": "action/0/choose/0/sequence/1", "timestamp": "2026-01-14T08:44:54.577326+00:00", "result": { "params": { "domain": "notify", "service": "mobile_app_iphone_van_willem", "service_data": { "title": "ESPHome Devices", "message": "Your ESPHome devices will now be updated from \n 2025.12.5 \n to 2025.12.6." }, "target": {} }, "running_script": false } } ], "action/0/choose/0/sequence/2": [ { "path": "action/0/choose/0/sequence/2", "timestamp": "2026-01-14T08:44:54.578285+00:00", "changed_variables": { "wait": { "remaining": 0.0, "completed": false } } } ], "action/0/choose/0/sequence/2/repeat/sequence/0": [ { "path": "action/0/choose/0/sequence/2/repeat/sequence/0", "timestamp": "2026-01-14T08:44:54.578881+00:00", "child_id": { "domain": "automation", "item_id": "1760174572626", "run_id": "76434e06dee729d60466e1b5ae3a28ff" }, "changed_variables": { "repeat": { "first": true, "index": 1, "last": false, "item": "update.meterkastinterface_firmware" } }, "result": { "params": { "domain": "update", "service": "install", "service_data": {}, "target": { "entity_id": [ "update.meterkastinterface_firmware" ] } }, "running_script": false } }, { "path": "action/0/choose/0/sequence/2/repeat/sequence/0", "timestamp": "2026-01-14T08:52:05.829885+00:00", "changed_variables": { "wait": { "remaining": 171.62155279517174, "completed": true }, "repeat": { "first": false, "index": 2, "last": false, "item": "update.voice_woonkamer_firmware" } }, "result": { "params": { "domain": "update", "service": "install", "service_data": {}, "target": { "entity_id": [ "update.voice_woonkamer_firmware" ] } }, "running_script": false } }, { "path": "action/0/choose/0/sequence/2/repeat/sequence/0", "timestamp": "2026-01-14T08:58:24.178276+00:00", "changed_variables": { "wait": { "remaining": 171.49409340694547, "completed": true }, "repeat": { "first": false, "index": 3, "last": false, "item": "update.aqs_ikea_co2_firmware" } }, "result": { "params": { "domain": "update", "service": "install", "service_data": {}, "target": { "entity_id": [ "update.aqs_ikea_co2_firmware" ] } }, "running_script": false } }, { "path": "action/0/choose/0/sequence/2/repeat/sequence/0", "timestamp": "2026-01-14T09:01:14.550762+00:00", "changed_variables": { "wait": { "remaining": 174.58520187903196, "completed": true }, "repeat": { "first": false, "index": 4, "last": false, "item": "update.beweging_meterkast_firmware" } }, "result": { "params": { "domain": "update", "service": "install", "service_data": {}, "target": { "entity_id": [ "update.beweging_meterkast_firmware" ] } }, "running_script": false } }, { "path": "action/0/choose/0/sequence/2/repeat/sequence/0", "timestamp": "2026-01-14T09:03:42.244172+00:00", "changed_variables": { "wait": { "remaining": 172.51274369377643, "completed": true }, "repeat": { "first": false, "index": 5, "last": false, "item": "update.bt_proxy_woonkamer_firmware" } }, "result": { "params": { "domain": "update", "service": "install", "service_data": {}, "target": { "entity_id": [ "update.bt_proxy_woonkamer_firmware" ] } }, "running_script": false } }, { "path": "action/0/choose/0/sequence/2/repeat/sequence/0", "timestamp": "2026-01-14T09:06:13.983492+00:00", "changed_variables": { "wait": { "remaining": 175.49261107388884, "completed": true }, "repeat": { "first": false, "index": 6, "last": false, "item": "update.beweging_zolder_ep_lite_firmware" } }, "result": { "params": { "domain": "update", "service": "install", "service_data": {}, "target": { "entity_id": [ "update.beweging_zolder_ep_lite_firmware" ] } }, "running_script": false } }, { "path": "action/0/choose/0/sequence/2/repeat/sequence/0", "timestamp": "2026-01-14T09:09:42.204116+00:00", "changed_variables": { "wait": { "remaining": 165.90841644722968, "completed": true }, "repeat": { "first": false, "index": 7, "last": false, "item": "update.aqs_slaapkamer_firmware" } }, "result": { "params": { "domain": "update", "service": "install", "service_data": {}, "target": { "entity_id": [ "update.aqs_slaapkamer_firmware" ] } }, "running_script": false } }, { "path": "action/0/choose/0/sequence/2/repeat/sequence/0", "timestamp": "2026-01-14T09:12:53.609392+00:00", "changed_variables": { "wait": { "remaining": 168.81871295627207, "completed": true }, "repeat": { "first": false, "index": 8, "last": true, "item": "update.voicebal_firmware" } }, "result": { "params": { "domain": "update", "service": "install", "service_data": {}, "target": { "entity_id": [ "update.voicebal_firmware" ] } }, "running_script": false } } ], "action/0/choose/0/sequence/2/repeat/sequence/1": [ { "path": "action/0/choose/0/sequence/2/repeat/sequence/1", "timestamp": "2026-01-14T08:51:57.446585+00:00", "changed_variables": { "wait": { "remaining": 171.62155279517174, "completed": true } }, "result": { "wait": { "remaining": 171.62155279517174, "completed": true } } }, { "path": "action/0/choose/0/sequence/2/repeat/sequence/1", "timestamp": "2026-01-14T08:58:15.653683+00:00", "changed_variables": { "wait": { "remaining": 171.49409340694547, "completed": true } }, "result": { "wait": { "remaining": 171.49409340694547, "completed": true } } }, { "path": "action/0/choose/0/sequence/2/repeat/sequence/1", "timestamp": "2026-01-14T09:01:09.085321+00:00", "changed_variables": { "wait": { "remaining": 174.58520187903196, "completed": true } }, "result": { "wait": { "remaining": 174.58520187903196, "completed": true } } }, { "path": "action/0/choose/0/sequence/2/repeat/sequence/1", "timestamp": "2026-01-14T09:03:34.754248+00:00", "changed_variables": { "wait": { "remaining": 172.51274369377643, "completed": true } }, "result": { "wait": { "remaining": 172.51274369377643, "completed": true } } }, { "path": "action/0/choose/0/sequence/2/repeat/sequence/1", "timestamp": "2026-01-14T09:06:09.473875+00:00", "changed_variables": { "wait": { "remaining": 175.49261107388884, "completed": true } }, "result": { "wait": { "remaining": 175.49261107388884, "completed": true } } }, { "path": "action/0/choose/0/sequence/2/repeat/sequence/1", "timestamp": "2026-01-14T09:09:28.106427+00:00", "changed_variables": { "wait": { "remaining": 165.90841644722968, "completed": true } }, "result": { "wait": { "remaining": 165.90841644722968, "completed": true } } }, { "path": "action/0/choose/0/sequence/2/repeat/sequence/1", "timestamp": "2026-01-14T09:12:42.426970+00:00", "changed_variables": { "wait": { "remaining": 168.81871295627207, "completed": true } }, "result": { "wait": { "remaining": 168.81871295627207, "completed": true } } }, { "path": "action/0/choose/0/sequence/2/repeat/sequence/1", "timestamp": "2026-01-14T09:12:53.609856+00:00", "changed_variables": { "wait": { "remaining": 0.0, "completed": false } }, "result": { "wait": { "remaining": 0.0, "completed": false } } } ], "action/0/choose/0/sequence/3": [ { "path": "action/0/choose/0/sequence/3", "timestamp": "2026-01-14T09:15:53.610581+00:00", "result": { "result": false } } ], "action/0/choose/0/sequence/3/entity_id/0": [ { "path": "action/0/choose/0/sequence/3/entity_id/0", "timestamp": "2026-01-14T09:15:53.610691+00:00", "result": { "result": false, "state": "off", "wanted_state": "on" } } ] }, "config": { "id": "1760174572626", "alias": "ESPHome Update Checker", "description": "Automatically update ESPHome Devices after ESPHome upgrade, and notify when they are updated.\n", "triggers": [ { "value_template": "{{ integration_entities('esphome')\n | select('match', '^update\\.')\n | select('is_state', 'on')\n | list | count > 0 }}\n", "trigger": "template" }, { "value_template": "{% set entities = states.update\n | selectattr('state', 'eq', 'on')\n | map(attribute='entity_id')\n | select('in', integration_entities('esphome'))\n | list | count %}\n{{ entities == 0 }}\n", "trigger": "template" }, { "event_type": "timer.finished", "event_data": { "entity_id": "timer.esphome_updates_timer" }, "trigger": "event" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ trigger is not none and trigger.platform == 'template' }}\n" }, { "condition": "state", "entity_id": "input_boolean.esp_update_manual", "state": "on" } ] } ], "sequence": [ { "data": { "duration": "00:05:00" }, "target": { "entity_id": "timer.esphome_updates_timer" }, "action": "timer.start" }, { "data": { "title": "ESPHome Devices", "message": "{% set entity = states.update\n | selectattr('state', 'eq', 'on')\n | map(attribute='entity_id')\n | select('in', integration_entities('esphome'))\n | first %}\n{% if entity %}\n Your ESPHome devices will now be updated from \n {{ state_attr(entity, \"installed_version\") }} \n to {{ state_attr(entity, \"latest_version\") }}.\n{% else %}\n No ESPHome updates found.\n{% endif %}\n" }, "action": "notify.mobile_app_iphone_van_willem" }, { "repeat": { "for_each": "{{ states.update\n | selectattr('state', 'eq', 'on')\n | map(attribute='entity_id')\n | select('in', integration_entities('esphome'))\n | list }}\n", "sequence": [ { "target": { "entity_id": "{{ repeat.item }}" }, "action": "update.install" }, { "wait_template": "{{ is_state(repeat.item, 'off') }}", "timeout": "00:03:00" } ] } }, { "condition": "state", "entity_id": "input_boolean.esp_update_manual", "state": "on" }, { "target": { "entity_id": "input_boolean.esp_update_manual" }, "action": "input_boolean.turn_off" } ] }, { "conditions": [ { "condition": "template", "value_template": "{% set entities = states.update\n | selectattr('state', 'eq', 'on')\n | map(attribute='entity_id')\n | select('in', integration_entities('esphome'))\n | list | count %}\n{{ entities == 0 }}\n" } ], "sequence": [ { "target": { "entity_id": "timer.esphome_updates_timer" }, "action": "timer.cancel" }, { "data": { "title": "ESPHome Devices", "message": "All ESPHome devices are now up to date." }, "action": "notify.mobile_app_iphone_van_willem" } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ trigger is not none and trigger.platform == 'event' }}" } ], "sequence": [ { "data": { "title": "ESPHome Devices", "message": "Some ESPHome devices may not have updated successfully. Please check the ESPHome Add-on logs.\n" }, "action": "notify.mobile_app_iphone_van_willem" } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEXTVSDG8QDVHHBT44SKTJ0P", "parent_id": "01KEXTVSDC4E5YP9ENNRWT6WZE", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/3/entity_id/0", "run_id": "5e4643acdfedb69ebdc05dc3bf2af199", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T08:44:54.576253+00:00", "finish": "2026-01-14T09:15:53.611653+00:00" }, "domain": "automation", "item_id": "1760174572626", "trigger": "update.meterkastinterface_firmware via template" } }, { "extended_dict": { "last_step": "trigger/2", "run_id": "76434e06dee729d60466e1b5ae3a28ff", "state": "stopped", "script_execution": "failed_single", "timestamp": { "start": "2026-01-14T08:49:54.000887+00:00", "finish": "2026-01-14T08:49:54.001130+00:00" }, "domain": "automation", "item_id": "1760174572626", "trigger": "event 'timer.finished'", "trace": { "trigger/2": [ { "path": "trigger/2", "timestamp": "2026-01-14T08:49:54.000936+00:00", "changed_variables": { "this": { "entity_id": "automation.esphome_update_checker", "state": "on", "attributes": { "id": "1760174572626", "last_triggered": "2026-01-14T08:44:54.576325+00:00", "mode": "single", "current": 1, "friendly_name": "ESPHome Update Checker" }, "last_changed": "2026-01-13T12:10:27.679828+00:00", "last_reported": "2026-01-14T08:44:54.576349+00:00", "last_updated": "2026-01-14T08:44:54.576349+00:00", "context": { "id": "01KEXTVSDG8QDVHHBT44SKTJ0P", "parent_id": "01KEXTVSDC4E5YP9ENNRWT6WZE", "user_id": null } }, "trigger": { "id": "2", "idx": "2", "alias": null, "platform": "event", "event": { "event_type": "timer.finished", "data": { "entity_id": "timer.esphome_updates_timer", "finished_at": "2026-01-14T08:49:54+00:00" }, "origin": "LOCAL", "time_fired": "2026-01-14T08:49:54.000759+00:00", "context": { "id": "01KEXV4XTGJ40E8J8A46VA1XC4", "parent_id": null, "user_id": null } }, "description": "event 'timer.finished'" } } } ] }, "config": { "id": "1760174572626", "alias": "ESPHome Update Checker", "description": "Automatically update ESPHome Devices after ESPHome upgrade, and notify when they are updated.\n", "triggers": [ { "value_template": "{{ integration_entities('esphome')\n | select('match', '^update\\.')\n | select('is_state', 'on')\n | list | count > 0 }}\n", "trigger": "template" }, { "value_template": "{% set entities = states.update\n | selectattr('state', 'eq', 'on')\n | map(attribute='entity_id')\n | select('in', integration_entities('esphome'))\n | list | count %}\n{{ entities == 0 }}\n", "trigger": "template" }, { "event_type": "timer.finished", "event_data": { "entity_id": "timer.esphome_updates_timer" }, "trigger": "event" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ trigger is not none and trigger.platform == 'template' }}\n" }, { "condition": "state", "entity_id": "input_boolean.esp_update_manual", "state": "on" } ] } ], "sequence": [ { "data": { "duration": "00:05:00" }, "target": { "entity_id": "timer.esphome_updates_timer" }, "action": "timer.start" }, { "data": { "title": "ESPHome Devices", "message": "{% set entity = states.update\n | selectattr('state', 'eq', 'on')\n | map(attribute='entity_id')\n | select('in', integration_entities('esphome'))\n | first %}\n{% if entity %}\n Your ESPHome devices will now be updated from \n {{ state_attr(entity, \"installed_version\") }} \n to {{ state_attr(entity, \"latest_version\") }}.\n{% else %}\n No ESPHome updates found.\n{% endif %}\n" }, "action": "notify.mobile_app_iphone_van_willem" }, { "repeat": { "for_each": "{{ states.update\n | selectattr('state', 'eq', 'on')\n | map(attribute='entity_id')\n | select('in', integration_entities('esphome'))\n | list }}\n", "sequence": [ { "target": { "entity_id": "{{ repeat.item }}" }, "action": "update.install" }, { "wait_template": "{{ is_state(repeat.item, 'off') }}", "timeout": "00:03:00" } ] } }, { "condition": "state", "entity_id": "input_boolean.esp_update_manual", "state": "on" }, { "target": { "entity_id": "input_boolean.esp_update_manual" }, "action": "input_boolean.turn_off" } ] }, { "conditions": [ { "condition": "template", "value_template": "{% set entities = states.update\n | selectattr('state', 'eq', 'on')\n | map(attribute='entity_id')\n | select('in', integration_entities('esphome'))\n | list | count %}\n{{ entities == 0 }}\n" } ], "sequence": [ { "target": { "entity_id": "timer.esphome_updates_timer" }, "action": "timer.cancel" }, { "data": { "title": "ESPHome Devices", "message": "All ESPHome devices are now up to date." }, "action": "notify.mobile_app_iphone_van_willem" } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ trigger is not none and trigger.platform == 'event' }}" } ], "sequence": [ { "data": { "title": "ESPHome Devices", "message": "Some ESPHome devices may not have updated successfully. Please check the ESPHome Add-on logs.\n" }, "action": "notify.mobile_app_iphone_van_willem" } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEXV4XTGQTFWGZ7RD74FDE89", "parent_id": "01KEXV4XTGJ40E8J8A46VA1XC4", "user_id": null } }, "short_dict": { "last_step": "trigger/2", "run_id": "76434e06dee729d60466e1b5ae3a28ff", "state": "stopped", "script_execution": "failed_single", "timestamp": { "start": "2026-01-14T08:49:54.000887+00:00", "finish": "2026-01-14T08:49:54.001130+00:00" }, "domain": "automation", "item_id": "1760174572626", "trigger": "event 'timer.finished'" } }, { "extended_dict": { "last_step": "trigger/1", "run_id": "1af9fe0e2baf3684254f05b33c83975f", "state": "stopped", "script_execution": "failed_single", "timestamp": { "start": "2026-01-14T09:12:53.608139+00:00", "finish": "2026-01-14T09:12:53.608326+00:00" }, "domain": "automation", "item_id": "1760174572626", "trigger": "update.aqs_slaapkamer_firmware via template", "trace": { "trigger/1": [ { "path": "trigger/1", "timestamp": "2026-01-14T09:12:53.608164+00:00", "changed_variables": { "this": { "entity_id": "automation.esphome_update_checker", "state": "on", "attributes": { "id": "1760174572626", "last_triggered": "2026-01-14T08:44:54.576325+00:00", "mode": "single", "current": 1, "friendly_name": "ESPHome Update Checker" }, "last_changed": "2026-01-13T12:10:27.679828+00:00", "last_reported": "2026-01-14T08:44:54.576349+00:00", "last_updated": "2026-01-14T08:44:54.576349+00:00", "context": { "id": "01KEXTVSDG8QDVHHBT44SKTJ0P", "parent_id": "01KEXTVSDC4E5YP9ENNRWT6WZE", "user_id": null } }, "trigger": { "platform": "template", "entity_id": "update.aqs_slaapkamer_firmware", "from_state": { "entity_id": "update.aqs_slaapkamer_firmware", "state": "on", "attributes": { "auto_update": false, "display_precision": 0, "installed_version": "2025.12.5", "in_progress": false, "latest_version": "2025.12.6", "release_summary": null, "release_url": "https://esphome.io/changelog/", "skipped_version": null, "title": "ESPHome", "update_percentage": null, "device_class": "firmware", "entity_picture": "https://brands.home-assistant.io/_/esphome/icon.png", "friendly_name": "Airquality Slaapkamer Willem Firmware", "supported_features": 1 }, "last_changed": "2026-01-14T08:44:54.574456+00:00", "last_reported": "2026-01-14T09:12:42.424255+00:00", "last_updated": "2026-01-14T09:12:42.424255+00:00", "context": { "id": "01KEXWEP5RVPAWJ2FM1S12JYQ0", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "update.aqs_slaapkamer_firmware", "state": "off", "attributes": { "auto_update": false, "display_precision": 0, "installed_version": "2025.12.6", "in_progress": false, "latest_version": "2025.12.6", "release_summary": null, "release_url": "https://esphome.io/changelog/", "skipped_version": null, "title": "ESPHome", "update_percentage": null, "device_class": "firmware", "entity_picture": "https://brands.home-assistant.io/_/esphome/icon.png", "friendly_name": "Airquality Slaapkamer Willem Firmware", "supported_features": 1 }, "last_changed": "2026-01-14T09:12:53.604158+00:00", "last_reported": "2026-01-14T09:12:53.604158+00:00", "last_updated": "2026-01-14T09:12:53.604158+00:00", "context": { "id": "01KEXWF1348NZJ45XQAWQCX9MF", "parent_id": null, "user_id": null } }, "id": "1", "idx": "1", "alias": null, "for": null, "description": "update.aqs_slaapkamer_firmware via template" } } } ] }, "config": { "id": "1760174572626", "alias": "ESPHome Update Checker", "description": "Automatically update ESPHome Devices after ESPHome upgrade, and notify when they are updated.\n", "triggers": [ { "value_template": "{{ integration_entities('esphome')\n | select('match', '^update\\.')\n | select('is_state', 'on')\n | list | count > 0 }}\n", "trigger": "template" }, { "value_template": "{% set entities = states.update\n | selectattr('state', 'eq', 'on')\n | map(attribute='entity_id')\n | select('in', integration_entities('esphome'))\n | list | count %}\n{{ entities == 0 }}\n", "trigger": "template" }, { "event_type": "timer.finished", "event_data": { "entity_id": "timer.esphome_updates_timer" }, "trigger": "event" } ], "conditions": [], "actions": [ { "choose": [ { "conditions": [ { "condition": "or", "conditions": [ { "condition": "template", "value_template": "{{ trigger is not none and trigger.platform == 'template' }}\n" }, { "condition": "state", "entity_id": "input_boolean.esp_update_manual", "state": "on" } ] } ], "sequence": [ { "data": { "duration": "00:05:00" }, "target": { "entity_id": "timer.esphome_updates_timer" }, "action": "timer.start" }, { "data": { "title": "ESPHome Devices", "message": "{% set entity = states.update\n | selectattr('state', 'eq', 'on')\n | map(attribute='entity_id')\n | select('in', integration_entities('esphome'))\n | first %}\n{% if entity %}\n Your ESPHome devices will now be updated from \n {{ state_attr(entity, \"installed_version\") }} \n to {{ state_attr(entity, \"latest_version\") }}.\n{% else %}\n No ESPHome updates found.\n{% endif %}\n" }, "action": "notify.mobile_app_iphone_van_willem" }, { "repeat": { "for_each": "{{ states.update\n | selectattr('state', 'eq', 'on')\n | map(attribute='entity_id')\n | select('in', integration_entities('esphome'))\n | list }}\n", "sequence": [ { "target": { "entity_id": "{{ repeat.item }}" }, "action": "update.install" }, { "wait_template": "{{ is_state(repeat.item, 'off') }}", "timeout": "00:03:00" } ] } }, { "condition": "state", "entity_id": "input_boolean.esp_update_manual", "state": "on" }, { "target": { "entity_id": "input_boolean.esp_update_manual" }, "action": "input_boolean.turn_off" } ] }, { "conditions": [ { "condition": "template", "value_template": "{% set entities = states.update\n | selectattr('state', 'eq', 'on')\n | map(attribute='entity_id')\n | select('in', integration_entities('esphome'))\n | list | count %}\n{{ entities == 0 }}\n" } ], "sequence": [ { "target": { "entity_id": "timer.esphome_updates_timer" }, "action": "timer.cancel" }, { "data": { "title": "ESPHome Devices", "message": "All ESPHome devices are now up to date." }, "action": "notify.mobile_app_iphone_van_willem" } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ trigger is not none and trigger.platform == 'event' }}" } ], "sequence": [ { "data": { "title": "ESPHome Devices", "message": "Some ESPHome devices may not have updated successfully. Please check the ESPHome Add-on logs.\n" }, "action": "notify.mobile_app_iphone_van_willem" } ] } ] } ], "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEXWF138C4GRDB3NQ0JWG217", "parent_id": "01KEXWF1348NZJ45XQAWQCX9MF", "user_id": null } }, "short_dict": { "last_step": "trigger/1", "run_id": "1af9fe0e2baf3684254f05b33c83975f", "state": "stopped", "script_execution": "failed_single", "timestamp": { "start": "2026-01-14T09:12:53.608139+00:00", "finish": "2026-01-14T09:12:53.608326+00:00" }, "domain": "automation", "item_id": "1760174572626", "trigger": "update.aqs_slaapkamer_firmware via template" } } ], "automation.1759405814831": [ { "extended_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/0", "run_id": "dc185af44931633f425b9b4fed364f97", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T09:12:40.666054+00:00", "finish": "2026-01-14T09:12:40.794179+00:00" }, "domain": "automation", "item_id": "1759405814831", "trigger": "event 'zwave_js_value_notification'", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T09:12:40.666084+00:00", "changed_variables": { "this": { "entity_id": "automation.schakelaar_kantoor_bp", "state": "on", "attributes": { "id": "1759405814831", "last_triggered": "2026-01-11T12:57:59.950066+00:00", "mode": "restart", "current": 0, "friendly_name": "schakelaar kids [BP]" }, "last_changed": "2026-01-13T12:10:27.679329+00:00", "last_reported": "2026-01-13T12:10:27.679329+00:00", "last_updated": "2026-01-13T12:10:27.679329+00:00", "context": { "id": "01KEVM7EEZSD7E4VKSWJKFDGR6", "parent_id": null, "user_id": null } }, "trigger": { "id": "button1_single", "idx": "0", "alias": null, "platform": "event", "event": { "event_type": "zwave_js_value_notification", "data": { "domain": "zwave_js", "node_id": 6, "home_id": 3411084647, "endpoint": 0, "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "command_class_name": "Central Scene", "label": "Scene 001", "property": "scene", "property_name": "scene", "property_key": "001", "property_key_name": "001", "value": 0, "value_raw": 0 }, "origin": "LOCAL", "time_fired": "2026-01-14T09:12:40.665817+00:00", "context": { "id": "01KEXWEMESCSJ3GRTE1SGE5EJV", "parent_id": null, "user_id": null } }, "description": "event 'zwave_js_value_notification'" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T09:12:40.666319+00:00", "changed_variables": { "context": { "id": "01KEXWEMET42HF3FR4KBAK6JWY", "parent_id": "01KEXWEMESCSJ3GRTE1SGE5EJV", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T09:12:40.666447+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T09:12:40.666474+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-14T09:12:40.666633+00:00", "result": { "choice": 0 } } ], "action/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-14T09:12:40.666767+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-14T09:12:40.666798+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/sequence/0", "timestamp": "2026-01-14T09:12:40.666874+00:00", "result": { "params": { "domain": "light", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "light.lamp_kantoor" ] } }, "running_script": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "triggers": [ { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "001", "value": 0 }, "id": "button1_single" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "001", "value": 3 }, "id": "button1_double" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "001", "value": 2 }, "id": "button1_hold" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "005", "value": 0 }, "id": "button2_single" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "005", "value": 3 }, "id": "button2_double" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "005", "value": 2 }, "id": "button2_hold" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "002", "value": 0 }, "id": "button3_single" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "002", "value": 3 }, "id": "button3_double" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "002", "value": 2 }, "id": "button3_hold" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "006", "value": 0 }, "id": "button4_single" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "006", "value": 3 }, "id": "button4_double" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "006", "value": 2 }, "id": "button4_hold" } ], "actions": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ True }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": "button1_single" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "light.lamp_kantoor" } } ] }, { "conditions": [ { "condition": "trigger", "id": "button1_double" } ], "sequence": [ { "action": "light.turn_on", "data": { "brightness_pct": 100 }, "target": { "entity_id": "light.lamp_kantoor" } } ] }, { "conditions": [ { "condition": "trigger", "id": "button1_hold" } ], "sequence": [ { "repeat": { "sequence": [ { "action": "light.turn_on", "data": { "brightness_step_pct": 10 }, "target": { "entity_id": "light.lamp_kantoor" } }, { "delay": "00:00:0.5" } ], "until": [] } } ] }, { "conditions": [ { "condition": "trigger", "id": "button2_single" } ], "sequence": [ { "action": "light.turn_off", "target": { "entity_id": "light.lamp_kantoor" } } ] }, { "conditions": [ { "condition": "trigger", "id": "button2_double" } ], "sequence": [ { "action": "light.turn_on", "data": { "brightness_pct": 50 }, "target": { "entity_id": "light.lamp_kantoor" } } ] }, { "conditions": [ { "condition": "trigger", "id": "button2_hold" } ], "sequence": [ { "repeat": { "sequence": [ { "action": "light.turn_on", "data": { "brightness_step_pct": -10 }, "target": { "entity_id": "light.lamp_kantoor" } }, { "delay": "00:00:0.5" } ], "until": [] } } ] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ True }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": "button1_single" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button1_double" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button1_hold" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button2_single" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button2_double" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button2_hold" } ], "sequence": [] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ True }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": "button3_single" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "light.lamp_kantoor" } } ] }, { "conditions": [ { "condition": "trigger", "id": "button3_double" } ], "sequence": [ { "action": "light.turn_on", "data": { "brightness_pct": 100 }, "target": { "entity_id": "light.lamp_kantoor" } } ] }, { "conditions": [ { "condition": "trigger", "id": "button3_hold" } ], "sequence": [ { "repeat": { "sequence": [ { "action": "light.turn_on", "data": { "brightness_step_pct": 10 }, "target": { "entity_id": "light.lamp_kantoor" } }, { "delay": "00:00:0.5" } ], "until": [] } } ] }, { "conditions": [ { "condition": "trigger", "id": "button4_single" } ], "sequence": [ { "action": "light.turn_off", "target": { "entity_id": "light.lamp_kantoor" } } ] }, { "conditions": [ { "condition": "trigger", "id": "button4_double" } ], "sequence": [ { "action": "light.turn_on", "data": { "brightness_pct": 50 }, "target": { "entity_id": "light.lamp_kantoor" } } ] }, { "conditions": [ { "condition": "trigger", "id": "button4_hold" } ], "sequence": [ { "repeat": { "sequence": [ { "action": "light.turn_on", "data": { "brightness_step_pct": -10 }, "target": { "entity_id": "light.lamp_kantoor" } }, { "delay": "00:00:0.5" } ], "until": [] } } ] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ True }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": "button3_single" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button3_double" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button3_hold" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button4_single" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button4_double" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button4_hold" } ], "sequence": [] } ] } ] } ] } ], "id": "1759405814831", "alias": "schakelaar kids [BP]", "description": "" }, "blueprint_inputs": { "id": "1759405814831", "alias": "schakelaar kids [BP]", "description": "", "use_blueprint": { "path": "willumpie82/zwaveMe-WALLC-S.yaml", "input": { "remote_device": "56365bed8316580baab74c57791f8e4a", "left_light": "light.lamp_kantoor", "right_light": "light.lamp_kantoor", "device": "56365bed8316580baab74c57791f8e4a", "left_lamp": "light.lamp_kantoor", "right_mode": "lamp", "right_lamp": "light.lamp_kantoor", "zwave_device": "56365bed8316580baab74c57791f8e4a" } } }, "context": { "id": "01KEXWEMET42HF3FR4KBAK6JWY", "parent_id": "01KEXWEMESCSJ3GRTE1SGE5EJV", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0/choose/0/sequence/0", "run_id": "dc185af44931633f425b9b4fed364f97", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T09:12:40.666054+00:00", "finish": "2026-01-14T09:12:40.794179+00:00" }, "domain": "automation", "item_id": "1759405814831", "trigger": "event 'zwave_js_value_notification'" } }, { "extended_dict": { "last_step": "action/0/choose/0/sequence/0/choose/3/sequence/0", "run_id": "00c0ee9f87d1908bb0cefa296dfcae5f", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T09:47:13.384934+00:00", "finish": "2026-01-14T09:47:13.460925+00:00" }, "domain": "automation", "item_id": "1759405814831", "trigger": "event 'zwave_js_value_notification'", "trace": { "trigger/3": [ { "path": "trigger/3", "timestamp": "2026-01-14T09:47:13.384962+00:00", "changed_variables": { "this": { "entity_id": "automation.schakelaar_kantoor_bp", "state": "on", "attributes": { "id": "1759405814831", "last_triggered": "2026-01-14T09:12:40.666138+00:00", "mode": "restart", "current": 0, "friendly_name": "schakelaar kids [BP]" }, "last_changed": "2026-01-13T12:10:27.679329+00:00", "last_reported": "2026-01-14T09:12:40.793541+00:00", "last_updated": "2026-01-14T09:12:40.793541+00:00", "context": { "id": "01KEXWEMET42HF3FR4KBAK6JWY", "parent_id": "01KEXWEMESCSJ3GRTE1SGE5EJV", "user_id": null } }, "trigger": { "id": "button2_single", "idx": "3", "alias": null, "platform": "event", "event": { "event_type": "zwave_js_value_notification", "data": { "domain": "zwave_js", "node_id": 6, "home_id": 3411084647, "endpoint": 0, "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "command_class_name": "Central Scene", "label": "Scene 005", "property": "scene", "property_name": "scene", "property_key": "005", "property_key_name": "005", "value": 0, "value_raw": 0 }, "origin": "LOCAL", "time_fired": "2026-01-14T09:47:13.384780+00:00", "context": { "id": "01KEXYDWK8KQB2MC8TFY9ABNHQ", "parent_id": null, "user_id": null } }, "description": "event 'zwave_js_value_notification'" } } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T09:47:13.385190+00:00", "changed_variables": { "context": { "id": "01KEXYDWK81AX4N179KE5HXGFW", "parent_id": "01KEXYDWK8KQB2MC8TFY9ABNHQ", "user_id": null } }, "result": { "choice": 0 } } ], "action/0/choose/0": [ { "path": "action/0/choose/0", "timestamp": "2026-01-14T09:47:13.385246+00:00", "result": { "result": true } } ], "action/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/conditions/0", "timestamp": "2026-01-14T09:47:13.385273+00:00", "result": { "result": true, "entities": [] } } ], "action/0/choose/0/sequence/0": [ { "path": "action/0/choose/0/sequence/0", "timestamp": "2026-01-14T09:47:13.385414+00:00", "result": { "choice": 3 } } ], "action/0/choose/0/sequence/0/choose/0": [ { "path": "action/0/choose/0/sequence/0/choose/0", "timestamp": "2026-01-14T09:47:13.385443+00:00", "result": { "result": false } } ], "action/0/choose/0/sequence/0/choose/0/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/0/conditions/0", "timestamp": "2026-01-14T09:47:13.385463+00:00", "result": { "result": false } } ], "action/0/choose/0/sequence/0/choose/1": [ { "path": "action/0/choose/0/sequence/0/choose/1", "timestamp": "2026-01-14T09:47:13.385493+00:00", "result": { "result": false } } ], "action/0/choose/0/sequence/0/choose/1/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/1/conditions/0", "timestamp": "2026-01-14T09:47:13.385509+00:00", "result": { "result": false } } ], "action/0/choose/0/sequence/0/choose/2": [ { "path": "action/0/choose/0/sequence/0/choose/2", "timestamp": "2026-01-14T09:47:13.385535+00:00", "result": { "result": false } } ], "action/0/choose/0/sequence/0/choose/2/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/2/conditions/0", "timestamp": "2026-01-14T09:47:13.385550+00:00", "result": { "result": false } } ], "action/0/choose/0/sequence/0/choose/3": [ { "path": "action/0/choose/0/sequence/0/choose/3", "timestamp": "2026-01-14T09:47:13.385575+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/3/conditions/0": [ { "path": "action/0/choose/0/sequence/0/choose/3/conditions/0", "timestamp": "2026-01-14T09:47:13.385590+00:00", "result": { "result": true } } ], "action/0/choose/0/sequence/0/choose/3/sequence/0": [ { "path": "action/0/choose/0/sequence/0/choose/3/sequence/0", "timestamp": "2026-01-14T09:47:13.385660+00:00", "result": { "params": { "domain": "light", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.lamp_kantoor" ] } }, "running_script": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "triggers": [ { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "001", "value": 0 }, "id": "button1_single" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "001", "value": 3 }, "id": "button1_double" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "001", "value": 2 }, "id": "button1_hold" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "005", "value": 0 }, "id": "button2_single" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "005", "value": 3 }, "id": "button2_double" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "005", "value": 2 }, "id": "button2_hold" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "002", "value": 0 }, "id": "button3_single" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "002", "value": 3 }, "id": "button3_double" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "002", "value": 2 }, "id": "button3_hold" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "006", "value": 0 }, "id": "button4_single" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "006", "value": 3 }, "id": "button4_double" }, { "trigger": "event", "event_type": "zwave_js_value_notification", "event_data": { "device_id": "56365bed8316580baab74c57791f8e4a", "command_class": 91, "property": "scene", "property_key": "006", "value": 2 }, "id": "button4_hold" } ], "actions": [ { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ True }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": "button1_single" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "light.lamp_kantoor" } } ] }, { "conditions": [ { "condition": "trigger", "id": "button1_double" } ], "sequence": [ { "action": "light.turn_on", "data": { "brightness_pct": 100 }, "target": { "entity_id": "light.lamp_kantoor" } } ] }, { "conditions": [ { "condition": "trigger", "id": "button1_hold" } ], "sequence": [ { "repeat": { "sequence": [ { "action": "light.turn_on", "data": { "brightness_step_pct": 10 }, "target": { "entity_id": "light.lamp_kantoor" } }, { "delay": "00:00:0.5" } ], "until": [] } } ] }, { "conditions": [ { "condition": "trigger", "id": "button2_single" } ], "sequence": [ { "action": "light.turn_off", "target": { "entity_id": "light.lamp_kantoor" } } ] }, { "conditions": [ { "condition": "trigger", "id": "button2_double" } ], "sequence": [ { "action": "light.turn_on", "data": { "brightness_pct": 50 }, "target": { "entity_id": "light.lamp_kantoor" } } ] }, { "conditions": [ { "condition": "trigger", "id": "button2_hold" } ], "sequence": [ { "repeat": { "sequence": [ { "action": "light.turn_on", "data": { "brightness_step_pct": -10 }, "target": { "entity_id": "light.lamp_kantoor" } }, { "delay": "00:00:0.5" } ], "until": [] } } ] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ True }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": "button1_single" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button1_double" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button1_hold" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button2_single" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button2_double" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button2_hold" } ], "sequence": [] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ True }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": "button3_single" } ], "sequence": [ { "action": "light.turn_on", "target": { "entity_id": "light.lamp_kantoor" } } ] }, { "conditions": [ { "condition": "trigger", "id": "button3_double" } ], "sequence": [ { "action": "light.turn_on", "data": { "brightness_pct": 100 }, "target": { "entity_id": "light.lamp_kantoor" } } ] }, { "conditions": [ { "condition": "trigger", "id": "button3_hold" } ], "sequence": [ { "repeat": { "sequence": [ { "action": "light.turn_on", "data": { "brightness_step_pct": 10 }, "target": { "entity_id": "light.lamp_kantoor" } }, { "delay": "00:00:0.5" } ], "until": [] } } ] }, { "conditions": [ { "condition": "trigger", "id": "button4_single" } ], "sequence": [ { "action": "light.turn_off", "target": { "entity_id": "light.lamp_kantoor" } } ] }, { "conditions": [ { "condition": "trigger", "id": "button4_double" } ], "sequence": [ { "action": "light.turn_on", "data": { "brightness_pct": 50 }, "target": { "entity_id": "light.lamp_kantoor" } } ] }, { "conditions": [ { "condition": "trigger", "id": "button4_hold" } ], "sequence": [ { "repeat": { "sequence": [ { "action": "light.turn_on", "data": { "brightness_step_pct": -10 }, "target": { "entity_id": "light.lamp_kantoor" } }, { "delay": "00:00:0.5" } ], "until": [] } } ] } ] } ] }, { "conditions": [ { "condition": "template", "value_template": "{{ True }}" } ], "sequence": [ { "choose": [ { "conditions": [ { "condition": "trigger", "id": "button3_single" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button3_double" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button3_hold" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button4_single" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button4_double" } ], "sequence": [] }, { "conditions": [ { "condition": "trigger", "id": "button4_hold" } ], "sequence": [] } ] } ] } ] } ], "id": "1759405814831", "alias": "schakelaar kids [BP]", "description": "" }, "blueprint_inputs": { "id": "1759405814831", "alias": "schakelaar kids [BP]", "description": "", "use_blueprint": { "path": "willumpie82/zwaveMe-WALLC-S.yaml", "input": { "remote_device": "56365bed8316580baab74c57791f8e4a", "left_light": "light.lamp_kantoor", "right_light": "light.lamp_kantoor", "device": "56365bed8316580baab74c57791f8e4a", "left_lamp": "light.lamp_kantoor", "right_mode": "lamp", "right_lamp": "light.lamp_kantoor", "zwave_device": "56365bed8316580baab74c57791f8e4a" } } }, "context": { "id": "01KEXYDWK81AX4N179KE5HXGFW", "parent_id": "01KEXYDWK8KQB2MC8TFY9ABNHQ", "user_id": null } }, "short_dict": { "last_step": "action/0/choose/0/sequence/0/choose/3/sequence/0", "run_id": "00c0ee9f87d1908bb0cefa296dfcae5f", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T09:47:13.384934+00:00", "finish": "2026-01-14T09:47:13.460925+00:00" }, "domain": "automation", "item_id": "1759405814831", "trigger": "event 'zwave_js_value_notification'" } } ], "automation.1755418937534": [ { "extended_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "89a08542db5974fedc8eb04071e3c4ab", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T10:07:24.325233+00:00", "finish": "2026-01-14T10:10:51.332313+00:00" }, "domain": "automation", "item_id": "1755418937534", "trigger": "state of binary_sensor.everything_presence_one_7f7364_pir", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T10:07:24.325379+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_meterkast", "state": "on", "attributes": { "id": "1755418937534", "last_triggered": "2026-01-12T07:43:51.820594+00:00", "mode": "restart", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Meterkast [BP]" }, "last_changed": "2026-01-13T12:10:27.678358+00:00", "last_reported": "2026-01-13T12:10:27.678358+00:00", "last_updated": "2026-01-13T12:10:27.678358+00:00", "context": { "id": "01KEVM7EEYV0NJ4WKG1RHTYFJW", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "from_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T09:03:45.015808+00:00", "last_reported": "2026-01-14T09:03:45.015808+00:00", "last_updated": "2026-01-14T09:03:45.015808+00:00", "context": { "id": "01KEXVY9BQT5SZBFANGE6XW56D", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T10:07:24.323509+00:00", "last_reported": "2026-01-14T10:07:24.323509+00:00", "last_updated": "2026-01-14T10:07:24.323509+00:00", "context": { "id": "01KEXZJV53Z0174NSM4AQ8ZTG8", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.everything_presence_one_7f7364_pir" }, "target_entity": "light.lamp_meterkast", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.beweging_meterkast_timer", "entity_domain": "light", "turn_off_blocker_entity": null, "target_off_entity": null, "sun_condition": "Always" } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T10:07:24.325398+00:00", "result": { "result": true, "entities": [ "light.lamp_meterkast" ] } } ], "condition/1": [ { "path": "condition/1", "timestamp": "2026-01-14T10:07:24.325489+00:00", "result": { "result": true, "entities": [] } } ], "condition/2": [ { "path": "condition/2", "timestamp": "2026-01-14T10:07:24.325537+00:00", "result": { "result": true, "entities": [] } } ], "condition/3": [ { "path": "condition/3", "timestamp": "2026-01-14T10:07:24.325655+00:00", "result": { "result": true, "entities": [ "sun.sun" ] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T10:07:24.325926+00:00", "changed_variables": { "context": { "id": "01KEXZJV55A47Z35VJV12P29GD", "parent_id": "01KEXZJV53Z0174NSM4AQ8ZTG8", "user_id": null } }, "result": { "params": { "domain": "homeassistant", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "light.lamp_meterkast" ] } }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-14T10:07:24.447783+00:00", "changed_variables": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "from_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T10:07:24.323509+00:00", "last_reported": "2026-01-14T10:07:24.323509+00:00", "last_updated": "2026-01-14T10:07:24.323509+00:00", "context": { "id": "01KEXZJV53Z0174NSM4AQ8ZTG8", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T10:07:51.207353+00:00", "last_reported": "2026-01-14T10:07:51.207353+00:00", "last_updated": "2026-01-14T10:07:51.207353+00:00", "context": { "id": "01KEXZKND7PKSBMXZVFPPCPSSK", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.everything_presence_one_7f7364_pir" } } }, "result": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "from_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T10:07:24.323509+00:00", "last_reported": "2026-01-14T10:07:24.323509+00:00", "last_updated": "2026-01-14T10:07:24.323509+00:00", "context": { "id": "01KEXZJV53Z0174NSM4AQ8ZTG8", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T10:07:51.207353+00:00", "last_reported": "2026-01-14T10:07:51.207353+00:00", "last_updated": "2026-01-14T10:07:51.207353+00:00", "context": { "id": "01KEXZKND7PKSBMXZVFPPCPSSK", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.everything_presence_one_7f7364_pir" } } } } ], "action/2": [ { "path": "action/2", "timestamp": "2026-01-14T10:07:51.209961+00:00", "result": { "choice": 2 } } ], "action/2/choose/0": [ { "path": "action/2/choose/0", "timestamp": "2026-01-14T10:07:51.210231+00:00", "result": { "result": false } } ], "action/2/choose/0/conditions/0": [ { "path": "action/2/choose/0/conditions/0", "timestamp": "2026-01-14T10:07:51.210305+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/1": [ { "path": "action/2/choose/1", "timestamp": "2026-01-14T10:07:51.210525+00:00", "result": { "result": false } } ], "action/2/choose/1/conditions/0": [ { "path": "action/2/choose/1/conditions/0", "timestamp": "2026-01-14T10:07:51.210567+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/2": [ { "path": "action/2/choose/2", "timestamp": "2026-01-14T10:07:51.210666+00:00", "result": { "result": true } } ], "action/2/choose/2/conditions/0": [ { "path": "action/2/choose/2/conditions/0", "timestamp": "2026-01-14T10:07:51.210702+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/0": [ { "path": "action/2/choose/2/sequence/0", "timestamp": "2026-01-14T10:07:51.210912+00:00", "result": { "delay": 180.0, "done": true } } ], "action/2/choose/2/sequence/1": [ { "path": "action/2/choose/2/sequence/1", "timestamp": "2026-01-14T10:10:51.212472+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/2": [ { "path": "action/2/choose/2/sequence/2", "timestamp": "2026-01-14T10:10:51.212731+00:00", "result": { "params": { "domain": "homeassistant", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.lamp_meterkast" ] } }, "running_script": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "target_entity": "light.lamp_meterkast", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.beweging_meterkast_timer", "entity_domain": "{{ states[target_entity].domain }}", "turn_off_blocker_entity": null, "target_off_entity": null, "sun_condition": "Always" }, "triggers": { "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "to": "on" }, "actions": [ { "entity_id": "light.lamp_meterkast", "action": "homeassistant.turn_on" }, { "wait_for_trigger": { "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "from": "on", "to": "off" } }, { "choose": [ { "alias": "Motion wait not defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity == none }}" } ], "sequence": [ { "entity_id": "light.lamp_meterkast", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait not defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity != none }}" } ], "sequence": [ { "entity_id": null, "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity == none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": "light.lamp_meterkast", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity != none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": null, "action": "homeassistant.turn_off" } ] } ] } ], "conditions": [ { "condition": "template", "alias": "Check for illuminance conditions", "value_template": "{% set illuminance_defined = illuminance_currently != none and illuminance_cutoff != none %} {% set illuminance_defined_and_low = (illuminance_defined and (states(illuminance_currently) | int(0) < states(illuminance_cutoff) | int(0))) %}\n{% set target_entity_domain_supports_on_state_check = entity_domain != 'scene' and entity_domain != 'script' %} {% set target_entity_is_scene = entity_domain == 'scene' %} {% set scene_target_entities = state_attr(target_entity, 'entity_id') %} {% set singular_scene_entity_is_on = scene_target_entities is not none and scene_target_entities | count == 1 and scene_target_entities | first == 'on' %} {{ ( target_entity_domain_supports_on_state_check and states(target_entity) == 'on') or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and not illuminance_defined) or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and not illuminance_defined) or ( target_entity_is_scene and singular_scene_entity_is_on) }}\n" }, { "condition": "template", "alias": "Check for blocker entity", "value_template": "{{ (blocker_entity == none) or (states(blocker_entity) == 'off') }}" }, { "condition": "template", "alias": "Check for time limits", "value_template": "{% set current_time = now().strftime(\"%H:%M\") %}\n{% if time_limit_before == none and time_limit_after == none %} true {% endif %}\n{% if time_limit_before != none and time_limit_after == none %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {{ current_time_is_before_limit }} {% elif time_limit_before == none and time_limit_after != none %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {{ current_time_is_after_limit }} {% endif %}\n{% if time_limit_before != none and time_limit_after != none %} {% set before_limit_is_tomorrow = states(time_limit_before) < states(time_limit_after) %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {% set time_window_spans_midnight = states(time_limit_after) > states(time_limit_before) %}\n {% if time_window_spans_midnight != none and time_window_spans_midnight and before_limit_is_tomorrow %}\n {{ current_time_is_after_limit or current_time_is_before_limit }}\n {% elif time_window_spans_midnight != none and not time_window_spans_midnight %}\n {{ current_time_is_before_limit and current_time_is_after_limit }}\n {% endif %}\n{% endif %}\n" }, { "condition": "template", "alias": "Check for sun state", "value_template": "{# Prevent breaking when no sun condition is set in existing automations #} {% if not sun_condition is defined %} {% set sun_condition = 'Always' %} {% endif %} {# Get current sun state #} {% set current_sun_condition = states['sun.sun'].state %}\n{# Checks for current sun state #} {% set sun_state_is_below_horizon = current_sun_condition == 'below_horizon' %} {% set sun_state_is_above_horizon = current_sun_condition == 'above_horizon' %}\n{# Check to see if a condition for sunstate is set by user #} {% set no_sun_condition = sun_condition is defined and sun_condition == 'Always' %} {# Check to see if the user wants automation to trigger below horizon #} {% set sun_condition_is_below_horizon = sun_condition == 'Below horizon' %} {# Check to see if the user wants automation to trigger above horizon #} {% set sun_condition_is_above_horizon = sun_condition == 'Above horizon' %}\n{# Checks to see if sunstate matches up with users condition #} {% set sun_condition_below_horizon_match = sun_state_is_below_horizon and sun_condition_is_below_horizon %} {% set sun_condition_above_horizon_match = sun_state_is_above_horizon and sun_condition_is_above_horizon %} {% set sun_condition_matching = sun_condition_below_horizon_match or sun_condition_above_horizon_match or no_sun_condition %} {{ sun_condition_matching }}\n{# Debug values: (uncomment to check in template dev tool) ## Set at top of template: {% set sun_condition = 'Above horizon' %} Current sun condition: {{current_sun_condition}} Sun state is below horizon: {{ sun_state_is_below_horizon }} Sun state is above horizon: {{ sun_state_is_above_horizon }} Sun condition is set to always: {{ sun_condition_always }} Sun condition is below horizon: {{ sun_condition_is_below_horizon }} Sun condition is above horizon: {{ sun_condition_is_above_horizon }} Sun condition is below horizon match: {{ sun_condition_below_horizon_match }} Sun condition is above horizon match: {{ sun_condition_above_horizon_match }} Sun condition is a match: {{ sun_condition_matching }} #}\n" } ], "id": "1755418937534", "alias": "Beweging meterkast", "description": "" }, "blueprint_inputs": { "id": "1755418937534", "alias": "Beweging meterkast", "description": "", "use_blueprint": { "path": "freakshock88/motion_illuminance_activated_entity.yaml", "input": { "motion_sensor": "binary_sensor.everything_presence_one_7f7364_pir", "target_entity": "light.lamp_meterkast", "no_motion_wait": "input_number.beweging_meterkast_timer" } } }, "context": { "id": "01KEXZJV55A47Z35VJV12P29GD", "parent_id": "01KEXZJV53Z0174NSM4AQ8ZTG8", "user_id": null } }, "short_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "89a08542db5974fedc8eb04071e3c4ab", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T10:07:24.325233+00:00", "finish": "2026-01-14T10:10:51.332313+00:00" }, "domain": "automation", "item_id": "1755418937534", "trigger": "state of binary_sensor.everything_presence_one_7f7364_pir" } }, { "extended_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "23a7bc3c464bf6586f697b69fccc9e83", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T13:52:46.719319+00:00", "finish": "2026-01-14T13:56:30.159260+00:00" }, "domain": "automation", "item_id": "1755418937534", "trigger": "state of binary_sensor.everything_presence_one_7f7364_pir", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T13:52:46.719497+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_meterkast", "state": "on", "attributes": { "id": "1755418937534", "last_triggered": "2026-01-14T10:07:24.325766+00:00", "mode": "restart", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Meterkast [BP]" }, "last_changed": "2026-01-13T12:10:27.678358+00:00", "last_reported": "2026-01-14T10:10:51.330457+00:00", "last_updated": "2026-01-14T10:10:51.330457+00:00", "context": { "id": "01KEXZS5A22XZVZ8QZC4PY1TG4", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "from_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T10:07:51.207353+00:00", "last_reported": "2026-01-14T10:07:51.207353+00:00", "last_updated": "2026-01-14T10:07:51.207353+00:00", "context": { "id": "01KEXZKND7PKSBMXZVFPPCPSSK", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T13:52:46.716228+00:00", "last_reported": "2026-01-14T13:52:46.716228+00:00", "last_updated": "2026-01-14T13:52:46.716228+00:00", "context": { "id": "01KEYCFGKWVQPCVAM2VWJ11B5T", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.everything_presence_one_7f7364_pir" }, "target_entity": "light.lamp_meterkast", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.beweging_meterkast_timer", "entity_domain": "light", "turn_off_blocker_entity": null, "target_off_entity": null, "sun_condition": "Always" } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T13:52:46.719531+00:00", "result": { "result": true, "entities": [ "light.lamp_meterkast" ] } } ], "condition/1": [ { "path": "condition/1", "timestamp": "2026-01-14T13:52:46.719677+00:00", "result": { "result": true, "entities": [] } } ], "condition/2": [ { "path": "condition/2", "timestamp": "2026-01-14T13:52:46.719760+00:00", "result": { "result": true, "entities": [] } } ], "condition/3": [ { "path": "condition/3", "timestamp": "2026-01-14T13:52:46.719920+00:00", "result": { "result": true, "entities": [ "sun.sun" ] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T13:52:46.720374+00:00", "changed_variables": { "context": { "id": "01KEYCFGKZP735DBRZDPAX89E5", "parent_id": "01KEYCFGKWVQPCVAM2VWJ11B5T", "user_id": null } }, "result": { "params": { "domain": "homeassistant", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "light.lamp_meterkast" ] } }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-14T13:52:46.827849+00:00", "changed_variables": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "from_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T13:52:46.716228+00:00", "last_reported": "2026-01-14T13:52:46.716228+00:00", "last_updated": "2026-01-14T13:52:46.716228+00:00", "context": { "id": "01KEYCFGKWVQPCVAM2VWJ11B5T", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T13:53:30.030995+00:00", "last_reported": "2026-01-14T13:53:30.030995+00:00", "last_updated": "2026-01-14T13:53:30.030995+00:00", "context": { "id": "01KEYCGTXEQERAFZJTAE4JPB8X", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.everything_presence_one_7f7364_pir" } } }, "result": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "from_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T13:52:46.716228+00:00", "last_reported": "2026-01-14T13:52:46.716228+00:00", "last_updated": "2026-01-14T13:52:46.716228+00:00", "context": { "id": "01KEYCFGKWVQPCVAM2VWJ11B5T", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T13:53:30.030995+00:00", "last_reported": "2026-01-14T13:53:30.030995+00:00", "last_updated": "2026-01-14T13:53:30.030995+00:00", "context": { "id": "01KEYCGTXEQERAFZJTAE4JPB8X", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.everything_presence_one_7f7364_pir" } } } } ], "action/2": [ { "path": "action/2", "timestamp": "2026-01-14T13:53:30.033019+00:00", "result": { "choice": 2 } } ], "action/2/choose/0": [ { "path": "action/2/choose/0", "timestamp": "2026-01-14T13:53:30.033101+00:00", "result": { "result": false } } ], "action/2/choose/0/conditions/0": [ { "path": "action/2/choose/0/conditions/0", "timestamp": "2026-01-14T13:53:30.033209+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/1": [ { "path": "action/2/choose/1", "timestamp": "2026-01-14T13:53:30.033374+00:00", "result": { "result": false } } ], "action/2/choose/1/conditions/0": [ { "path": "action/2/choose/1/conditions/0", "timestamp": "2026-01-14T13:53:30.033455+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/2": [ { "path": "action/2/choose/2", "timestamp": "2026-01-14T13:53:30.033602+00:00", "result": { "result": true } } ], "action/2/choose/2/conditions/0": [ { "path": "action/2/choose/2/conditions/0", "timestamp": "2026-01-14T13:53:30.033664+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/0": [ { "path": "action/2/choose/2/sequence/0", "timestamp": "2026-01-14T13:53:30.033921+00:00", "result": { "delay": 180.0, "done": true } } ], "action/2/choose/2/sequence/1": [ { "path": "action/2/choose/2/sequence/1", "timestamp": "2026-01-14T13:56:30.035450+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/2": [ { "path": "action/2/choose/2/sequence/2", "timestamp": "2026-01-14T13:56:30.035792+00:00", "result": { "params": { "domain": "homeassistant", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.lamp_meterkast" ] } }, "running_script": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "target_entity": "light.lamp_meterkast", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.beweging_meterkast_timer", "entity_domain": "{{ states[target_entity].domain }}", "turn_off_blocker_entity": null, "target_off_entity": null, "sun_condition": "Always" }, "triggers": { "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "to": "on" }, "actions": [ { "entity_id": "light.lamp_meterkast", "action": "homeassistant.turn_on" }, { "wait_for_trigger": { "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "from": "on", "to": "off" } }, { "choose": [ { "alias": "Motion wait not defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity == none }}" } ], "sequence": [ { "entity_id": "light.lamp_meterkast", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait not defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity != none }}" } ], "sequence": [ { "entity_id": null, "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity == none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": "light.lamp_meterkast", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity != none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": null, "action": "homeassistant.turn_off" } ] } ] } ], "conditions": [ { "condition": "template", "alias": "Check for illuminance conditions", "value_template": "{% set illuminance_defined = illuminance_currently != none and illuminance_cutoff != none %} {% set illuminance_defined_and_low = (illuminance_defined and (states(illuminance_currently) | int(0) < states(illuminance_cutoff) | int(0))) %}\n{% set target_entity_domain_supports_on_state_check = entity_domain != 'scene' and entity_domain != 'script' %} {% set target_entity_is_scene = entity_domain == 'scene' %} {% set scene_target_entities = state_attr(target_entity, 'entity_id') %} {% set singular_scene_entity_is_on = scene_target_entities is not none and scene_target_entities | count == 1 and scene_target_entities | first == 'on' %} {{ ( target_entity_domain_supports_on_state_check and states(target_entity) == 'on') or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and not illuminance_defined) or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and not illuminance_defined) or ( target_entity_is_scene and singular_scene_entity_is_on) }}\n" }, { "condition": "template", "alias": "Check for blocker entity", "value_template": "{{ (blocker_entity == none) or (states(blocker_entity) == 'off') }}" }, { "condition": "template", "alias": "Check for time limits", "value_template": "{% set current_time = now().strftime(\"%H:%M\") %}\n{% if time_limit_before == none and time_limit_after == none %} true {% endif %}\n{% if time_limit_before != none and time_limit_after == none %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {{ current_time_is_before_limit }} {% elif time_limit_before == none and time_limit_after != none %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {{ current_time_is_after_limit }} {% endif %}\n{% if time_limit_before != none and time_limit_after != none %} {% set before_limit_is_tomorrow = states(time_limit_before) < states(time_limit_after) %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {% set time_window_spans_midnight = states(time_limit_after) > states(time_limit_before) %}\n {% if time_window_spans_midnight != none and time_window_spans_midnight and before_limit_is_tomorrow %}\n {{ current_time_is_after_limit or current_time_is_before_limit }}\n {% elif time_window_spans_midnight != none and not time_window_spans_midnight %}\n {{ current_time_is_before_limit and current_time_is_after_limit }}\n {% endif %}\n{% endif %}\n" }, { "condition": "template", "alias": "Check for sun state", "value_template": "{# Prevent breaking when no sun condition is set in existing automations #} {% if not sun_condition is defined %} {% set sun_condition = 'Always' %} {% endif %} {# Get current sun state #} {% set current_sun_condition = states['sun.sun'].state %}\n{# Checks for current sun state #} {% set sun_state_is_below_horizon = current_sun_condition == 'below_horizon' %} {% set sun_state_is_above_horizon = current_sun_condition == 'above_horizon' %}\n{# Check to see if a condition for sunstate is set by user #} {% set no_sun_condition = sun_condition is defined and sun_condition == 'Always' %} {# Check to see if the user wants automation to trigger below horizon #} {% set sun_condition_is_below_horizon = sun_condition == 'Below horizon' %} {# Check to see if the user wants automation to trigger above horizon #} {% set sun_condition_is_above_horizon = sun_condition == 'Above horizon' %}\n{# Checks to see if sunstate matches up with users condition #} {% set sun_condition_below_horizon_match = sun_state_is_below_horizon and sun_condition_is_below_horizon %} {% set sun_condition_above_horizon_match = sun_state_is_above_horizon and sun_condition_is_above_horizon %} {% set sun_condition_matching = sun_condition_below_horizon_match or sun_condition_above_horizon_match or no_sun_condition %} {{ sun_condition_matching }}\n{# Debug values: (uncomment to check in template dev tool) ## Set at top of template: {% set sun_condition = 'Above horizon' %} Current sun condition: {{current_sun_condition}} Sun state is below horizon: {{ sun_state_is_below_horizon }} Sun state is above horizon: {{ sun_state_is_above_horizon }} Sun condition is set to always: {{ sun_condition_always }} Sun condition is below horizon: {{ sun_condition_is_below_horizon }} Sun condition is above horizon: {{ sun_condition_is_above_horizon }} Sun condition is below horizon match: {{ sun_condition_below_horizon_match }} Sun condition is above horizon match: {{ sun_condition_above_horizon_match }} Sun condition is a match: {{ sun_condition_matching }} #}\n" } ], "id": "1755418937534", "alias": "Beweging meterkast", "description": "" }, "blueprint_inputs": { "id": "1755418937534", "alias": "Beweging meterkast", "description": "", "use_blueprint": { "path": "freakshock88/motion_illuminance_activated_entity.yaml", "input": { "motion_sensor": "binary_sensor.everything_presence_one_7f7364_pir", "target_entity": "light.lamp_meterkast", "no_motion_wait": "input_number.beweging_meterkast_timer" } } }, "context": { "id": "01KEYCFGKZP735DBRZDPAX89E5", "parent_id": "01KEYCFGKWVQPCVAM2VWJ11B5T", "user_id": null } }, "short_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "23a7bc3c464bf6586f697b69fccc9e83", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T13:52:46.719319+00:00", "finish": "2026-01-14T13:56:30.159260+00:00" }, "domain": "automation", "item_id": "1755418937534", "trigger": "state of binary_sensor.everything_presence_one_7f7364_pir" } }, { "extended_dict": { "last_step": "action/2/choose/2/sequence/0", "run_id": "4610569964da241d4898247bf7009510", "state": "stopped", "script_execution": "cancelled", "timestamp": { "start": "2026-01-14T14:07:03.084498+00:00", "finish": "2026-01-14T14:08:03.973003+00:00" }, "domain": "automation", "item_id": "1755418937534", "trigger": "state of binary_sensor.everything_presence_one_7f7364_pir", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T14:07:03.084632+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_meterkast", "state": "on", "attributes": { "id": "1755418937534", "last_triggered": "2026-01-14T13:52:46.720101+00:00", "mode": "restart", "current": 0, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Meterkast [BP]" }, "last_changed": "2026-01-13T12:10:27.678358+00:00", "last_reported": "2026-01-14T13:56:30.157065+00:00", "last_updated": "2026-01-14T13:56:30.157065+00:00", "context": { "id": "01KEYCPATDAWT7EE5056RN1W4A", "parent_id": null, "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "from_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T13:53:30.030995+00:00", "last_reported": "2026-01-14T13:53:30.030995+00:00", "last_updated": "2026-01-14T13:53:30.030995+00:00", "context": { "id": "01KEYCGTXEQERAFZJTAE4JPB8X", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T14:07:03.081854+00:00", "last_reported": "2026-01-14T14:07:03.081854+00:00", "last_updated": "2026-01-14T14:07:03.081854+00:00", "context": { "id": "01KEYD9MX9X4MFG3TP485JS3AW", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.everything_presence_one_7f7364_pir" }, "target_entity": "light.lamp_meterkast", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.beweging_meterkast_timer", "entity_domain": "light", "turn_off_blocker_entity": null, "target_off_entity": null, "sun_condition": "Always" } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T14:07:03.084658+00:00", "result": { "result": true, "entities": [ "light.lamp_meterkast" ] } } ], "condition/1": [ { "path": "condition/1", "timestamp": "2026-01-14T14:07:03.084763+00:00", "result": { "result": true, "entities": [] } } ], "condition/2": [ { "path": "condition/2", "timestamp": "2026-01-14T14:07:03.084822+00:00", "result": { "result": true, "entities": [] } } ], "condition/3": [ { "path": "condition/3", "timestamp": "2026-01-14T14:07:03.084935+00:00", "result": { "result": true, "entities": [ "sun.sun" ] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T14:07:03.085231+00:00", "changed_variables": { "context": { "id": "01KEYD9MXCTC5MWXRWA5JK6MTT", "parent_id": "01KEYD9MX9X4MFG3TP485JS3AW", "user_id": null } }, "result": { "params": { "domain": "homeassistant", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "light.lamp_meterkast" ] } }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-14T14:07:03.207338+00:00", "changed_variables": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "from_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T14:07:03.081854+00:00", "last_reported": "2026-01-14T14:07:03.081854+00:00", "last_updated": "2026-01-14T14:07:03.081854+00:00", "context": { "id": "01KEYD9MX9X4MFG3TP485JS3AW", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T14:07:59.046790+00:00", "last_reported": "2026-01-14T14:07:59.046790+00:00", "last_updated": "2026-01-14T14:07:59.046790+00:00", "context": { "id": "01KEYDBBJ65WZ3Y0NFVNCFBYP1", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.everything_presence_one_7f7364_pir" } } }, "result": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "from_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T14:07:03.081854+00:00", "last_reported": "2026-01-14T14:07:03.081854+00:00", "last_updated": "2026-01-14T14:07:03.081854+00:00", "context": { "id": "01KEYD9MX9X4MFG3TP485JS3AW", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T14:07:59.046790+00:00", "last_reported": "2026-01-14T14:07:59.046790+00:00", "last_updated": "2026-01-14T14:07:59.046790+00:00", "context": { "id": "01KEYDBBJ65WZ3Y0NFVNCFBYP1", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.everything_presence_one_7f7364_pir" } } } } ], "action/2": [ { "path": "action/2", "timestamp": "2026-01-14T14:07:59.048507+00:00", "result": { "choice": 2 } } ], "action/2/choose/0": [ { "path": "action/2/choose/0", "timestamp": "2026-01-14T14:07:59.048560+00:00", "result": { "result": false } } ], "action/2/choose/0/conditions/0": [ { "path": "action/2/choose/0/conditions/0", "timestamp": "2026-01-14T14:07:59.048604+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/1": [ { "path": "action/2/choose/1", "timestamp": "2026-01-14T14:07:59.048735+00:00", "result": { "result": false } } ], "action/2/choose/1/conditions/0": [ { "path": "action/2/choose/1/conditions/0", "timestamp": "2026-01-14T14:07:59.048817+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/2": [ { "path": "action/2/choose/2", "timestamp": "2026-01-14T14:07:59.049033+00:00", "result": { "result": true } } ], "action/2/choose/2/conditions/0": [ { "path": "action/2/choose/2/conditions/0", "timestamp": "2026-01-14T14:07:59.049152+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/0": [ { "path": "action/2/choose/2/sequence/0", "timestamp": "2026-01-14T14:07:59.049465+00:00", "result": { "delay": 180.0, "done": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "target_entity": "light.lamp_meterkast", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.beweging_meterkast_timer", "entity_domain": "{{ states[target_entity].domain }}", "turn_off_blocker_entity": null, "target_off_entity": null, "sun_condition": "Always" }, "triggers": { "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "to": "on" }, "actions": [ { "entity_id": "light.lamp_meterkast", "action": "homeassistant.turn_on" }, { "wait_for_trigger": { "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "from": "on", "to": "off" } }, { "choose": [ { "alias": "Motion wait not defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity == none }}" } ], "sequence": [ { "entity_id": "light.lamp_meterkast", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait not defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity != none }}" } ], "sequence": [ { "entity_id": null, "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity == none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": "light.lamp_meterkast", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity != none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": null, "action": "homeassistant.turn_off" } ] } ] } ], "conditions": [ { "condition": "template", "alias": "Check for illuminance conditions", "value_template": "{% set illuminance_defined = illuminance_currently != none and illuminance_cutoff != none %} {% set illuminance_defined_and_low = (illuminance_defined and (states(illuminance_currently) | int(0) < states(illuminance_cutoff) | int(0))) %}\n{% set target_entity_domain_supports_on_state_check = entity_domain != 'scene' and entity_domain != 'script' %} {% set target_entity_is_scene = entity_domain == 'scene' %} {% set scene_target_entities = state_attr(target_entity, 'entity_id') %} {% set singular_scene_entity_is_on = scene_target_entities is not none and scene_target_entities | count == 1 and scene_target_entities | first == 'on' %} {{ ( target_entity_domain_supports_on_state_check and states(target_entity) == 'on') or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and not illuminance_defined) or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and not illuminance_defined) or ( target_entity_is_scene and singular_scene_entity_is_on) }}\n" }, { "condition": "template", "alias": "Check for blocker entity", "value_template": "{{ (blocker_entity == none) or (states(blocker_entity) == 'off') }}" }, { "condition": "template", "alias": "Check for time limits", "value_template": "{% set current_time = now().strftime(\"%H:%M\") %}\n{% if time_limit_before == none and time_limit_after == none %} true {% endif %}\n{% if time_limit_before != none and time_limit_after == none %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {{ current_time_is_before_limit }} {% elif time_limit_before == none and time_limit_after != none %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {{ current_time_is_after_limit }} {% endif %}\n{% if time_limit_before != none and time_limit_after != none %} {% set before_limit_is_tomorrow = states(time_limit_before) < states(time_limit_after) %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {% set time_window_spans_midnight = states(time_limit_after) > states(time_limit_before) %}\n {% if time_window_spans_midnight != none and time_window_spans_midnight and before_limit_is_tomorrow %}\n {{ current_time_is_after_limit or current_time_is_before_limit }}\n {% elif time_window_spans_midnight != none and not time_window_spans_midnight %}\n {{ current_time_is_before_limit and current_time_is_after_limit }}\n {% endif %}\n{% endif %}\n" }, { "condition": "template", "alias": "Check for sun state", "value_template": "{# Prevent breaking when no sun condition is set in existing automations #} {% if not sun_condition is defined %} {% set sun_condition = 'Always' %} {% endif %} {# Get current sun state #} {% set current_sun_condition = states['sun.sun'].state %}\n{# Checks for current sun state #} {% set sun_state_is_below_horizon = current_sun_condition == 'below_horizon' %} {% set sun_state_is_above_horizon = current_sun_condition == 'above_horizon' %}\n{# Check to see if a condition for sunstate is set by user #} {% set no_sun_condition = sun_condition is defined and sun_condition == 'Always' %} {# Check to see if the user wants automation to trigger below horizon #} {% set sun_condition_is_below_horizon = sun_condition == 'Below horizon' %} {# Check to see if the user wants automation to trigger above horizon #} {% set sun_condition_is_above_horizon = sun_condition == 'Above horizon' %}\n{# Checks to see if sunstate matches up with users condition #} {% set sun_condition_below_horizon_match = sun_state_is_below_horizon and sun_condition_is_below_horizon %} {% set sun_condition_above_horizon_match = sun_state_is_above_horizon and sun_condition_is_above_horizon %} {% set sun_condition_matching = sun_condition_below_horizon_match or sun_condition_above_horizon_match or no_sun_condition %} {{ sun_condition_matching }}\n{# Debug values: (uncomment to check in template dev tool) ## Set at top of template: {% set sun_condition = 'Above horizon' %} Current sun condition: {{current_sun_condition}} Sun state is below horizon: {{ sun_state_is_below_horizon }} Sun state is above horizon: {{ sun_state_is_above_horizon }} Sun condition is set to always: {{ sun_condition_always }} Sun condition is below horizon: {{ sun_condition_is_below_horizon }} Sun condition is above horizon: {{ sun_condition_is_above_horizon }} Sun condition is below horizon match: {{ sun_condition_below_horizon_match }} Sun condition is above horizon match: {{ sun_condition_above_horizon_match }} Sun condition is a match: {{ sun_condition_matching }} #}\n" } ], "id": "1755418937534", "alias": "Beweging meterkast", "description": "" }, "blueprint_inputs": { "id": "1755418937534", "alias": "Beweging meterkast", "description": "", "use_blueprint": { "path": "freakshock88/motion_illuminance_activated_entity.yaml", "input": { "motion_sensor": "binary_sensor.everything_presence_one_7f7364_pir", "target_entity": "light.lamp_meterkast", "no_motion_wait": "input_number.beweging_meterkast_timer" } } }, "context": { "id": "01KEYD9MXCTC5MWXRWA5JK6MTT", "parent_id": "01KEYD9MX9X4MFG3TP485JS3AW", "user_id": null } }, "short_dict": { "last_step": "action/2/choose/2/sequence/0", "run_id": "4610569964da241d4898247bf7009510", "state": "stopped", "script_execution": "cancelled", "timestamp": { "start": "2026-01-14T14:07:03.084498+00:00", "finish": "2026-01-14T14:08:03.973003+00:00" }, "domain": "automation", "item_id": "1755418937534", "trigger": "state of binary_sensor.everything_presence_one_7f7364_pir" } }, { "extended_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "f1684eb70f2756b90ec2e2a7620d0f2d", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T14:08:03.971981+00:00", "finish": "2026-01-14T14:11:29.130670+00:00" }, "domain": "automation", "item_id": "1755418937534", "trigger": "state of binary_sensor.everything_presence_one_7f7364_pir", "trace": { "trigger/0": [ { "path": "trigger/0", "timestamp": "2026-01-14T14:08:03.972097+00:00", "changed_variables": { "this": { "entity_id": "automation.beweging_meterkast", "state": "on", "attributes": { "id": "1755418937534", "last_triggered": "2026-01-14T14:07:03.085051+00:00", "mode": "restart", "current": 1, "icon": "mdi:motion-sensor", "friendly_name": "Beweging Meterkast [BP]" }, "last_changed": "2026-01-13T12:10:27.678358+00:00", "last_reported": "2026-01-14T14:07:03.085069+00:00", "last_updated": "2026-01-14T14:07:03.085069+00:00", "context": { "id": "01KEYD9MXCTC5MWXRWA5JK6MTT", "parent_id": "01KEYD9MX9X4MFG3TP485JS3AW", "user_id": null } }, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "from_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T14:07:59.046790+00:00", "last_reported": "2026-01-14T14:07:59.046790+00:00", "last_updated": "2026-01-14T14:07:59.046790+00:00", "context": { "id": "01KEYDBBJ65WZ3Y0NFVNCFBYP1", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T14:08:03.970618+00:00", "last_reported": "2026-01-14T14:08:03.970618+00:00", "last_updated": "2026-01-14T14:08:03.970618+00:00", "context": { "id": "01KEYDBGC2B8JYQJY54GTSEVZE", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.everything_presence_one_7f7364_pir" }, "target_entity": "light.lamp_meterkast", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.beweging_meterkast_timer", "entity_domain": "light", "turn_off_blocker_entity": null, "target_off_entity": null, "sun_condition": "Always" } } ], "condition/0": [ { "path": "condition/0", "timestamp": "2026-01-14T14:08:03.972119+00:00", "result": { "result": true, "entities": [ "light.lamp_meterkast" ] } } ], "condition/1": [ { "path": "condition/1", "timestamp": "2026-01-14T14:08:03.972208+00:00", "result": { "result": true, "entities": [] } } ], "condition/2": [ { "path": "condition/2", "timestamp": "2026-01-14T14:08:03.972252+00:00", "result": { "result": true, "entities": [] } } ], "condition/3": [ { "path": "condition/3", "timestamp": "2026-01-14T14:08:03.972343+00:00", "result": { "result": true, "entities": [ "sun.sun" ] } } ], "action/0": [ { "path": "action/0", "timestamp": "2026-01-14T14:08:03.973289+00:00", "changed_variables": { "context": { "id": "01KEYDBGC3PPX9EMRAQ964FR1X", "parent_id": "01KEYDBGC2B8JYQJY54GTSEVZE", "user_id": null } }, "result": { "params": { "domain": "homeassistant", "service": "turn_on", "service_data": {}, "target": { "entity_id": [ "light.lamp_meterkast" ] } }, "running_script": false } } ], "action/1": [ { "path": "action/1", "timestamp": "2026-01-14T14:08:04.052372+00:00", "changed_variables": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "from_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T14:08:03.970618+00:00", "last_reported": "2026-01-14T14:08:03.970618+00:00", "last_updated": "2026-01-14T14:08:03.970618+00:00", "context": { "id": "01KEYDBGC2B8JYQJY54GTSEVZE", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T14:08:29.005738+00:00", "last_reported": "2026-01-14T14:08:29.005738+00:00", "last_updated": "2026-01-14T14:08:29.005738+00:00", "context": { "id": "01KEYDC8TDNQM9KTEKWK6CHNC0", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.everything_presence_one_7f7364_pir" } } }, "result": { "wait": { "remaining": null, "completed": true, "trigger": { "id": "0", "idx": "0", "alias": null, "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "from_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "on", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T14:08:03.970618+00:00", "last_reported": "2026-01-14T14:08:03.970618+00:00", "last_updated": "2026-01-14T14:08:03.970618+00:00", "context": { "id": "01KEYDBGC2B8JYQJY54GTSEVZE", "parent_id": null, "user_id": null } }, "to_state": { "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "state": "off", "attributes": { "device_class": "motion", "friendly_name": "Beweging meterkast PIR" }, "last_changed": "2026-01-14T14:08:29.005738+00:00", "last_reported": "2026-01-14T14:08:29.005738+00:00", "last_updated": "2026-01-14T14:08:29.005738+00:00", "context": { "id": "01KEYDC8TDNQM9KTEKWK6CHNC0", "parent_id": null, "user_id": null } }, "for": null, "attribute": null, "description": "state of binary_sensor.everything_presence_one_7f7364_pir" } } } } ], "action/2": [ { "path": "action/2", "timestamp": "2026-01-14T14:08:29.007856+00:00", "result": { "choice": 2 } } ], "action/2/choose/0": [ { "path": "action/2/choose/0", "timestamp": "2026-01-14T14:08:29.007936+00:00", "result": { "result": false } } ], "action/2/choose/0/conditions/0": [ { "path": "action/2/choose/0/conditions/0", "timestamp": "2026-01-14T14:08:29.008063+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/1": [ { "path": "action/2/choose/1", "timestamp": "2026-01-14T14:08:29.008333+00:00", "result": { "result": false } } ], "action/2/choose/1/conditions/0": [ { "path": "action/2/choose/1/conditions/0", "timestamp": "2026-01-14T14:08:29.008421+00:00", "result": { "result": false, "entities": [] } } ], "action/2/choose/2": [ { "path": "action/2/choose/2", "timestamp": "2026-01-14T14:08:29.008515+00:00", "result": { "result": true } } ], "action/2/choose/2/conditions/0": [ { "path": "action/2/choose/2/conditions/0", "timestamp": "2026-01-14T14:08:29.008551+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/0": [ { "path": "action/2/choose/2/sequence/0", "timestamp": "2026-01-14T14:08:29.008726+00:00", "result": { "delay": 180.0, "done": true } } ], "action/2/choose/2/sequence/1": [ { "path": "action/2/choose/2/sequence/1", "timestamp": "2026-01-14T14:11:29.010218+00:00", "result": { "result": true, "entities": [] } } ], "action/2/choose/2/sequence/2": [ { "path": "action/2/choose/2/sequence/2", "timestamp": "2026-01-14T14:11:29.010482+00:00", "result": { "params": { "domain": "homeassistant", "service": "turn_off", "service_data": {}, "target": { "entity_id": [ "light.lamp_meterkast" ] } }, "running_script": false } } ] }, "config": { "mode": "restart", "max_exceeded": "silent", "variables": { "target_entity": "light.lamp_meterkast", "illuminance_currently": null, "illuminance_cutoff": null, "blocker_entity": null, "time_limit_before": null, "time_limit_after": null, "no_motion_wait": "input_number.beweging_meterkast_timer", "entity_domain": "{{ states[target_entity].domain }}", "turn_off_blocker_entity": null, "target_off_entity": null, "sun_condition": "Always" }, "triggers": { "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "to": "on" }, "actions": [ { "entity_id": "light.lamp_meterkast", "action": "homeassistant.turn_on" }, { "wait_for_trigger": { "platform": "state", "entity_id": "binary_sensor.everything_presence_one_7f7364_pir", "from": "on", "to": "off" } }, { "choose": [ { "alias": "Motion wait not defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity == none }}" } ], "sequence": [ { "entity_id": "light.lamp_meterkast", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait not defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait == none and target_off_entity != none }}" } ], "sequence": [ { "entity_id": null, "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity not defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity == none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": "light.lamp_meterkast", "action": "homeassistant.turn_off" } ] }, { "alias": "Motion wait defined and target off entity defined", "conditions": [ { "condition": "template", "value_template": "{{ no_motion_wait != none and target_off_entity != none }}" } ], "sequence": [ { "delay": { "minutes": "{{ states(no_motion_wait) | int(0) }}" } }, { "alias": "Check if blocker entity is defined and on", "condition": "template", "value_template": "{{ (turn_off_blocker_entity == none) or (states(turn_off_blocker_entity) == 'off') }}" }, { "entity_id": null, "action": "homeassistant.turn_off" } ] } ] } ], "conditions": [ { "condition": "template", "alias": "Check for illuminance conditions", "value_template": "{% set illuminance_defined = illuminance_currently != none and illuminance_cutoff != none %} {% set illuminance_defined_and_low = (illuminance_defined and (states(illuminance_currently) | int(0) < states(illuminance_cutoff) | int(0))) %}\n{% set target_entity_domain_supports_on_state_check = entity_domain != 'scene' and entity_domain != 'script' %} {% set target_entity_is_scene = entity_domain == 'scene' %} {% set scene_target_entities = state_attr(target_entity, 'entity_id') %} {% set singular_scene_entity_is_on = scene_target_entities is not none and scene_target_entities | count == 1 and scene_target_entities | first == 'on' %} {{ ( target_entity_domain_supports_on_state_check and states(target_entity) == 'on') or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and not illuminance_defined) or ( target_entity_domain_supports_on_state_check and states(target_entity) == 'off' and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and illuminance_defined_and_low) or ( not target_entity_domain_supports_on_state_check and not illuminance_defined) or ( target_entity_is_scene and singular_scene_entity_is_on) }}\n" }, { "condition": "template", "alias": "Check for blocker entity", "value_template": "{{ (blocker_entity == none) or (states(blocker_entity) == 'off') }}" }, { "condition": "template", "alias": "Check for time limits", "value_template": "{% set current_time = now().strftime(\"%H:%M\") %}\n{% if time_limit_before == none and time_limit_after == none %} true {% endif %}\n{% if time_limit_before != none and time_limit_after == none %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {{ current_time_is_before_limit }} {% elif time_limit_before == none and time_limit_after != none %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {{ current_time_is_after_limit }} {% endif %}\n{% if time_limit_before != none and time_limit_after != none %} {% set before_limit_is_tomorrow = states(time_limit_before) < states(time_limit_after) %} {% set current_time_is_before_limit = current_time < states(time_limit_before) %} {% set current_time_is_after_limit = current_time > states(time_limit_after) %} {% set time_window_spans_midnight = states(time_limit_after) > states(time_limit_before) %}\n {% if time_window_spans_midnight != none and time_window_spans_midnight and before_limit_is_tomorrow %}\n {{ current_time_is_after_limit or current_time_is_before_limit }}\n {% elif time_window_spans_midnight != none and not time_window_spans_midnight %}\n {{ current_time_is_before_limit and current_time_is_after_limit }}\n {% endif %}\n{% endif %}\n" }, { "condition": "template", "alias": "Check for sun state", "value_template": "{# Prevent breaking when no sun condition is set in existing automations #} {% if not sun_condition is defined %} {% set sun_condition = 'Always' %} {% endif %} {# Get current sun state #} {% set current_sun_condition = states['sun.sun'].state %}\n{# Checks for current sun state #} {% set sun_state_is_below_horizon = current_sun_condition == 'below_horizon' %} {% set sun_state_is_above_horizon = current_sun_condition == 'above_horizon' %}\n{# Check to see if a condition for sunstate is set by user #} {% set no_sun_condition = sun_condition is defined and sun_condition == 'Always' %} {# Check to see if the user wants automation to trigger below horizon #} {% set sun_condition_is_below_horizon = sun_condition == 'Below horizon' %} {# Check to see if the user wants automation to trigger above horizon #} {% set sun_condition_is_above_horizon = sun_condition == 'Above horizon' %}\n{# Checks to see if sunstate matches up with users condition #} {% set sun_condition_below_horizon_match = sun_state_is_below_horizon and sun_condition_is_below_horizon %} {% set sun_condition_above_horizon_match = sun_state_is_above_horizon and sun_condition_is_above_horizon %} {% set sun_condition_matching = sun_condition_below_horizon_match or sun_condition_above_horizon_match or no_sun_condition %} {{ sun_condition_matching }}\n{# Debug values: (uncomment to check in template dev tool) ## Set at top of template: {% set sun_condition = 'Above horizon' %} Current sun condition: {{current_sun_condition}} Sun state is below horizon: {{ sun_state_is_below_horizon }} Sun state is above horizon: {{ sun_state_is_above_horizon }} Sun condition is set to always: {{ sun_condition_always }} Sun condition is below horizon: {{ sun_condition_is_below_horizon }} Sun condition is above horizon: {{ sun_condition_is_above_horizon }} Sun condition is below horizon match: {{ sun_condition_below_horizon_match }} Sun condition is above horizon match: {{ sun_condition_above_horizon_match }} Sun condition is a match: {{ sun_condition_matching }} #}\n" } ], "id": "1755418937534", "alias": "Beweging meterkast", "description": "" }, "blueprint_inputs": { "id": "1755418937534", "alias": "Beweging meterkast", "description": "", "use_blueprint": { "path": "freakshock88/motion_illuminance_activated_entity.yaml", "input": { "motion_sensor": "binary_sensor.everything_presence_one_7f7364_pir", "target_entity": "light.lamp_meterkast", "no_motion_wait": "input_number.beweging_meterkast_timer" } } }, "context": { "id": "01KEYDBGC3PPX9EMRAQ964FR1X", "parent_id": "01KEYDBGC2B8JYQJY54GTSEVZE", "user_id": null } }, "short_dict": { "last_step": "action/2/choose/2/sequence/2", "run_id": "f1684eb70f2756b90ec2e2a7620d0f2d", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-14T14:08:03.971981+00:00", "finish": "2026-01-14T14:11:29.130670+00:00" }, "domain": "automation", "item_id": "1755418937534", "trigger": "state of binary_sensor.everything_presence_one_7f7364_pir" } } ], "automation.1764014728235": [ { "extended_dict": { "last_step": null, "run_id": "dc250980599d06fa6ae3057429624797", "state": "stopped", "script_execution": null, "timestamp": { "start": "2026-01-14T11:30:19.880291+00:00", "finish": "2026-01-14T11:30:19.881314+00:00" }, "domain": "automation", "item_id": "1764014728235", "error": "UndefinedError: 'context' is undefined", "trigger": null, "trace": {}, "config": { "id": "1764014728235", "alias": "Deurbel notificatie met snapshot", "description": "Stuur een notificatie bij de deurbel met link naar snapshot en deur openen.", "triggers": [ { "entity_id": "binary_sensor.front_door_bezoeker", "to": "on", "trigger": "state" } ], "actions": [ { "data": { "entity_id": "camera.front_door_duidelijk", "filename": "/config/www/snapshots/deurbel_snapshot.jpg" }, "action": "camera.snapshot", "enabled": false }, { "delay": "00:00:01", "enabled": false }, { "data": { "data": { "image": "/local/snapshots/deurbel_snapshot.jpg", "actions": [ { "action": "{{ action_open }}", "title": "\ud83d\udd13 Open deur" }, { "action": "URI", "title": "open camera", "url": "/lovelace/2" } ], "push": { "priority": "high", "channel": "alarm_stream" } }, "message": "de bel gaat", "title": "dingdong" }, "action": "notify.mobile_app_iphone_van_willem", "enabled": false }, { "data": { "data": { "entity_id": "camera.front_door_duidelijk", "actions": [ { "action": "{{ action_open }}", "title": "\ud83d\udd13 Open deur", "destructive": true }, { "action": "URI", "title": "open camera", "url": "/lovelace/2" } ], "push": { "priority": "high", "channel": "alarm_stream" } }, "message": "de bel gaat", "title": "dingdong" }, "action": "notify.mobile_app_iphone_van_willem" }, { "wait_for_trigger": [ { "event_type": "mobile_app_notification_action", "event_data": { "action": "{{ action_open }}" }, "trigger": "event" } ], "timeout": "00:00:20", "continue_on_timeout": false }, { "choose": [ { "conditions": [ { "condition": "template", "value_template": "{{ wait.trigger.event.data.action == action_open }}" } ], "sequence": [ { "target": { "entity_id": "lock.voordeur" }, "action": "lock.open", "data": {} } ] } ] } ], "variables": { "action_open": "{{ 'OPEN_' ~ context.id }}" }, "mode": "single" }, "blueprint_inputs": null, "context": { "id": "01KEY4AP38NJ4AR6CMBMHR680Y", "parent_id": "01KEY4AP37JAX2ZH2X6XN9VZBZ", "user_id": null } }, "short_dict": { "last_step": null, "run_id": "dc250980599d06fa6ae3057429624797", "state": "stopped", "script_execution": null, "timestamp": { "start": "2026-01-14T11:30:19.880291+00:00", "finish": "2026-01-14T11:30:19.881314+00:00" }, "domain": "automation", "item_id": "1764014728235", "error": "UndefinedError: 'context' is undefined", "trigger": null } } ], "script.script_woonkamer_verwarming": [ { "extended_dict": { "last_step": "sequence/0", "run_id": "f56d26c330c5bd3ea54ca9fea4a9c477", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T09:06:01.575933+00:00", "finish": "2026-01-16T09:06:16.998833+00:00" }, "domain": "script", "item_id": "script_woonkamer_verwarming", "trace": { "sequence/0": [ { "path": "sequence/0", "timestamp": "2026-01-16T09:06:01.576268+00:00", "changed_variables": { "this": { "entity_id": "script.script_woonkamer_verwarming", "state": "off", "attributes": { "last_triggered": null, "mode": "single", "current": 0, "friendly_name": "Thermostaat woonkamer toggle" }, "last_changed": "2026-01-16T09:05:57.153768+00:00", "last_reported": "2026-01-16T09:05:57.153768+00:00", "last_updated": "2026-01-16T09:05:57.153768+00:00", "context": { "id": "01KF30VRD155932189547KEZQP", "parent_id": null, "user_id": null } }, "context": { "id": "01KF30VWQ7RPEMP98QJGP7MDG3", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "result": { "params": { "domain": "climate", "service": "set_temperature", "service_data": { "temperature": 18, "entity_id": [ "climate.verwarming_woonkamer_blu" ] }, "target": { "entity_id": [ "climate.verwarming_woonkamer_blu" ] } }, "running_script": false } } ] }, "config": { "alias": "Thermostaat woonkamer toggle", "mode": "single", "sequence": [ { "target": { "entity_id": "climate.verwarming_woonkamer_blu" }, "data": { "temperature": "{% set t = state_attr('climate.verwarming_woonkamer_blu', 'temperature') | float(18) %} {% if t <= 15 %}\n 18\n{% elif t <= 18 %}\n 20\n{% else %}\n 15\n{% endif %}\n" }, "action": "climate.set_temperature" } ], "description": "" }, "blueprint_inputs": null, "context": { "id": "01KF30VWQ7RPEMP98QJGP7MDG3", "parent_id": null, "user_id": "f8c926ce57004d378a28014cc5a732ae" } }, "short_dict": { "last_step": "sequence/0", "run_id": "f56d26c330c5bd3ea54ca9fea4a9c477", "state": "stopped", "script_execution": "finished", "timestamp": { "start": "2026-01-16T09:06:01.575933+00:00", "finish": "2026-01-16T09:06:16.998833+00:00" }, "domain": "script", "item_id": "script_woonkamer_verwarming" } } ] } }