Question on your card. I set it up that the way you had it and if the door is open it will close by clicking on it. However, it will not open when you click on it even with the call to service to open it. I can open it if I manually put in the call to service for that cover. Not sure why it will not work.
Maybe try using the call service cover.toggle?
Hi Matt,
do you know where are something wrong?
type: 'custom:state-switch'
entity: binary_sensor.garage_garage_door_contact
states:
'off':
type: 'custom:button-card'
entity: binary_sensor.garage_garage_door_contact
show_icon: true
show_name: true
tap_action:
action: call-service
service: switch.turn_on
service_data:
entity_id: switch.garage_trigger
icon: 'hass:garage'
state:
- value: 'off'
color: 'rgb(68,115,159)'
'on':
type: 'custom:button-card'
entity: binary_sensor.garage_garage_door_contact
show_icon: true
show_name: true
tap_action:
action: call-service
service: switch.turn_off
service_data:
entity_id: switch.garage_trigger
icon: 'hass:garage'
state:
- value: 'on'
color: 'rgb(255,0,0)'
Many thanks!
NB: I’m a newbie
honestly i’m not an expert on the state switch, but my random guess off the top of my head is that on and off don’t need quotes. not sure if that would cause issues, but it might.
what exactly is going wrong?