[Release] Logitech Harmony Hub Driver v0.1.20230311

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

Did you make any changes to this?

I have the log running and it shows that the + and - button are getting 'button pressed' as well as the level being adjusted.

Maybe something should be better in and else statement.

Again, I haven't looked at the code yet... Doing it now. If necessary, I'll edit this post.

No, I don't believe I made any changes that would impact that behavior. All I did was some code cleanup. This issue is what I was concerned about initially...that the increase/decrease button presses might not be discernable from the pushed/held presses of the other 4 buttons.

Please let me know what you find.

It just needs a second piston in webCoRE. Can't do it in the same piston as the button pushing and holding.

Is there any plan to add Hubitat Package Manager support? I think this would be a significant value add to keep users up to date.

2 Likes

I am not actively working on adding any of my code to the Community Hubitat Package Manager. I do not personally use HPM, and most of my code is fairly mature and thus does not change very frequently. I also would hate for users to blindly upgrade the code via HPM, discover issues, and then have to deal with the fallout... I see the value in HPM, but I am just not overly eager to have to maintain yet another tool.

Thank you for your understanding.

10 Likes

I didn't see this mentioned in this thread but is there any way to make the rocker buttons work?

I assume you're referring to the 'Home Control' bulb and socket buttons? If so, here's a good place to start reading the thread...

No, I'm referring to the + / - button between the bulb and socket buttons. It shows in the log that it's changing the level of the associated bulb but it doesn't actually affect the bulb itself.

Capture

So, the data is being collected and events are being fired. It is up to the user to determine how to use that data. @abuttino and @fabien.giuliano may be able to explain how they are using that data. It is not perfect, but it's something. :wink:

Here is something that might help you.

FYI I noticed that you have taken all the child devices off the beginning of this thread. Trying to install for a friend and there were no children getting made, had to use my drivers code from you to get him running.

Not sure what you’re referring to exactly. I haven’t removed anything. The Child Switch driver is linked in the ReadMe. I just verified that the link still works.

OOPS!! Sorry about that. I see it now.

1 Like