service: >-
{% if states('binary_sensor.test') == 'on' %}
switch.toggle
{% endif %}
data:
entity_id: switch.test
I am using this template to decide if the switch is allowed to work or not.
It works, but throws an error in the log, which is not nice. It makes sense though, because if the sensor is off, there is no service provided. Can I use some sort of dummy service or how is this done properly?