Making the Hue Motion sensor more responsive in Home Assistant

could you explain what you mean with rest api
… this one right?? rest api

how can I poll a hue motion sensor in my own frequency by using this api :slight_smile:
would be very kind if you could give me some hints

Does HA still only poll Hue motion sensors every 5 seconds with the latest version (0.103.4)? Or is that now using REST API?

@Skylord123 stupid question, but for the setup you have written, do you still use the Hue Bridge? I have read over the article it seems like you still use it but I just wanted to confirm.
Currently my setup is the Hue motion sensors directly connected to HA via Deconz/Conbee 2.

Also, any suggestions about setting up MQTT server? I don’t have one/haven’t set one up before.
Thanks in advance

Hi Guys
I have never had an issue.
But I don’t use the HA hue I mean it’s there but I don’t use those entities to reference any automations
I use the Robmarkcole hue sensor custom component
As I have 4 button remotes as well.
I have currently 5 motion sensors active around the house and response time is less than a sec.
There is a huge diffence between the HA response and the custom component That I’m using.
I also use Node Red for all my automations.
I don’t use the huemagic I just use the normal poll state node with the output on change only.
My thoughts are HA is doing alot of things all the time.
I have always found the automations in HA to be slow to activate they fail to trigger or trigger to late.
Maybe I just can’t get the yaml code right.
I’m more a logical thinker.
Every automation I have in node red works as fast as I’d expect it to.
My advise is always
Use Node Red
Node Red is only doing what I’ve told it to do and nothing more. HA God bless it, is doing alot more.

1 Like

@Harry13 is the robmarkcole custom component link to the hue bridge and the hue sensors still connected to the hue bridge?
I have 13 hue motion sensors in total. Plus some Ikea Tradfri plugs for signal repeaters and 4 hue light strips all directly connected to a conbee however sometimes the sensors are a bit slow to respond (can take up to 6 seconds but 90% of the time it’s under 1 second). All automations are handled in node red.
The reason I ditched hue bridge was 50% of the time the light strips were coming on at 1% brightness even though the NR automation had a 100% brightness in the flow for on

Yes they are
I was just suggest in another topic to use conbee as it pushes

1 Like

Same as some others, I switched to using the ConBee II to fix exactly this problem.

I started out with trying things like increasing polling frequency on the HUE brdige. That did work to some extend, but quite often I ran into connection refused messages between my Home Assistant and the HUE bridge. Turns out that this was because the bridge has a really stringent policy for determining DoS attacks. Moving towards sub-second respons times for the motion sensors deemed impossible.

The more devices are connected, the more the DoS attack protection will kick in. This is because the bridge does not have a push option, but requires polling via the REST interface to gather device data. And to make things worse: only one device can be polled at a time, so if you have many devices, many polling requests will be made, triggering the DoS attack protection even quicker. That is why the polling frequency is as low as it is by default in the integration.

Next to the delayed motion sensor triggering, I ran into other related problems with the HUE bridge. My biggest annoyance was that automations that targeted about 10 devices (e.g. setting a scene based on Home Assistant scening support) would often only partly work. More often than not about 2 devices would stay in their old state. Looking at the network traffic, that was also caused by the DoS protection of the HUE bridge. It didn’t like me sending this “astounding” amount of REST requests within a second.

Because of all this, my eventual conclusion was that the HUE bridge was not a good fit for integration. Therefore I bought myself a ConBee II and using it was a breeze right from the start. It even switched my wife’s mindset from “this is stupid, I am quicker pressing the light switch myself” to "lovely, can you do this for the rest of the house? :wink:

I have the HUE bridge still lying around, but only for being able to do firmware upgrades.

3 Likes

Well I truely havent experienced any of those issue since i use the Huesensor custom component
pretty much since day dot. as i got the bridge with the 4 button remotes and the only way to get them into HA was with Robmarkcole’s custom component
i did notice the difference between response times on the Hue Entities and the Huesensor entities.
i only have 3 light as lamps but plenty of sensors and remotes.
but I have ordered the Conbee II from Amazon so i will be changing soon. :wink:

1 Like

I have multiple USB sticks in my HA raspberry Pi (smart meter, Z-wave, Zigbee). I documented how I configured the system to use predictable device names. Maybe this doc is useful for you too.

1 Like

sound like your sticking everything into you pi
poor thing
i’ll take a look
thanks
Happy new year

Yeah I am still using the Hue bridge. I have considered switching to something else like you are using but just haven’t seen the point as I don’t have other devices that use the same protocol.

I setup all of my apps on my server in docker (I run Unraid and it makes it really easy). Right now I am using this container to run Mosquitto for MQTT: https://github.com/cmccambridge/mosquitto-unraid

I use the ConBee now for 2 years and not even once was there an issue with the motion sensor not responding fast enough.

1 Like

How many Hue devices do you have? I noticed delays or missed events only when my ZigBee network grew bigger and more requests were sent to the Hue Bridge.

I’m sitting at 29 devices right now.

Do you see any delays when you turn on/off a lot of bulbs at the same time?

Nope. I even have several lights trigger from my own DIY motion sensors in Home Assistant and haven’t seen any latency between the bulbs.

Okay then that’s fine. I just like the ConBee because you can include so many other devices in your ZigBee network as well, such as the extremly cheap Xiaomi door/window sensors and you don’t need to poll the state from the Hue bridge, but instead get any event pushed to home assistant.

Do you also use Hue Dimmers and motion sensors? Because I had a lot of trouble with these and the Hue bridge connected to home assistant, due to the polling.

I actually wrote a post on the very topic of slow motion sensors in HA. I found a work-around using Node-RED. You can read about it here: https://skylar.tech/faster-hue-motion-events-in-home-assistant-using-node-red/ (I posted it earlier but figured I would again for reference).

Does the ConBee push data directly to Home Assistant or does it have to poll for the data like the bridge? I currently use a 1 second polling rate with Node-RED for my motion sensors and that has been perfect. I could try to reduce it but I haven’t really felt it necessary. I only use outdoor motion sensors from the Hue system (didn’t want to bother with building my own weatherproof battery powered sensors).

I haven’t had any issues with my Hue remotes. I actually wrote a post about using these remotes to trigger any automation within HA/Node-RED:

I’ve been building my own sensors around my house using esp8266 communicating over MQTT instead of buying pre-built sensors (built a garage controller about a month ago with $18 in parts). I have been considering buying some other Zigbee devices recently though (mainly doorlocks) so it may be worth trying it out ConBee. Especially if the data rates are actually faster.

It pushes data to Home Assistant. With the hue bridge I started to get delays on motion and the hue dimmer switch sometimes missed button presses completely. Once I got the ConBee, there was a sale for Xiaomi Door/Window sensors and I bought 15 of them for less than 100 bucks! Hard to beat this price, even with DIY.

Hi
I’m new to HA so bear with me.
I keep getting this error:
Invalid config for [sensor.template]: value is not allowed for dictionary value @ data[‘sensors’][‘stue_stuemotion’][‘device_class’]. Got ‘motion’. (See ?, line ?).

The hue bridge is connected to homekit, and I can se the motion sensor working in the app.
The automation is set up.
The error disappears if in /config/sensor.yaml #device_class: motion. also tryed with ‘motion’

Any good ideas???