EDIT: incorrect. I think the turn on and turn off key-value pairs have to be single actions not a list of actions. You might have to put them in scripts. ``` switch: - platform: template switches: operazioneadele: value_template: “{{ is_state(‘input_boolean.operazioneadele’, ‘on’) }}” turn_on: script.switch_operazioneadele_on turn_off: script.switch_operazioneadele_off
script: - switch_operazioneadele_on: sequence: - service: script.turn_on entity_id: script.buonanotteadele # you could put the actions from this script here - service: input_boolean.turn_on entity_id: input_boolean.operazioneadele
- switch_operazioneadele_off: sequence: - service: script.turn_on entity_id: script.buongiornoadele # you could put the actions from this script here - service: input_boolean.turn_off entity_id: input_boolean.operazioneadele
I’m not sure why but for some reason even tho the template returns “True/False” I think it is treating it as a string and not a boolean. the template above forces the string to a boolean and it should work.
Moreover with the idea to create another script for on and off I created different scenarios without condition making the overall script more flexible.
Thank you Tom and thank you all for your kind support!
Well that’s interesting. Someone had a similar setup in another thread (two actions in the turn_on/off) and I asked them if it actually worked. They said yes. So I thought my suggerstion must be wrong. Maybe their second action wasn’t as important