Hi,
I am trying to create a push button on my lovelace front end to trigger an automation so I want the push button to publish / act as / be an entity.
Am I missing something obvious here?
Hi,
I am trying to create a push button on my lovelace front end to trigger an automation so I want the push button to publish / act as / be an entity.
Am I missing something obvious here?
tap_action:
action: call-service
service: automation.trigger
service_data:
entity_id: automation.your_automation
Alternatively if you put your actions in a script instead of an automation:
tap_action:
action: call-service
service: script.your_script
If you’re only going to have a list of actions that are called manually from the button press the script is a better fit.
I want the push button to be an Entity, is this possible?
Why?
I want it to act like a binary_sensor input?
Use an input boolean.
Automation:
- id: your_automation
alias: 'Your Automation'
trigger:
platform: state
entity_id: input_boolean.your_input_boolean
to: on
action:
- your actions here then...
- service: input_boolean.turn_off # make this the last action to make the switch momentary
entity_id: input_boolean.your_input_boolean
Alternatively this is available in HACS
Does that go in the configuration.YAML?
Does what go in the yaml?
The input_boolean and automation I wrote: yes
The custom integration: no, and yes.
The custom integration has to be installed. Check out HACS for the easiest way to do this. Then you write a bit of configuration in yaml to configure it. Read the hass-momentary page. It tells you all this.