Hi,
I have recently started to use Home Assistant. I have some automations that turn my light switches on and off. I have now created a input_boolean named “guests” that I want to be able to switch on and off depending on if I have guests sleeping in our guest room. In that case I don’t want the light switch in the guest room turn on in the morning.
My config right now is:
- id: '1544829850937'
alias: Lamps morning light up
trigger:
- at: 05:00
platform: time
condition: []
action:
- alias: ''
data:
entity_id: switch.kontor, switch.vardagsrum_2, switch.vardagsrum2_2, switch.tvattrum, switch.julgranen, switch.gastrum_2
service: switch.turn_on
I have tried the following but it won’t work:
action:
- service: homeassistant.turn_on
data:
entity_id: >-
{% if is_state('input_boolean.guests', 'on') %}
- switch.kontor
- switch.vardagsrum_2
- switch.vardagsrum2_2
- switch.tvattrum
- switch.julgranen
{% else %}
- switch.kontor
- switch.vardagsrum_2
- switch.vardagsrum2_2
- switch.julgranen
- switch.tvattrum
- switch.gastrum_2
{% endif %}
Can someone please give me some advice?
Regards
Patrik