Testers Needed - Harmony Hub Support Implemented in Python

glad to see you got it working in HASS, the code only tells the hub to start an activity, it doesn’t fire the individual commands unless you use the send_command service

Good to know and its working fine today, no idea why it was playing up yesterday! Works really well so my next thing to look into is to try to get it working with Amazon Echo so I can get rid of Yonomi. Thanks again

She’s dead, Jim.

16-11-17 23:06:53 pyharmony.auth: Malformed JSON (GetUserAuthTokenResult): {'GetUserAuthTokenResult': None}
16-11-17 23:06:53 homeassistant.components.remote.harmony: Logitech login failed for remote: Living Room

worst.post.ever

looks like it’s time to bust out wireshark :cry:

I feel ya. When I pulled the hass logs at work today after seeing pyharmony fail to pull the current activity, I knew this wasn’t going to be a fun issue to resolve.

I ran a manual curl login, and sure enough, the server is returning null for GetUserAuthTokenResult.

curl -H "Content-Type: application/json" -X POST -d '{"password":"$PASS","email":"$MAIL"}' http://svcs.myharmony.com/CompositeSecurityServices/Security.svc/json/GetUserAuthToken --verbose
* Hostname was NOT found in DNS cache
*   Trying 107.23.49.148...
* Connected to svcs.myharmony.com (107.23.49.148) port 80 (#0)
> POST /CompositeSecurityServices/Security.svc/json/GetUserAuthToken HTTP/1.1
> User-Agent: curl/7.38.0
> Host: svcs.myharmony.com
> Accept: */*
> Content-Type: application/json
> Content-Length: 51
>
* upload completely sent off: 51 out of 51 bytes
< HTTP/1.1 200 OK
* Server nginx/1.2.4 is not blacklisted
< Server: nginx/1.2.4
< Date: Thu, 17 Nov 2016 23:37:40 GMT
< Content-Type: application/json; charset=utf-8
< Content-Length: 31
< Connection: keep-alive
< Cache-Control: private
< X-AspNet-Version: 4.0.30319
< X-Powered-By: ASP.NET
<
* Connection #0 to host svcs.myharmony.com left intact
{"GetUserAuthTokenResult":null}

lol i just came to the same conclusion, saw a similar post on the domiticz forums as well.

At least the mqtt bridge is still working for harmony. I’ve modified my input states to use it was well.

I don’t know if it helps, but I have none of these issues… HASS 0.32.3, pyharmony 1.0.9

the issue should only popup the next time you restart HASS and pyharmony attempts to obtain the authtoken from logitech’s servers.

Using burp to intercept the traffic from the windows Harmony app failed, i’m going to try fiddler next to see how the windows app is handling authentication and then try to mimic that

are you using @maddox’s Harmony API bridge? The underlying harmonyhubjs-client code appears to be using the same authentication method of logging into the logitech servers. It looks like it would work up until the next time it attempts to retrieve an authcode from the servers.

Yes, and good to know :disappointed:

Update: Actually with my maddox harmony bridge I’m not doing any auth. Does that matter?

Ah, updated and restarted pi and HASS - now I get the same error:
pyharmony.auth: Malformed JSON (GetUserAuthTokenResult): {‘GetUserAuthTokenResult’: None}

you never had to supply your logitech registered email address and password when you configured the maddox harmony bridge?

I’ve got action! :grin:

Fiddler was able to intercept and decrypt the packets coming from the myHarmony app on windows, it’s using a two stage authentication method now instead of hitting the single URL. I rewrote the login function of pyharmony and it appears to be working. It’s pretty ugly and needs more work on the logging portion but I should be able to get it ready for testing this weekend

4 Likes

Awesome work!

alright we should be good to go. pyharmony was bumped to 1.0.11 and is available via PIP. I did change the harmony code in hass, but only to display the remote’s authToken as an attribute.

1 Like

Where would I find the new settings to get the new authToken?

you should be able to remove pyharmony 1.0.10, replace it with 1.0.11 and have it functioning. That’s how I got my dev environment to work again.

Seems you are correct. Looks like my logs just didn’t update after restarting HASS. My logs showed:

16-11-18 19:55:20 pyharmony.auth: Malformed JSON (GetUserAuthTokenResult): {'GetUserAuthTokenResult': None}
16-11-18 19:55:20 homeassistant.components.remote.harmony: Logitech login failed for remote: Living Room TV

I just didn’t look at the date stamp. After about a minute it’s working properly again. I also updated my remote folder just to be sure.

Excellent work as always @iandday!

great to hear :grinning: