blueprints/automation/motion-light.yaml aktualisiert

This commit is contained in:
2025-08-29 14:34:29 +00:00
parent 74d3f5924e
commit ba21370ff2

View File

@@ -54,28 +54,15 @@ trigger:
condition: condition:
- alias: "Check lux only if sensor is defined" - alias: "Check lux only if sensor is defined"
condition: or condition: template
conditions: value_template: >
- condition: template {% if lux_entity %}
value_template: "{{ lux_entity is none }}" {{ states(lux_entity) | float < lux_threshold }}
- condition: numeric_state {% else %}
entity_id: !input lux_entity true
below: !input lux_threshold {% endif %}
action: action:
- alias: "Set brightness based on time of day"
variables:
brightness: >
{% set hour = now().hour %}
{% if hour < 6 %}
50
{% elif hour < 12 %}
150
{% elif hour < 18 %}
200
{% else %}
100
{% endif %}
- alias: "Turn on the light with calculated brightness" - alias: "Turn on the light with calculated brightness"
service: light.turn_on service: light.turn_on
target: !input light_target target: !input light_target