joBr99 / nspanel-lovelace-ui

Custom Firmware for NsPanel with the design of HomeAssistant's lovelace UI in mind, works with Tasmota.
GNU General Public License v3.0
854 stars 187 forks source link

[Feature Request] How to get notification button presses? #1200

Closed gosoares closed 3 months ago

gosoares commented 3 months ago

FEATURE DESCRIPTION

In the notifications documentation it is shown how to send a notification to the nspanel in a separate page, with the possibility of adding buttons to it. But when these buttons are pressed, nothing happens. The notification continues to shown at the nspanel and no event or state change are sent to home assistant. How can i get theses button presses in home assistant to use it in a automation?

PANEL / FIRMWARE VERSION

US-P

rossi75 commented 3 months ago

Hi Gosoares,

I struggled along this also long time. The result is that easy.... But let's start from the beginning...

You push a notification towards the panel, and the left softbutton replies with a NO, the right softutton with a YES. So let's have a look in the MQTT logs given by the NSPanels Console: grafik

Now that we found the string, where does it go to? Simply place an event trigger in your automation: grafik

in YAML it looks like this: grafik

Hence you can proceed with your automation... for example to cancel the popup message: grafik

which will be shown in the NSPanel Console as this: grafik

Hope that helps and answers your question...

gosoares commented 3 months ago

Thanks @rossi75.

I am away from home for a few days so i cant test this right now, but i believe its what i need. Much appreciated.