Previous discussion here.
I’d love to have the ability to do more than just call an activity, like sending individual commands (Play, pause, etc) through the hub!
I have a Harmony hub and can definitely help with testing.
Does the pyharmony still work? I might take a crack at this.
Edit: Yes, looks like my weekend just disappeared…
I have multiple hubs at home i’d love to help testing this.
I would like to be able to respond to events from the hub, like play is pressed, pause is pressed etc. This would allow to define triggers in HA based on these events. Like turn off lights when play is pressed.
I too am available for testing. Would love to see this!
Any update on this? Just checking!
I am also available for testing. Any movement on this feature request? I have 0.0 technical ability to add to developing this component but am willing to help anyway I can in a non-technical capacity. This is a much needed component and is really amazing to me that hasn’t been integrated yet given Harmony remotes’ popularity.
I’ve written .NET libraries for interacting with Harmony, but I don’t know Python. If anyone wants to tackle this, you could probably have a beta together in a weekend (that’s about how long it took me to do a working C# implementation).
If a Python dev wants to partner up, I can provide some insight around some of it, I just have no idea how you do something similar to what I did with stream reading on the python side.
- Open a raw Tcp socket to the Harmony.
- Get a handle to the Tcp stream and start parsing responses.
- Send opening stream preamble.
- Send login / pass to logitech to get a token.
- Authenticate to the Harmony hub using that token (now you can send commands instead of just read only).
- Run some background thread that sends a heartbeat request every 30 seconds to keep the stream alive.
Note that the Harmony seems to only advertise changes of the Current Activity, I haven’t been able to get it to send notifications of button pushes. The only real “state” it maintains is the Current Activity, and it exposes a few calls that will return configuration (which includes all of the available devices and commands, which you can read from and then send back).
I have no insight into how HASS does its stuff here, and this is just how I did it. I’ve seen other implementations do the whole thing in one big event loop too, though I didn’t really like that approach. Unfortunately, I’m unlikely to do anything with HASS until this has been added, as I’d be breaking a good chunk of my existing system just to try it out.
I’ve just read over the previous discussion and briefly reviewed the numerous pyharmony forks.
pyharmony seems to be in a bit of disarray. It has some excellent docs on the protocol, but other languages have used that to implement fuller clients. The original pyharmony was updated just over 3 years ago, and never was configured with setuptools so never made it to pypi. A bunch of forks did add setuptools, but never did publish. They seemed to add it independently too.
Here’s the forks that seem the most active in the past few months:
- https://github.com/rkitover/pyharmony: last active in May
- https://github.com/ChrisMD123/pyharmony: forked from rkitover, last active in July
- https://github.com/WisdomWolf/pyharmony: active today!
I’ve also reviewed how https://github.com/maddox/harmony-api is implemented. It’s using two libraries under the hood: harmonyhubjs-discover for finding the hub on the network, and harmonyhubjs-client for interacting with it. pyharmony fills second role, so either we’d need a python way to discover it, or require a hard-coded IP address, which usually also implies doing network setup to give a static IP.
A totally different approach might be to implement a component that is designed to work with harmony-api. It could depend on mqtt, and discover devices on it, and create mqtt switches to represent it. It might also be possible to do a media_player implementation using mqtt, with the goal of being harmony-api compatibility.
Right now, that’s how I have implemented the Harmony-API; with mqtt switches. I appreciate the efforts you have put into your research; obviously you value this integration as much as I do.
I just wanted to post an update to this. @iandday has been working on this and has a pretty solid solution but I know he could use some help finalizing a few things. I’ve been helping with testing but he could use help with writing the coverage test file if anyone could be of assistance.
The post is here:
You’d probably do better posting this request in the developer section and reaching out on gitter. I’ve been following his progress and would help if I could but I lack the same experience he needs.
@iandday’s pull request was merged in time for 0.34 (might be 0.35). Closing this topic as Home Assistant now has Harmony support.