Please be so kind and format your code according to the forum rules (especially point 8 and 11). It is helpful for other people that want to answer your question. By not formatting the code properly, you loose ie. the indentation, that is the reason for errors in many, many cases. Without the formatting, we just can’t see, if there is an error. Thank you!
That being said, if you want to use the toggle
service in custom:button-card
, you need to set the entity via the “main” button part, not in the “service” part.
In theory something like this:
show_name: true
show_icon: true
type: custom:button-card
entity: button.wiser_cancel_all_heating_overrides
tap_action:
action: toggle
name: ’ Cancel All Overrides’
What else you’d need is an entity besides a button
. A button
in HA speach is something that has no state, it is just like these push-buttons in real world, that only react as long as you press them. In theory that button of yours should have something it changes, eg. a binary_sensor
or starting a script
.
If I understand correctly what you’re doing, I’d choose a script
or an automation
, that runs and disables your “heating overrides” (not sure what that is) when the custom:button-card
is pressed. If you can elaborate a little more about what you want to achieve in the end (this is the point 8 thingy ), I’m sure there would be a nice and compact solution in
button-card
.