Hi all,
I am trying to capture all events in the light domain, where the brightness is not explicitly set, so that I can adjust the brightness to my required level for the time of day.
Here is the YAML I have ended up with:
alias: Light level automation test
description: ""
trigger:
- platform: event
event_type: call_service
event_data:
domain: light
service: turn_on
condition:
- condition: template
value_template: "{{ trigger.event.data.service_data.brightness_pct == None }}"
action:
- service: light.turn_on
data:
entity_id: "{{trigger.event.data.service_data.entity_id}}"
brightness_step_pct: >-
{{ ((sin((pi / 2) * cos(((now().hour + (now().minute / 60)) / 3.88)
+ 2.8)) * 45) + 55) | int }}
mode: single
The problem I have is this run when the brightness is set in the event, and when it is missing. Clearly my condition is not right, but I can’t work out what I am doing wrong. I also tried:
condition:
- condition: template
value_template: "{{ trigger.event.data.service_data.brightness_pct is none }}"
Any pointers?