Hi,
I’m sorry if it’s been asked before, it sounds like such a basic use-case, but I can’t find anything.
I’m trying to define a basic template light group that would turn on or off some lights based on some condition. Basically trying to filter out the events without changing their parameters.
I’m running into trouble with actions like turn_on, which may or may not receive the parameter brightness, and I am not sure how to deal with that.
So far I have used something like
action: light.turn_on
metadata: {}
target:
entity_id: light.ceiling_light_light
data:
brightness: {{ int(brightness, default=255) if brightness is not none }}
but if brightness is not specified, it will set the brightness to 255, whereas I would like to send the light.turn_on event without brightness (so that e.g. adaptive lights can intercept the call).
I guess I could use an if block with two different events depending on whether the value is set or not, and do the same with transition and end up with 4 ifs, but before I go there and do that over every light, I have to ask: is there a better/cleaner way?
Thanks!