Automation Trigger from Button Card

Hey All,

I’m having an issue getting the button card to run an automation. I copied the code from a post that people say works but it doesn’t seem to work for me. I get an error about the dictionary value which I assume is because of the “entity_id”.

Does anyone know the correct code to fix this issue?

type: custom:button-card
styles:
  card:
    - height: 100%
size: 60%
color: rgb(5,144,51)
tap_action:
  action: call-service
  service: automation.trigger
  service_data:
    entity_id: automation.switch-t4
entity: automation.switch-t4
icon: mdi:pot-mix
show_name: false

Rename your automation in automation.switch_t4

1 Like

thank you!