Mr-JR
(James R)
February 15, 2024, 4:28pm
1
Openhabian 4.1.1 on Raspberry PI4 4GB
Jython
Dual zigbee / zwave USB Stick Nortek
Hue bridge with hue binding
This is unrelated to the other issue I’m dealing with with zigbee in another thread …
I use the Hue binding and I am seeing a long delay between when OpenHab issues the command and the light turning on. If I use the Hue app, the bulb responds instantly.
Is there something known that may be causing this? What would be a good way to find the underlying reason?
rlkoshak
(Rich Koshak)
February 15, 2024, 4:52pm
2
Put the binding into trace level logging and see if you can pinpoint where the delay occurs. Potential places where the delay might be:
command to the Item
command to the Item to binding acting on the command
internal to the binding
binding out to the Hue hub
Hue hub to the light
What to look at and how to address it will depend on where the delay is occuring.
1 Like
AndrewFG
(Andrew Fiddian-Green)
February 15, 2024, 5:08pm
3
Are you using API v1 or v2?
1 Like
Larsen
(Locke)
February 15, 2024, 5:11pm
4
one idea: Do you have debounce enabled in the settings of your device? Try to enter “0” there.
1 Like
Mr-JR
(James R)
February 15, 2024, 5:13pm
5
Not sure … its the same one I’ve been using for years … so V1? How can I find out?
AndrewFG
(Andrew Fiddian-Green)
February 15, 2024, 5:19pm
6
Mr-JR:
How can I find out?
Please show us the ThingUid of your bridge and/or lamp things.
Note that API v1 is the legacy API; it is polling based, so much slower than v2 which is event based.
However in either case, please follow @rlkoshak 's advice to submit TRACE logs from OH, plus the event log, so we can figure out the timing…
Mr-JR
(James R)
February 15, 2024, 5:33pm
7
Yes obvious suggestion, here is the log. It varies from 5 seconds to 30 seconds … this one was relatively fast.
2024-02-15 09:25:32.692 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'LaundryRoom_Motion' changed from OFF to ON
2024-02-15 09:25:32.722 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'LaundryRoom_Light' received command 100
2024-02-15 09:25:32.726 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'LaundryRoom_Light' predicted to become 100
2024-02-15 09:25:32.742 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'LaundryRoom_Light' changed from 0 to 100
==> /var/log/openhab/openhab.log <==
2024-02-15 09:25:35.908 [DEBUG] [ng.hue.internal.connection.HueBridge] - Async sending put to address: https://10.0.0.116:443/api/wISNM1jeQXCi4cKAuUJnpPjd3RFCavFOpiQzPv6Y/lights/12/state delay: 120 body: {"on":true,"bri":254,"transitiontime":4}
2024-02-15 09:25:37.508 [DEBUG] [hue.internal.handler.HueLightHandler] - onLightStateChanged Light Laundry Light: on true bri 254 hue 0 sat 0 temp 0 mode null XY null
The Thing ID for the Hue is : hue:bridge:001788475111
Light 12 is the Laundry Room light … taking ~5 seconds in this log.
Mr-JR
(James R)
February 15, 2024, 5:42pm
8
Thanks, not sure what that is … Im using Jython code if that matters.
Mr-JR
(James R)
February 15, 2024, 5:51pm
9
2024-02-15 09:46:32.857 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HallBath_Motion' changed from OFF to ON
2024-02-15 09:46:32.876 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'HallBath_Light' received command 100
2024-02-15 09:46:32.892 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HallBath_Light' predicted to become 100
2024-02-15 09:46:32.898 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HallBath_Light' changed from 0 to 100
2024-02-15 09:47:32.743 [DEBUG] [ng.hue.internal.connection.HueBridge] - Async sending put to address: https://10.0.0.116:443/api/wISNM1jeQXCi4cKAuUJnpPjd3RFCavFOpiQzPv6Y/lights/21/state delay: 120 body: {"on":true,"bri":254,"transitiontime":4}
2024-02-15 09:47:48.094 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HallBath_Motion' changed from ON to OFF
2024-02-15 09:48:06.143 [DEBUG] [hue.internal.handler.HueLightHandler] - onLightStateChanged Light Light Hall Bath: on true bri 254 hue 0 sat 0 temp 0 mode null XY null
In this example it took 90 seconds obviously unusable.
EDIT: also strange that there is such a long delay between the http request and the hue response “on true”
Mr-JR
(James R)
February 15, 2024, 6:36pm
10
Well the good news is that I understand better how the HUE binding works. Would like to figure out why there is such a huge delay, but, I am sending http requests (using curl) directly to the Hue Bridge and the lights change instantly. So I can easily write some python code and not bother with the Hue Binding. Not ideal, but will be something to do while I am away for the next 3 months.
Obviously a real solution would be preferred
AndrewFG
(Andrew Fiddian-Green)
February 15, 2024, 8:10pm
11
Change from API v1 to API v2
1 Like
Mr-JR
(James R)
February 15, 2024, 9:26pm
12
Ok, yes if I’m on a polled version that might explain things.
I only see the one binding in the marketplace, how do I change to V2?
AndrewFG
(Andrew Fiddian-Green)
February 15, 2024, 9:29pm
13
It is the same binding. See migration guide…
Mr-JR
(James R)
February 15, 2024, 9:48pm
14
AndrewFG:
See migrarion guide…
Ah ok will do. The slowness was the same behavior with OH3 … sorry I didn’t understand this had been fixed in OH4.
Thank you!