Start an automation by clicking a switch in Lovelace


i had a time-based automation. For some reason i want to start the automation “by hand” by clicking a switch on my lovelace panel. I know how to start the automation bei service, but i have no idea, how to put this into a switch…

Can someone help me?

You know that conditions will be skipped when you trigger an auzomation manually? It would be better to create a script for your action and the execute this script in your time-based automation and with a service call from yoir button in lovelace.

Here’s the entity button syntax I use to trigger automations:

show_name: true
  action: none
  action: call-service
  service: automation.trigger
    entity_id: automation.north_shop_door
entity: automation.north_shop_door
name: Open North Shop Door
type: entity-button
show_icon: true

And why do you want to change this to a switch? What should the switch do when you turn it off?