[Release] Logitech Harmony Hub Driver v0.1.20230311

I see the same warning. I don’t believe it is anything to be concerned about.

1 Like

Ok, thanks for taking your time looking into it.

@ogiewon

Dan, I am trying to move back to controlling my Harmony Hubs direct from Hubitat rather than via my Pi/Home Assistant system. I've recently loaded the latest version of your driver and like the recent enhancements a lot.

I have also discovered that, with a small tweak, it is now possible to send a specific device command independent of activity which is one of the things I could do via the HA integration but couldn't previously find a way to do in Hubitat. That to me is a game changer. For example I have a device on Harmony that I have taught the commands to control some IR candles that SWMBO has. I need to be able to turn them on or off regardless of what activity is running. Because I know the command and device ID from the device list that the HA system produces I just created 2 extra commands in the device code like this:

        command "candleson"
        command "candlesoff"

def candleson() {
         deviceCommand("PowerOn", 65524573)
      }

def candlesoff() {
         deviceCommand("PowerOff", 65524573)
      }

And now I can send a custom command to turn the candles on or off. It works great regardless of which, or any, activity is running.

I'm not sure if it would be possible to have a generic command where users could send their specific commands via parameters? I don't know how you would get the specific device ID without the HA interface but the commands available for each device are visible in the Harmony app if you go into the fix commands part of the device settings.

Just thought I'd throw this out there.

9 Likes

@Geoff_T Geoff - Yippee! This is a game changer. I can dump Maddox' harmony-api, and do everything Harmony-related that I need just through Hubitat.

Thank you so much for sharing this!

1 Like

It would be awesome if e could have some kind of UI control over this some day.
I used a bunch device key control with my Homey to change between movie and game mode on my Tv. Since moving to HE I have to use the TVs remote. Would love to be able to switch mode automatically again. :slight_smile:

Couldn’t you simply use two Harmony Activities? One for Play a Game and another for Watch a Movie. Each one could put the TV in the correct video mode.

I could but I use movie and game mode on 4 different activities and then I would need 8 activities and I’m to lazy to program all keys to switch modes on the Tv. :slight_smile:
I hade both my HA and Homey to control that before my switch to HE a week ago, so I haven’t spent that much thought on thinking on another way yet.

I've got a similar situation. I use Harmony to control a few AC units, as well as a couple TV/monitors, on top of the home theater. There's no set of activities that would make any sense to control them all, and it would take hundreds to have one for each combination, and there'd be no way to functionally identify them if that was the case. Without individual device control the Harmony is pretty useless for me, despite having a good 10 devices across 2 hubs. The Pi for some reason consistently has problems, but I've never been able to pin down where exactly.

Anybody who wants to take on the challenge of individual device control is more than welcome to have at it. :slight_smile: However, it is a very complicated task to somehow try to incorporate support for the tens of thousands of devices and all of their unique commands into Hubitat, IMHO. Some devices support just On/Off, others support Volume controls, Channel controls, modes, temperature adjustments, brightness controls, etc... It is not a trivial undertaking in my humble opinion.

However, I am fine with @Geoff_T's simple idea of adding a Custom Command that accepts two parameters, the command and the Harmony Device ID. That should be pretty easy to implement. I'll need to take a look at somehow exposing the Device ID list as well, as I am pretty sure it is returned during the Activity Discovery process.

5 Likes

If possible, could you consider adding these as child devices?

Are you suggesting adding each Harmony Device as a child device?

I was simply adding the following 1 liner to the Parent Device as a starting point.

command "deviceCommand", ["String", "Number"]

As this would allow you to issue any Device Command you'd like via Rule Machine, asssuming you know the command string and the numeric Device ID.

2 Likes

I have a new version of the Logitech Harmony Hub Parent Driver available in my GitHub repo for you guys to test. It simply exposed the 'deviceCommand()' function as a Custom Command.

I'll look into parsing the list of device from the hub next to expose their ID's, but that may take some time... :wink:

2 Likes

I have the list of Harmony Devices showing up as a state variable on the device details page. Next step would be to make each of them appear as a child device, which would give you basic PowerOn and PowerOff commands like normal Hubitat Switch devices.

How does that sound @aaiyar?

4 Likes

That's just about perfect. Thank you for considering the request.

Well, some not so great news. I just figured out that while you would be able to issue commands to devices, there is no way to know whether or not the device performed the command. So, there would be no way to update the status of a 'Harmony Device' child switch device. Its state would never be correct. I am not a fan of that behavior.

I could easily add to the Parent Device two new custom commands - "devicePowerOn(deviceID)" and "devicePowerOff(deviceID)" to make it simpler to call these functions. You could look up the deviceID's from the State Variable which is displayed on the Parent Device's detail page. Then, in RM you would use a custom action and paste in the deviceID you want.

Not sure...probably need to think about it some more...:thinking:

For now, I have uploaded the current code to my GitHub that exposes the deviceID's so you can at least use the 'deviceCommand()' custom command.

I have tested the 'deviceCommand("PowerOn", deviceID)' and 'deviceCommand("PowerOff", deviceID)' successfully.

Please be aware that turning on or off devices that are used in Activities will get the Harmony Hub out of sequence.

I can see that being an issue.

Out of curiosity, does it need to have a state? I mean, right now I'm using HTTP momentary switch and the harmony-api, and those virtual devices have no state either ....

Yea, I wondering the same thing. The HTTP Momentary switch does properly implement the 'switch' attribute's state, but also automagically turns the switch back to off after a few seconds. So, it does generate an event which could be used by an app, but probably would never be.

Button Controllers are the closest thing in Hubitat to a true stateless actuator, like what you find on a typical remote control. The typical IR remote control maintains no state about each of the devices you command on or off. The Momentary Capability is another option as it implements the push() command. But since it is only one command, it does not really help.

So, that leaves us with a custom device driver, that implements the Harmony PowerOn() and PowerOff() as custom commands, without any state... Thoughts?

From the perspective of the end user (and admittedly, this is a specialized subgroup who need to control individual devices and not just activities), its no different than what we're currently doing.

So, I'd say its your call.

1 Like

I definitely didn't mean to suggest either that you should do it, or that it was easy :sweat_smile:. Sorry if it came across that way, just wanted to voice that it's a use case.

I don't know anything about the programming of it so I don't know if any ideas I have are useful. I think the Harmony-api solution dealt with the varying commands issue by having a few generic devices 'climate' 'av' I think they had a vacuum and a few others, I only know what I dealt with. The state tracking was done by having whatever device plugged in to a separate energy monitor. It clearly couldn't tell anything other than on/off, but worked reasonably well for that.

I'm on the road so haven't been able to play with what you've uploaded, but thanks muchly for even considering it, let alone the progress.

Wow, that was quick. :slight_smile: I will test it as soon as possible. Thank you for the support!

1 Like