zigbee2mqtt & zigbee USB for Hue bulbs

Posted on
Mon Dec 14, 2020 7:53 am
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: zigbee2mqtt & zigbee USB for Hue bulbs

I think the problem is that, for this device, the "STATE" in the payload is worthless. It's always "OFF", even when the device is on.

Change state_location_payload_key to "brightness" and see if that helps.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Dec 14, 2020 8:04 am
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: zigbee2mqtt & zigbee USB for Hue bulbs

The state does update and reflect on/off in mqtt

Code: Select all
{"brightness":254,"color":{"x":0.339715260382228,"y":0.347215989076895},"color_temp":192,"linkquality":94,"state":"OFF","update_available":false}

Code: Select all
{"brightness":254,"color":{"x":0.339715260382228,"y":0.347215989076895},"color_temp":192,"linkquality":94,"state":"ON","update_available":false}

Posted on
Mon Dec 14, 2020 8:07 am
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: zigbee2mqtt & zigbee USB for Hue bulbs

Well, that's not what I see in viewtopic.php?f=316&t=24066&start=75#p198131

So start from scratch. Show the messages, the logs, and exactly what you're doing and what you expect to see.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Mon Dec 14, 2020 10:38 am
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: zigbee2mqtt & zigbee USB for Hue bulbs

And when you post the MQTT message, include the topic. Makes it easier to see what's going on. And if I have the full messages and device definitions, I can set up my Dev system to simulate your setup.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Dec 24, 2020 9:10 am
cesarvog offline
User avatar
Posts: 155
Joined: Aug 13, 2016
Location: Brazil

Re: zigbee2mqtt & zigbee USB for Hue bulbs

I have followed this thread with great interest and was able to sucessfully create a MQTT Shim Color Device.

Everything works as expected, but I cannot for the love of God figure what to put in the "Set RGB Payload" field, to make it send the color I choose in the standard Apple color wheel.
I have tried (and erred) several variations and the only thing that seems to work is if I use actual numbers for R, G and B, which of course doesn't let me pick a color from the wheel, it only sets the bulb color to the fixed set of RGB numbers I put there...

The screenshot below shows my MQTT Shim device setup.

Also, on a second unrelated issue, of note on the screenshot below is the need to use "ON" in the Off Action payload field. I tried putting "OFF" there, and the bulb does come on and off correctly but the little lamp icon in Indigo's GUI will stay "lit", even when the actual bulb is off...
Attachments
Screen Shot 2020-12-24 at 12.04.40.png
Screen Shot 2020-12-24 at 12.04.40.png (147.17 KiB) Viewed 2617 times
Last edited by cesarvog on Thu Dec 24, 2020 9:41 am, edited 5 times in total.

Posted on
Thu Dec 24, 2020 9:20 am
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: zigbee2mqtt & zigbee USB for Hue bulbs

Hi

Try this. {"state":"ON","brightness":{{brightness}},"color":{"x":{{x}},"y":{{y}}}}.

I havent played with my colour lights much with this setup as I use them just for temperature. Effectively the statement in this box is what it sends to the bulb so has to follow the commands from zigbee2mqtt.

Posted on
Thu Dec 24, 2020 9:27 am
cesarvog offline
User avatar
Posts: 155
Joined: Aug 13, 2016
Location: Brazil

Re: zigbee2mqtt & zigbee USB for Hue bulbs

Hello @siclark,

Yes, that did it. Wow, I cannot tell you how many failed tries I ran before asking for help here...

Many thanks for your help.

Happy Holidays,
Cesar

PS: Updated the screenshot above to reference a second unrelated issue.

Posted on
Thu Dec 24, 2020 10:08 am
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: zigbee2mqtt & zigbee USB for Hue bulbs

cesarvog wrote:
Also, on a second unrelated issue, of note on the screenshot below is the need to use "ON" in the Off Action payload field. I tried putting "OFF" there, and the bulb does come on and off correctly but the little lamp icon in Indigo's GUI will stay "lit", even when the actual bulb is off...


The Indigo UI is updated based on the status messages from the device (via MQTT), not based on the commands you send to the device. So you would need to post the status messages you're getting back from both you on and off commands to see what's going on.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Dec 24, 2020 10:44 am
cesarvog offline
User avatar
Posts: 155
Joined: Aug 13, 2016
Location: Brazil

Re: zigbee2mqtt & zigbee USB for Hue bulbs

Hi Joe, thanks for stepping in, specially on such a festive day.

I hope that this is what you're referring to: (if not, please tell me where to get the desired info, sorry for being such a newbie on MQTT related stuff).

Messages got from the command line after starting zigbee2mqqt:

With ON in the Off Action Payload (little lamp icon in Indigo GUI works as expected and actual Hue Bulb goes on and off as expected)::

