|
@@ -1,245 +0,0 @@
|
|
|
-blueprint:
|
|
|
- name: Motion active lights
|
|
|
- description: >-
|
|
|
- Motion active lights that respects the illumination in the room.
|
|
|
-
|
|
|
- Turrent light scene will be saved as a new scene so the lights can dim
|
|
|
- to a certain point before turning off. This way it will «alert» someone
|
|
|
- in the room that the light is about to go off.
|
|
|
-
|
|
|
- Additional criterias can be set in the `after_wait_actions` so you can
|
|
|
- listen for additional sensors to become off, before turning off the lights.
|
|
|
-
|
|
|
- E.g wait for the humitidy in the bathroom to come down before turning off
|
|
|
- the lights.
|
|
|
- domain: automation
|
|
|
- input:
|
|
|
- trigger_sensors:
|
|
|
- name: Sensors
|
|
|
- description: >-
|
|
|
- Sensors that will trigger the light to turn on. It's
|
|
|
- recommended to select entities explicitly instead of areas
|
|
|
- and/or devices.
|
|
|
- selector:
|
|
|
- target:
|
|
|
- entity:
|
|
|
- domain: binary_sensor
|
|
|
- synced_lights:
|
|
|
- name: Lights
|
|
|
- description: >-
|
|
|
- Lights that will adapt to the motion in the room. It's
|
|
|
- recommended to select entities explicitly instead of areas
|
|
|
- and/or devices.
|
|
|
- selector:
|
|
|
- target:
|
|
|
- entity:
|
|
|
- domain: light
|
|
|
- dim_percentage:
|
|
|
- name: Dim-percentage
|
|
|
- description: >-
|
|
|
- Dim lights to this level (%) of current light level,
|
|
|
- before turning lights off. Current level will be stored
|
|
|
- in a scene. Setting this to 0.0 or 1.0 will skip this action.
|
|
|
- default: 0.3
|
|
|
- selector:
|
|
|
- number:
|
|
|
- max: 1.0
|
|
|
- min: 0.0
|
|
|
- step: 0.01
|
|
|
- after_wait_actions:
|
|
|
- name: Wait actions
|
|
|
- description: >-
|
|
|
- Actions to run to delay further, e.g wait until media player state is off,
|
|
|
- housekeeping mode is off etc.
|
|
|
- default: []
|
|
|
- selector:
|
|
|
- action:
|
|
|
- delay:
|
|
|
- name: Delay
|
|
|
- description: >-
|
|
|
- Time (minutes) to wait to turn off after last movement was detected.
|
|
|
- selector:
|
|
|
- number:
|
|
|
- min: 0.0
|
|
|
- max: 300.0
|
|
|
- step: 5.0
|
|
|
- default: 3
|
|
|
-
|
|
|
-mode: restart
|
|
|
-
|
|
|
-trigger_variables:
|
|
|
- trigger_sensors_input: !input trigger_sensors
|
|
|
- trigger_sensors: >-
|
|
|
- {% set sensors = namespace(entities=[]) %}
|
|
|
- {% if 'entity_id' in trigger_sensors_input %}
|
|
|
- {% for entity in ([ trigger_sensors_input['entity_id'] ] if trigger_sensors_input['entity_id'] is string else trigger_sensors_input['entity_id']) %}
|
|
|
- {% set sensors.entities = sensors.entities + [entity] %}
|
|
|
- {% endfor %}
|
|
|
- {% endif %}
|
|
|
- {% if 'area_id' in trigger_sensors_input %}
|
|
|
- {% for area in ([ trigger_sensors_input['area_id'] ] if trigger_sensors_input['area_id'] is string else trigger_sensors_input['area_id']) %}
|
|
|
- {% for entity in area_entities(area) if entity.startswith('binary_sensor.') %}
|
|
|
- {% set sensors.entities = sensors.entities + [entity] %}
|
|
|
- {% endfor %}
|
|
|
- {% endfor %}
|
|
|
- {% endif %}
|
|
|
- {% if 'device_id' in trigger_sensors_input %}
|
|
|
- {% for device in ([ trigger_sensors_input['device_id'] ] if trigger_sensors_input['device_id'] is string else trigger_sensors_input['device_id']) %}
|
|
|
- {% for entity in device_entities(device) if entity.startswith('binary_sensor.') %}
|
|
|
- {% set sensors.entities = sensors.entities + [entity] %}
|
|
|
- {% endfor %}
|
|
|
- {% endfor %}
|
|
|
- {% endif %}
|
|
|
- {{ sensors.entities|unique|list }}
|
|
|
-
|
|
|
-trigger:
|
|
|
- platform: template
|
|
|
- value_template: >-
|
|
|
- {% set sensors = namespace(triggered=false) %}
|
|
|
- {% for sensor in trigger_sensors if is_state(sensor, 'on') %}
|
|
|
- {% set sensors.triggered = true %}
|
|
|
- {% endfor %}
|
|
|
- {{ sensors.triggered }}
|
|
|
-
|
|
|
-variables:
|
|
|
- synced_lights_inputs: !input synced_lights
|
|
|
- synced_lights: >-
|
|
|
- {% set lights = namespace(entities=[]) %}
|
|
|
- {% if 'entity_id' in synced_lights_inputs %}
|
|
|
- {% for entity in ([ synced_lights_inputs['entity_id'] ] if synced_lights_inputs['entity_id'] is string else synced_lights_inputs['entity_id']) %}
|
|
|
- {% set lights.entities = lights.entities + [entity] %}
|
|
|
- {% endfor %}
|
|
|
- {% endif %}
|
|
|
- {% if 'area_id' in synced_lights_inputs %}
|
|
|
- {% for area in ([ synced_lights_inputs['area_id'] ] if synced_lights_inputs['area_id'] is string else synced_lights_inputs['area_id']) %}
|
|
|
- {% for entity in area_entities(area) if entity.startswith('light.') %}
|
|
|
- {% set lights.entities = lights.entities + [entity] %}
|
|
|
- {% endfor %}
|
|
|
- {% endfor %}
|
|
|
- {% endif %}
|
|
|
- {% if 'device_id' in synced_lights_inputs %}
|
|
|
- {% for device in ([ synced_lights_inputs['device_id'] ] if synced_lights_inputs['device_id'] is string else synced_lights_inputs['device_id']) %}
|
|
|
- {% for entity in device_entities(device) if entity.startswith('light.') %}
|
|
|
- {% set lights.entities = lights.entities + [entity] %}
|
|
|
- {% endfor %}
|
|
|
- {% endfor %}
|
|
|
- {% endif %}
|
|
|
- {{ lights.entities|unique|list|sort }}
|
|
|
- scene_name: >-
|
|
|
- {{ this.entity_id.replace('.', '_') }}
|
|
|
- dim_percentage: !input dim_percentage
|
|
|
- delay_minutes: !input delay
|
|
|
- delay_seconds: "{{ delay_minutes * 60 }}"
|
|
|
- log_level: warning
|
|
|
-
|
|
|
-action: []
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|