[Release] Logitech Harmony Hub Driver v0.1.20230311

Ok, so you're recommending to leave it as simply

else if ((json?.type == "automation.state?notify")  && (description.contains('"status":1'))) {

Just want to make sure. This means for me to make no changes whatsoever, correct?

Yup. Thanks

1 Like

I tested this with hue before I even released it to @ogiewon. Nothing needed to be changed. It just needed to be everything in the quote, including hue- in the event log.

FWIW, have had my SmartThings hub disconnected for 3 weeks now. These buttons are fine, still

1 Like

I actually have the Yamaha AVR on both but it is the only one. I can now trigger any of the rules. I have set up a few applications to simplify using it. The Logitech has issues when it come to powering device ON and OFF which is why I stopped using it. It took awhile but I finally got it mostly working like I want. I had to set it to never control the power and just use HDMI-CEC the have the TV an AVR work together. The TV and AVR are on the Harmony Hub. I now have to mute via the Logitech remote or Hubitat but that is fine.

But how does it recognize a pusof a button associated with the "hue-"? From my experience, the status is never 1 (status:1) when a button associated with the hue is pushed.

Give me the full output of the log on press, then press and hold. I'll show you

Push log:

[dev:52](http://192.168.1.222/logs#dev52)2020-11-10 03:04:19.210 pm [info](http://192.168.1.222/device/edit/52)Unhandled data from Harmony Hub. json = {"type":"automation.state?notify","data":{"hue-00:17:88:01:02:4c:d6:80-0b":{"color":{"mode":"hs","xy":{"y":0.4109,"x":0.4562},"temp":362,"hueSat":{"hue":8520,"sat":140}},"brightness":145,"on":true,"status":0}}}

[dev:52](http://192.168.1.222/logs#dev52)2020-11-10 03:04:19.206 pm [debug](http://192.168.1.222/device/edit/52)[type:automation.state?notify, data:[hue-00:17:88:01:02:4c:d6:80-0b:[color:[mode:hs, xy:[y:0.4109, x:0.4562], temp:362, hueSat:[hue:8520, sat:140]], brightness:145, on:true, status:0]]]

[dev:52](http://192.168.1.222/logs#dev52)2020-11-10 03:04:19.202 pm [debug](http://192.168.1.222/device/edit/52)parsed: {"type":"automation.state?notify","data":{"hue-00:17:88:01:02:4c:d6:80-0b":{"color":{"mode":"hs","xy":{"y":0.4109,"x":0.4562},"temp":362,"hueSat":{"hue":8520,"sat":140}},"brightness":145,"on":true,"status":0}}}

[dev:52](http://192.168.1.222/logs#dev52)2020-11-10 03:04:18.813 pm [info](http://192.168.1.222/device/edit/52)Unhandled data from Harmony Hub. json = {"type":"control.button?pressType","data":{"type":"short"}}

[dev:52](http://192.168.1.222/logs#dev52)2020-11-10 03:04:18.809 pm [debug](http://192.168.1.222/device/edit/52)[type:control.button?pressType, data:[type:short]]

[dev:52](http://192.168.1.222/logs#dev52)2020-11-10 03:04:18.806 pm [debug](http://192.168.1.222/device/edit/52)parsed: {"type":"control.button?pressType","data":{"type":"short"}}

Hold log:

[dev:52](http://192.168.1.222/logs#dev52)2020-11-10 03:05:21.007 pm [info](http://192.168.1.222/device/edit/52)Unhandled data from Harmony Hub. json = {"type":"automation.state?notify","data":{"hue-00:17:88:01:02:4c:d6:80-0b":{"color":{"mode":"hs","xy":{"y":0.4109,"x":0.4562},"temp":362,"hueSat":{"hue":8520,"sat":140}},"brightness":145,"on":false,"status":0}}}

[dev:52](http://192.168.1.222/logs#dev52)2020-11-10 03:05:21.004 pm [debug](http://192.168.1.222/device/edit/52)[type:automation.state?notify, data:[hue-00:17:88:01:02:4c:d6:80-0b:[color:[mode:hs, xy:[y:0.4109, x:0.4562], temp:362, hueSat:[hue:8520, sat:140]], brightness:145, on:false, status:0]]]

[dev:52](http://192.168.1.222/logs#dev52)2020-11-10 03:05:21.000 pm [debug](http://192.168.1.222/device/edit/52)parsed: {"type":"automation.state?notify","data":{"hue-00:17:88:01:02:4c:d6:80-0b":{"color":{"mode":"hs","xy":{"y":0.4109,"x":0.4562},"temp":362,"hueSat":{"hue":8520,"sat":140}},"brightness":145,"on":false,"status":0}}}

[dev:52](http://192.168.1.222/logs#dev52)2020-11-10 03:05:20.885 pm [info](http://192.168.1.222/device/edit/52)Unhandled data from Harmony Hub. json = {"type":"control.button?pressType","data":{"type":"long"}}

[dev:52](http://192.168.1.222/logs#dev52)2020-11-10 03:05:20.882 pm [debug](http://192.168.1.222/device/edit/52)[type:control.button?pressType, data:[type:long]]

[dev:52](http://192.168.1.222/logs#dev52)2020-11-10 03:05:20.879 pm [debug](http://192.168.1.222/device/edit/52)parsed: {"type":"control.button?pressType","data":{"type":"long"}}

All you need is hue-00:17:88:01:02:4c:d6:80-0b to have that captured. Forget the rest of it because it says "data":{"type":"long"}" (or short) and that's the info we use to get the button press, "status" never comes into play.

The issue was that @ogiewon's code checks for status:1 so only a push sends a button event. If you leave that out, many other button events would get sent (duplicate events and if the button includes hue bulbs, additional events also get sent). If you look at my post about 9 posts above, that details what happens when "status:1" is removed.

But, didn't you also say that it didn't need to be done at the end of all that? I have been reading the thread every time there is a new post :slight_smile:

When I incorporated your Home Control button logic, I discovered that for every press or hold of the button on the remote, the code would generate two 'pushed' or 'held' events. Thus, I added the extra filter of status:1 to avoid that issue. Unfortunately, this appears to break trying to use a Hue mapped button for the same purpose we've been using ST mapped buttons on the remote.

We need a filter that allows one, and only one, event to be processed from both a ST mapped button and a Hue mapped button.

1 Like

Yes, because the fix created its own issues i.e. the many button events. So I decided having hue mapped buttons work were not worth the pseudo events.

FYI, I am thinking about ways to make the last functioned light go brighter and dimmer with the rocker. Just haven't had a lot of time.

If any of you have any ideas, please let me know.

Once I take a look at it, it should be pretty easy.

Hello, thanks for that great driver.

On my side to use the + and - rocker button, I added a few lines in your code, below the part for Bulb One. I did that for Bulb One, Bulb Two, Socket One & Socket Two. And added attributes "level1" to "level4" as Numbers.

It works great, when I press the rocker button it updates the level bettwen 0 and 100 (10 by 10) and I can use it in RM to change the level of a lamp, with a local variable and custom attribute.

     if (hcBulbOne) {

        if (description.contains(hcBulbOne)) {
            def tempbrightness = json?.data[hcBulbOne].brightness
            tempbrightness = Math.round(tempbrightness/254*100/10)*10
            sendEvent(name:"level1", value: tempbrightness, descriptionText: "Buld Button 1 Dimmer Level changed", isStateChange: true)
        }
          
	    if ((description.contains(hcBulbOne)) && (description.contains('"on":true'))) {
		    if (logEnable) log.debug "Bulb Button 1 was 'pushed'"
		    sendEvent(name:"pushed", value: 1, descriptionText: "Bulb Button 1 was pushed", isStateChange: true)
        }   
	    if ((description.contains(hcBulbOne)) && (description.contains('"on":false'))) {
		    if (logEnable) log.debug "Bulb Button 1 was 'held'"
		    sendEvent(name:"held", value: 1, descriptionText: "Bulb Button 1 was held", isStateChange: true)
        }
    }

Hope it can help.

2 Likes

Can you upload your driver to github or pastebin?

I would like to see more of how this works because, I use webCoRE.

Thanks.

@ogiewon

I have the code finished for the + and - rocker switch.

Should I just post it to my github and you can take it from there?

There is a very interesting way to use this.
It uses brightness from the Smartthings dimmer. So what I had to do is write a webCoRE piston (SmartThings webCore) that makes my brightness 50% any time it's changed on any of my virtual dimmers, or any turn off/on.

It does give the ability to use this rocker/dimmer on the bottom of the remote with a caveat that you can control the levels on those virtual dimmers that you have in the Light 1-Socket 2 buttons.

If ANY of you are sick of work-arounds like I am... Please write to Harmony to ask them for Hubitat support.

Sure, that's fine. Just provide me with a link and I'll take a look at it. I am curious how this works as I recall looking at the packets that came in from the webSocket connection when that level adjust button was pressed up and down - I recall not being able to discern which of the two "Lights" it was associated with... :thinking:

Here you go:

I am sure it could use some fine touching, but it works as expected.

1 Like

Thank you @fabien.giuliano and @abuttino! I have incorporated the code changes into my GitHub version.

1 Like

I've only connected myself now after a few days offline, happy to see my post was useful. Thank you !

1 Like