I’m trying to trim down my automations as I currently have one for on and one for off on each of my input booleans that are linked to a light. I appreciate the below is completely wrong but I hope you can see what I’m trying to achieve:
- alias: 'On or Off Switch'
condition: []
id: '6518643521321'
trigger:
platform: state
entity_id: input_boolean.testlight
action:
service: input_boolean.toggle
data_template:
entity_id: switch.bedroom_light
value:>
{% if is_state('input_boolean.testlight', 'on') %}
switch.turn_off
{% else %}
switch.turn_on
{% endif %}