WTH can't we easily create an entity out of an event?

If would be amazing to be able to trap an event and create an entity out of it, such as a Zigbee button. Currently adding a button tends to create an entity for it’s battery but nothing for the button press.
How hard would it be for HA to detect the button press and automatically create a boolean with say a 1s back to off time!
I want to be able to reference the boolean (switch) in Nodered without resorting to automations within HA…

All of my Zigbee buttons had a binary_sensor created when added to HA… not sure where you are going with this

Sonoff Zigbee button (Little square white one) when linked to the new Sonoff Zigbee USB stick only registered as a battery, no binary sensor. Apparently you can ‘sniff’ the button presses as an event, but I’ve no idea how to turn this into an actual binary variable that I can then use in NodeRed for automations…?

Can you not use events in node red directly? I don’t use node red, but I would be more than sjrprised if node red wouldn’t support this.

FWIW, In my opinion its better to work with events for stateless switches.

I use node red and trigger flows from events from xiaomi zigbee wall buttons/switches.

Check out the node red HA event node.

1 Like

How do I find the event type name?

Go to Developer Tools->Events -> in the “Listen to events” enter * and press “START LISTENING”. Now press a button on the remote and you should see the event type, data etc.

Could this be considered a duplicate of WTH don’t we have Event Binary Sensors

1 Like

Hi,
Did as you said and got the below:

{
    "event_type": "zha_event",
    "data": {
        "device_ieee": "00:12:4b:00:1f:67:45:ec",
        "unique_id": "00:12:4b:00:1f:67:45:ec:1:0x0006",
        "endpoint_id": 1,
        "cluster_id": 6,
        "command": "on",
        "args": []
    },
    "origin": "LOCAL",
    "time_fired": "2020-08-27T10:40:09.498730+00:00",
    "context": {
        "id": "adda6812e85111eab44f85b73d831132",
        "parent_id": null,
        "user_id": null
    }
}

How do I pull an id from this to use in NodeRed?

Duplicate of

1 Like