diff --git a/blueprints/automation/motion-light.yaml b/blueprints/automation/motion-light.yaml index 66a1066..0b0a1bf 100644 --- a/blueprints/automation/motion-light.yaml +++ b/blueprints/automation/motion-light.yaml @@ -54,28 +54,15 @@ trigger: condition: - alias: "Check lux only if sensor is defined" - condition: or - conditions: - - condition: template - value_template: "{{ lux_entity is none }}" - - condition: numeric_state - entity_id: !input lux_entity - below: !input lux_threshold + condition: template + value_template: > + {% if lux_entity %} + {{ states(lux_entity) | float < lux_threshold }} + {% else %} + true + {% endif %} 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" service: light.turn_on target: !input light_target