I’m using an entity-button to represent a group for a relay setup I’ve got representing speakers in a home-wide setup. If I toggle the button as default it toggles all the switches by sending one command for each “switch”. However, my MQTT client includes logic to allow a “ON-ALL” and an “OFF-ALL” that handles all of them at once so I updated the card using it’s handy-dandy features to instead use a call-service
action utilizing mqtt.publish
. It works great! … Except… The problem is, the moment I re-enter the editor it clears the entire configuration.
icon: 'mdi:surround-sound'
name: Whole House
hold_action:
action: none
entity: group.speakers
type: entity-button
tap_action:
action: call-service
service: mqtt.publish
service_data:
topic: "home/speakers"
payload_template: >
{% if is_state('group.speakers', 'on') %}
{ "cmd": "OFF-ALL" }
{% else %}
{ "cmd": "ON-ALL" }
{% endif %}
When I click “save” and then try it, it works. If I click “Edit” about half my configuration is gone. I checked to see if it was some issue with the >
angle bracket and switched to a |
pipe and got the same behavior. I checked to see if it was an issue with the multi-line and switched to a single-line command and got the same behavior. I checked to see if it was an issue with my payload_template
content and switched to a simple payload, same behavior.
If I put in a correct configuration the button works as I want it to, but the moment I go to edit it, I’m stuck with the following:
icon: 'mdi:surround-sound'
name: Whole House
hold_action:
action: none
entity: group.speakers
type: entity-button
tap_action:
action: call-service
service: ''
Is there an workaround where I won’t lose configuration?