Where are the new entities for Hue (dimmer and tap) switches

New entities are being created for the dimmer and tap switches. Next to the ones created by the Custom integration, I now see new battery_level sensors for my physical tap and dimmer switches.

I can see the latter in the entities overview, but no entity is found for the switches them selves? How than could they be displayed in the frontend? @azogue could you point me to them?

they are visible in the devices:

I wonder how we can create automations on the clicks of these new entities, if we cant read the click (state) of them. The custom integration is very clear on that, do hope we are not solely allowed to do so in the device UI editor?
thanks for having a look!

There’s no sensor specifically for button pressed. Hue button presses are events. You can listen to hue_event and use event triggers in automations.

They are probably using events for the button clicks and no entitites for the devices at all. Did you check under Developer Tools -> Events, whether you see some events when you press a button on the Dimmer/Tap?
If it uses events, you can then just use the event trigger instead of the state trigger.
Edit: Too slow :slight_smile:

1 Like

ok will check that.

Is there no entity for the device either? no way to represent these in the frontend??

which service should Iisten to?

There is, but it’s only for the battery level. Based on your screenshot from the Devices page you should see sensor.dorm_dimmer_switch_battery_level, sensor.living_dimmer_switch_battery_level, etc. If you click on each of those devices you should see the underlying entities. Dev Tools > States would also show them.

As Burningstone said, listen for events at Developer Tools > Events (the event type is hue_event as I mentioned above).

Sorry @Burningstone, didn’t mean to step on your toes. Just a big Hue user so I knew I had the answer :slightly_smiling_face:

yes I have these sensors, but they are made by the CC, and not the Hue core integration.

sorry missed that. And yes, they are there:

good to know because hue_event isn’t listed in the right side of the event page

The second screenshot says Philips Hue for integration, so those are the sensors generated by the Hue integration.

Haha no worries. I was anyway just guessing :slight_smile: I’m also a big Hue user but not with the official integration, deconz is way better for my needs :slight_smile:

the second screenshot shows devices, not sensors… hence my question. Ive check the states for _2 sensors, and that is not the case.

I have sensors for battery_level only made by Philips Hue integration, all other sensors are made by the CC, or myself as template sensors (for battery, based on the CC)

Right. Click on each of those devices to see the underlying entities. The official Hue integration only generates battery entities. The ones ending with battery_level are the ones the Hue integration is generating (I made a mistake in one of my previous posts, I’ll edit accordingly).

That’s normal I think, I also don’t see some of the events on the right hand side that get fired. But you can always just enter * and press Start Listening to listen to all events.

exactly, as I feared: this is a click on the device:

no entities

Ah. Maybe the tap switches specifically aren’t included. Would make sense since that doesn’t have a battery. I’d check for events from it though.

no need, that was what I posted in the first post :wink:

tap switches dont have batteries of course, so no battery_level sensors.

this is a dimmer switch:

feels rather inadequate not having an entity in the states for an entity in real life…

@azogue has made a custom component event sensor, will give that a shot soon now this is in Core Ha.

With official integrations, I believe anything like a button typically doesn’t have an entity that reflects the button press state. Events are used for that. Having a sensor for the button press itself probably wouldn’t work with the Hue integration since the integration uses polling. Light, sensor, etc. states and events are updated every 5 seconds, so if you had a button press entity and you pressed the same button that was pressed before, the state likely wouldn’t change (it would go from up to down to up so quickly that it would likely be between polling cycles). That would make automations that are supposed to trigger on specific state changes likely not fire in that case.

1 Like

I am using the official Hue remote

and I use the buttons found in automations to setup actions

I think OP was concerned that that was the only way the button presses could be used in automations.

As cc’ed by @Mariusthvdb, my POV on this

Last hue update now does some extra things:

  • It register as devices the Hue dimmer switch and the Hue Tap switch,
  • and in doing so it also enables device triggers to build automations from UI based on button presses.
  • For battery powered remotes (the Hue dimmer), it also adds a battery level entity.

That follows the general approach of mirroring real objects with “devices”, and expand their states as separate entities.

feels rather inadequate not having an entity in the states for an entity in real life…

It has now a device. It is like the motion sensors, which get into HA as 1 device with multiple entities (binary sensor for motion, temperature and light level sensors, etc.)

With official integrations, I believe anything like a button typically doesn’t have an entity that reflects the button press state. Events are used for that.

Exactly. In fact, this feature has been “inspired” (mostly copied) from the deCONZ ZigBee integration.

Having a sensor for the button press itself probably wouldn’t work with the Hue integration since the integration uses polling. Light, sensor, etc. states and events are updated every 5 seconds, so if you had a button press entity and you pressed the same button that was pressed before, the state likely wouldn’t change (it would go from up to down to up so quickly that it would likely be between polling cycles). That would make automations that are supposed to trigger on specific state changes likely not fire in that case.

That is totally true. The same zigbee remote device would work much better under a Conbee stick than in the Hue bridge, as deCONZ has pushing ability, so no button presses are lost.

BUT, that does not make this feature unusable. You need to take into account a possible delay of 0 to 5 secs between button press and HA action, but that is not the end of the world: the “hold” button press action is specially useful to create automations on devices that already are configured for simple presses on the Hue app.

I think OP was concerned that that was the only way the button presses could be used in automations.

The “hue_event” is always fired and can be used directly. Device triggers use it internally and they are just an easier way to do things from the UI.

@azogue has made a custom component event sensor, will give that a shot soon now this is in Core Ha.

There are some people (myself included) that want to “see” or record the state of the remotes in the house, so HA events are not enough. For those nerds I created that very simple custom integration to create a “sensor” entity from some specific event.

  • It is not needed to use the remotes in automations (better use the integrated device triggers)
  • It can be used for any kind of remote or other HA event emitter. In my case, I use it for all my remotes. Some are integrated in the hue bridge (they have the polling known delay) and others in the deconz (those have an instant response).
2 Likes

BTW, about the problem of the fixed polling interval in the main hue integration, I just did another custom integration :), details in a new thread:

Thanks for your input! Glad that, despite not being a dev, what I expressed was mostly accurate. Cool custom component too.

1 Like