diff --git a/include/automations/doerklokke_for.yaml b/include/automations/doerklokke_for.yaml index fe46704..a1e41b7 100644 --- a/include/automations/doerklokke_for.yaml +++ b/include/automations/doerklokke_for.yaml @@ -80,7 +80,30 @@ - delay: 2 - service: scene.turn_on entity_id: scene.before - + - sequence: + - condition: template + value_template: > + {{ states('sensor.gang_sensor_illuminance') | int < + states('input_number.gang_lux_threshold') | int }} + - choose: + - conditions: + - condition: template + value_template: > + {% set t = now().strftime('%H%M') | int %} + {% if is_state('binary_sensor.arbejdsdag', 'on') %} + {{ 630 <= t < 2130 }} + {% else %} + {{ 800 <= t < 2200 }} + {% endif %} + sequence: + - service: scene.turn_on + target: + entity_id: scene.gang_bright + default: + - service: scene.turn_on + target: + entity_id: scene.gang_daempet_nat + - conditions: - condition: template value_template: '{{ trigger.payload_json.event == "SS" }}'