Toggling a button on one entity from a card of a different template entity

I’m new and a bit stumped.

I’ve got a Tasmota flashed Sonoff SV1 to control my garage door. I have created a button card that activates the relay for .5s through the Inching function within Tasmota, Great.

I then installed two reed switches to detect when the door is open and shut. I created Template entity that takes the reed switch entities and gives me a three state of Open, in between, and Closed. I’ve created a button card based on this that shows through 3 different icons (garage, garage-alert, garage-open). Great.

I’m stuck on trying to modify that card to activate the door. I assume I have to edit the code in the card with some form of service call to the other entity but it doesn’t work.

My current template entity card code which doesn’t do anything is:

type: button
tap_action:
  - action: toggle
    entity_id: switch.garagedoor1
name: Garage Door
show_state: false
entity: sensor.garage_door_state

The code in the button card based on the switch entity itself that works is:

type: button
tap_action:
  action: toggle
entity: switch.garagedoor1

I’m sure it’s just a problem of getting the right syntax so any help appreciated.

Had a brainwave. Thought I could do it by a direct mqtt publish.

type: button
name: Garage Door
show_state: false
entity: sensor.garage_door_state
tap_action:
  action: call-service
  service: mqtt.publish
  topic: cmnd/gdswitch/POWER
  payload: 'ON'

Still doesn’t work. As soon as I get to the topic line the Button Card editor says “UI editor is not supported for this config: Key tap_action is not supported bu the UI editor. You can still edit your config in ymal” -

I don’t know what that is telling me. Help

Got it working now. The code I posted above was copied from the official documentation! It didn’t work
The code below was from something I saw on the community forum after a lot of searching. It works fine so now I am ready to install the whole thing on my garage door.

type: button
name: Garage Door
show_state: false
entity: sensor.garage_door_state
tap_action:
  action: call-service
  service: mqtt.publish
  service_data:
    topic: cmnd/gdswitch/POWER
    payload: 'ON'

For those wanting something similar, this code goes into the Button Card Configuration.

If you have a switch, why not just add it to the button card?

Also, have you set up a template cover?