Button as helper entity

Hey,
with the newly added Button Entity it would be quite helpfull to be able to create Button-Helper that could be used to trigger an Script or an Automation when pressed in the loveface.

You can trigger a script directly from UI, is show ā€œa buttonā€ that you can press to execute.

I agree. I would likt a helper button to be able to use for e.g. node red flows, now I need a timer to turn a switch (boolean helper) off.

2 Likes

Yes, we need this!
Additionally we need this to be exposed to Google Assistant by the manual configuration.

button is a platform like number and select. Itā€™s meant to be implemented by other integrations. For example, the MQTT integration implements it and several other platforms.

However, I agree a button-like Helper would be easier and more convenient for users to create (than, for example, an MQTT Button). An input_button would generate a custom event when pressed; the custom event can be detected by an Event Trigger. An input_button would be automatically displayed in the Lovelace UI, just like other Input Helpers.

1 Like

Agree 100% with @123. I have a lot of automation that I would like to be able to trigger manually from the front end which is solvable today with some ā€œworkaroundsā€, but a input_button with a custom event would be the nicest and cleanest way to do it.

1 Like

It appears that this FR is in the process of being implemented. Frenck has posted this PR:

If I understood the input_button's code correctly, when pressed it produces a timestamp (representing the moment when itā€™s pressed).

5 Likes

I used the Button entity today, (mqtt_button)
It works an all, but a but underwhelming. I say this because it could be so much more. Currently on the user side, there is MQTT Button and frankly that is just replacing a script to call an entity with a nicer format, and thatā€™s about it. It does have more functions via the integrated hardware side.
I look forward to someone taking this much farther.

  • How about short press, Long press, multi press options for user and integrations.
  • How about a button to ā€˜toggleā€™ an existing switch on and off. (instead of a script to toggle it, delay, toggle it back again)
  • How about a button to fire a web hook.
  • How about a Button to fire a shell_script

I donā€™t have a clue how to pull these off in the HA code or if they actually should exist, but the Button, as an expanded integration or as a helper would be very useful in the entire Home Assistant Game IMHO.

Oops, just found thisā€¦

Letā€™s see what that gets usā€¦

You linked to a Frontend PR for what was implemented in the link I had posted (a Core PR). In other words, itā€™s just the UI for creating an Input Button Helper. The features you listed in your previous post arenā€™t included in either PR. Push the button and its state value changes to the latest date and time which can be used for a trigger. Thatā€™s about the full extent of what it currently does.

1 Like