New cards button not working for automation

I have somfy blinds set up in home assistant and they are working through the main dashboard control but I want to create a new dashboard, card buttons to control.

When I add a new button I add in the entity automation which all adds fine but the button won’t work.

Also tried adding as other options but no success. Sometimes it disables the automation.

It still works on the default dashboard with the auto added entities.

Any ideas what could cause this?

Thanks, James

Please share the YAML for the card config you are attempting.

Hi. The code is,

show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: automation.master_bedroom_close
name: Close

Thanks

Toggling an automation does not trigger it. It changes it from enabled to disabled or vice-versa.

What you need is:

show_name: true
show_icon: true
type: button
entity: automation.master_bedroom_close
name: Close
tap_action:
  action: call_service
  service: automation.trigger
  data:
    entity_id: automation.master_bedroom_close
    skip_condition: true

You should be aware that manually triggering an automation bypasses any conditions and just runs the actions unless you set skip_condition: false

Additionally if the only thing that triggers your automation is this button you should use a script instead.

The script syntax is exactly the same as for automation actions.

Finally, please format your pasted config in future: https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

Thanks for help. That’s working now.