@Auto101 wrote:
Hi
I am new to HA .I am trying to create a template switch . With the below code, I am able to get the switch in UI but when I toggle it to ON , it turns on the soundbar and toggle icon just goes back to its previous state (off) . The soundbar doesn’t turn off though .Any help is appreciated .
- platform: template switches: bose: value_template: "{% if is_state('media_player.bose', 'on') %}on{% else %}off{% endif %}" turn_on: service: media_player.turn_on data: entity_id: media_player.bose turn_off: service: media_player.turn_off data: entity_id: media_player.bose
Posts: 5
Participants: 3