From Lovelace to Node-RED

Does anyone have a guide or an example of a button in Lovelace that toggles a ‘sensor’ between states so that the current value can be read in Node-RED?

For instance, I see many folks using switches in Lovelace whilst testing their Home / Away automations. The switch, presumably, allowing the operator to emulate different states.

I would be very appreciative of a pointer to an example.

Hi there,

in HA in the “Configuration” section you can find something called “Helpers”. Create a new helper of type “Toggle” and give it an “entity ID”.

You can then use lovelace as a toggle button, and in node red you can use an “events: state” node and specify the same entity ID.

Thank you very much