[Release] Logitech Harmony Hub Driver v0.1.20190220


#221

@ogiewon and I used this a while back but it would progressively affect our Harmony Hub's performance until I needed to reboot it (within a week). I'm surprised this hasn't affected your hub. I wonder what's different about your implementation.


#222

I changed the state update times in app.js (line 22 I think?) from 5 seconds to 10 seconds. Since I did that, all three of my hubs have been fine.

It could also be something that was in one of the older firmwares as well. On the past few versions, I've not had any slow downs at all using the harmony-api scripts.


#223

I may have to give this a shot again. I was also planning to test out the node red (contrib-harmony) at some point. Have you played with that node yet?


#224

@corerootedxb - As @stephack mentioned, we used the 'harmony-api' nodejs server for quite a while in the early days of Hubitat, but it caused issues with the Harmony Hubs. I even created a Hubitat HTTP Switch Driver specifically to turn on/off Harmony Activities. One issue using it is that it is one-way communications between Harmony Hub and Hubitat, IIRC. If a remote control is used to change the Activity, Hubitat will get out of synch.

The webSocket implementation is really pretty amazing. Super fast, reliable, and no man-in-the-middle server required.

If volume control is everyone's number one wish, I can take a look at trying to add device support for Harmony device classes that are known to support volume (e.g. Receivers, TV's, etc...) It just has not been a high priority for me personally.


#225

I did and it's actually pretty good! There's even a websocket version of it now.

@ogiewon Yeah, I believe that's all been resolved. However, I'm only doing HTTP POSTs from HE to Harmony for volume using a virtual dimmer (it's messy, imho, but it works). For bi-directional communications, I actually modded your HTTP Momentary Switch driver to call for status after the device command was sent and it worked OK. But, like you, my use case is dead simple for Harmony; Turn on/off activities and occasionally adjust the volume of said activities.


#226

Curious - does anyone know if Volume Control is in any way abstracted away from the specific device controlling volume? It would be nice if logitech exposed a volume control that is tied to the Activity versus a specific home theater component. This would allow for a single, universal volume control which the harmony hub would translate into the correct device specific commands. This would be truly universal and would be much simpler to add and maintain. In fact, the Parent Device could have the volume level commands added directly to it, if this were the case. I just haven't poked around enough yet to know if this is possible.


#227

AFAIK, Yes. If the activity has a volume capable device included in it, then there is a top level volume up/down. If you don't specify a volume device in your activity, the hub just ignores the volume commands.

That's exactly how I do it with the API today. I use the URL: http://[server]:8282/[hub]/commands/volume[up|down]. I can dig through the code and see what that translates to on the hub if it'll help.


#228

Not sure it will help, as the harmony-api is not using webSockets, IIRC. But, I definitely appreciate the information and the offer for assistance!


#229

True. BUT... The NodeRed Harmony API does use websockets. :slight_smile: Give me a sec to dig through that code base. I might be able to find something quickly.


#230

I found this:

getActivityCommands(activityId) {
        return this.getConfig()
            .then(response => {
                var activity = response.data.activity
                    .filter(act => {
                        return act.id === activityId
                    })
                    .pop();
                return activity.controlGroup
                    .map(group => {
                        return group.function
                    })
                    .reduce((prev, curr) => {
                        return prev.concat(curr)
                    })
                    .map(fn => {
                        return {
                            action: JSON.parse(fn.action),
                            label: fn.label
                        }
                    });
            });
    }

sendCommands(action) {
        var payload = {
            hubId: this._remoteId,
            timeout: 30,
            hbus: {
                cmd: 'vnd.logitech.harmony/vnd.logitech.harmony.engine?holdAction',
                id: 0,
                params: {
                    status: 'pressrelease',
                    timestamp: '0',
                    verb: 'render',
                    action: action
                }
            }
        };

        return this._client.open()
            .then(() => this._client.sendRequest(payload));
    }

So, I'm guessing the fast track would be to send a command of volume-[up|down] to the activity id?

I can PM you the complete file if you want to dig around in it.


#231

Another vote for yes IIRC. I was running something on a node.js server awhile back and set up volume control to use with Google Home, I believe I was doing it through the activity rather than the device.


#232

@ogiewon, I installed the Harmony driver, child driver. Everything came up ok. I can turn things on/off from the device page.

I have an app that I wrote to do certain things and one of them is to turn off the TV at bedtime. I previously used that with ST and used mediaController for my input, and acitivityOff() for my command.

It seems that it is different with HE. So I use switch for my input? And then to turn things off do I turn the OFF device on? And if so, do I need to turn that back off to be reset for the next time?

Hope that made sense.


#233

Another vote for yes here.


#234

Correct, you can either turn off the current Activity switch OR you can turn on the Power Off Activity switch. No need to reset anything. Only 1 of the 'Activity Switches', including the 'Power Off switch', will ever be active at any given time. Turning ON any activity will cause all of the others to 'turn off' automatically.


#235

I have setup four virtual devices in my ST hub and added them to the companion remote. I can see a string in the logs when the buttons and brightness are pressed. I think the next step is to try and get my hands on your code to setup the Hubitat to respond to the input. May I get a copy of your code and some quick instructions if they are available?


#236

Sent you a PM