None of my switches are showing in Node Red, just their battery status

I’m just starting out with Node Red. I have a bunch of switches, almost all of them Hue, with the exception of one Xiaomi button. They all work fine in the rest of my HA set up. When i try and set up a basic Events State node in Node Red, however, I can’t find any of them in the list of devices. Just their battery status. (see screenshot). I’m sure it’s something dense I’ve done, or not done, but I’d appreciate if I could get some help. Many Thanks :slight_smile:

edit to add that the hue switches are all through the Hue integration and for the Xiaomi button, i’m using ZHA with a Raspbee II card and hassio on a pi 4

I don’t use hue or Xiaomi but all my buttons, lutron and ikea zigbee switches, don’t create switch entities. There are button events that have to be listened to. You can go to the integration page and look to see what entities they create, can you confirm that you see switches under those integrations?

switch state has to be represented by entity. events may represent pressing buttons but are not applicable to switch states

@mshore.is are those missing entities listed in HA dev tools?

Hey, not they aren’t in dev tools… i tried button, but it just filters down to the xiaomi button battery state

Hey, i tried adding one of the philips switches (a smart dimmer) to zigbee to see if that worked. here are the entities associated with zha:

and here is what i see when it search for ‘button’ in node red:

Hue remotes and switches

Hue remotes such as the Dimmer Switch are stateless devices, meaning that they do not have a on/off state like regular entities in Home Assistant. Instead, such devices emit the event hue_event when a button is pressed. You can test what events come in using the event developer tools in Home Assistant and subscribe to the hue_event. Once you know what the event data looks like, you can use this to create automations.

It’s an event so you would use the following.

[{"id":"c44262b5a4abc706","type":"server-events","z":"f80b6c338afd5483","name":"","server":"","version":1,"event_type":"hue_event","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"waitForRunning":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"$outputData(\"eventData\").event_type","valueType":"jsonata"}],"x":470,"y":320,"wires":[["213c93611976038b"]]},{"id":"213c93611976038b","type":"debug","z":"f80b6c338afd5483","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":810,"y":320,"wires":[]}]

Press the hue switch… look at the debug… look for the id …use a switch node to filter which switch, it will look something like this

and which button was pressed.

1 Like

Hey, so i finally got time to look at this again. I think that it might be an issue with my Raspbee II device. It doesn’t seem to show up properly in the list of hardware, and when it try and set up zigbee2mqtt, it doesn’t work either. I’ve also got other devices that aren’t installing properly (a temperature sensor) so I’ve ordered a conbee stick, so i’ll see if that makes any difference. Thanks all for your help so far - i’ll prbably be back :slight_smile:

perfect answer, thank you so much!