I have an optional blueprint input variable illuminance_sensor and I just want to listen for state changes and use this as a trigger:
trigger:
- platform: state
entity_id: !input "illuminance_sensor"
This works, if the user specifies that sensor, but if the illuminance_sensor is none, I get an error. My current workaround is, to specify a dummy sensor dummy_illuminance_sensor and add it as a default: in the input variable. But is there a better way?
I also tried to use it as a template although I’m not sure what is the best way to specify that I’m not interested in a certain condition, but only in a state change for a certain (optional) entity:
The trigger selector seems like the obvious choice here, I agree.
I’m just curious what other triggers would be in the blueprint as It’s not possible to run an automation without a trigger. So only adding 1 optional trigger seems weird, that’s what conditions are for.
None of the selectors individually has the fact that you can use default. The default is an option that they all have (in a blueprint). It was written that way to prevent every selector from listing the same info. About the blueprint schema - Home Assistant.