Code: Select all
Zigbee2MQTT:info  2020-12-24 13:38:07: MQTT publish: topic 'zigbee2mqtt/Escritorio_HueGr2', payload '{"brightness":100,"color":{"x":0.242355094382,"y":0.119824558987},"color_temp":124,"state":"ON"}'
Zigbee2MQTT:info  2020-12-24 13:38:07: MQTT publish: topic 'zigbee2mqtt/Escritorio_Old_Hue_Bulb', payload '{"brightness":100,"color":{"x":0.242355094382,"y":0.119824558987},"color_temp":124,"linkquality":138,"state":"ON"}'
Zigbee2MQTT:info  2020-12-24 13:38:14: MQTT publish: topic 'zigbee2mqtt/Escritorio_HueGr2', payload '{"brightness":0,"color":{"x":0.242355094382,"y":0.119824558987},"color_temp":124,"state":"OFF"}'
Zigbee2MQTT:info  2020-12-24 13:38:14: MQTT publish: topic 'zigbee2mqtt/Escritorio_Old_Hue_Bulb', payload '{"brightness":0,"color":{"x":0.242355094382,"y":0.119824558987},"color_temp":124,"linkquality":138,"state":"OFF"}'

With OFF in the "Off Action Payload" (little lamp icon in Indigo GUI stays on, but actual Hue Bulb goes on and off as expected)::

Code: Select all
Zigbee2MQTT:info  2020-12-24 13:39:20: MQTT publish: topic 'zigbee2mqtt/Escritorio_HueGr2', payload '{"brightness":100,"color":{"x":0.242355094382,"y":0.119824558987},"color_temp":124,"state":"ON"}'
Zigbee2MQTT:info  2020-12-24 13:39:20: MQTT publish: topic 'zigbee2mqtt/Escritorio_Old_Hue_Bulb', payload '{"brightness":100,"color":{"x":0.242355094382,"y":0.119824558987},"color_temp":124,"linkquality":138,"state":"ON"}'
Zigbee2MQTT:info  2020-12-24 13:39:24: MQTT publish: topic 'zigbee2mqtt/Escritorio_HueGr2', payload '{"brightness":100,"color":{"x":0.242355094382,"y":0.119824558987},"color_temp":124,"state":"OFF"}'
Zigbee2MQTT:info  2020-12-24 13:39:24: MQTT publish: topic 'zigbee2mqtt/Escritorio_Old_Hue_Bulb', payload '{"brightness":100,"color":{"x":0.242355094382,"y":0.119824558987},"color_temp":124,"linkquality":138,"state":"OFF"}'

Posted on
Thu Dec 24, 2020 10:56 am
siclark offline
Posts: 1960
Joined: Jun 13, 2017
Location: UK

Re: zigbee2mqtt & zigbee USB for Hue bulbs

I think you might have solved a problem I have had for a while in that my indigo icons also don’t work. Not sure why on is required there though. Interested to what Joe says

Simon

Posted on
Thu Dec 24, 2020 11:33 am
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: zigbee2mqtt & zigbee USB for Hue bulbs

Hmm. I've seen this before, and I thought I fixed it. Maybe not.

Let me see if I can replicate this.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Dec 24, 2020 12:23 pm
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: zigbee2mqtt & zigbee USB for Hue bulbs

Ok, I was able to replicate the behaviors based on the payloads Cesar posted. Here's what's going on, as best I can tell. I'm using some shorthand for the commands.

When turning on the device using ON/100, all works as expected, and the status reply from the bridge also reports ON/100.

When turning off the device using OFF/(any), the device turns off, but the status replay from the bridge is OFF/(previous brightness level). The bridge ignores the brightness when it gets an OFF.

When turning off the device using ON/0, the bridge (or actual device) interprets this correctly and the status reply is OFF/0.

The problem is that Indigo uses the brightness value to override the on/off state. When I set the (Indigo) device's state to OFF/100, the non-zero brightness causes the state to be ON. I set both states in the same update.

I can understand why the bridge retains the brightness level, so going ON->OFF->ON would go back to the original brightness.

I think the best thing here is for the plugin to only update the brightness level if the state is ON.

Try this pre-release: https://github.com/FlyingDiver/Indigo-S ... /tag/0.3.8

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Dec 24, 2020 2:29 pm
cesarvog offline
User avatar
Posts: 155
Joined: Aug 13, 2016
Location: Brazil

Re: zigbee2mqtt & zigbee USB for Hue bulbs

Thanks once again, Joe. You nailed it, as always.

New version solves the problem and we can now put "state":"OFF" in the Off Action Payload field, as dictated by common sense.

Best regards,
Cesar

Posted on
Thu Dec 24, 2020 3:01 pm
FlyingDiver offline
User avatar
Posts: 7210
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: zigbee2mqtt & zigbee USB for Hue bulbs

Release 0.4.0 on the plugin store. Includes several sets of fixes in pre-release versions.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat Dec 26, 2020 10:24 am
cesarvog offline
User avatar
Posts: 155
Joined: Aug 13, 2016
Location: Brazil

Re: zigbee2mqtt & zigbee USB for Hue bulbs

Got it. Working nicely. Tks once again for all the hard work and fantastic turnaround time.

Who is online

Users browsing this forum: No registered users and 2 guests