@iandday - so far (after minor install issues) this component is really cool, some notes from my use / experience:
ISSUE: After rebooting my Pi3 which runs HASS, I need to remove the harmony_conf_XXX.txt file and restart HASS (all other types of HASS restart do not require this step, only full power cycle of the Pi)
POSSIBLE ISSUE: I find that the frontend can sometimes take a long time to reflect reality (up to a couple of minutes) - this is both for “switches” (input_boolean) and the sensor itself - the most noticeable occurrence is when using my Amazon Echo to turn on an activity, Alexa responds with “OK” then a varying period of time before the activity actually starts
Despite the “possible issue” listed above, I love being able to get Alexa to turn on / off my stereo! Great work!
Let me know if any additional details would be helpful…
Thanks for the feedback. Does HASS fail to start after a reboot if the conf file is not removed?
Is there any way you can sanitize some logs for me that include a few actions involving the harmony remote? I’d like to see how much the times are varying between activating the “switch” and the remote’s current_activity being updated.
In the meantime I need to read up on Async operations, I rebased my fork to bring it current and am not having some strange errors when I have more than one hub specified in my config files
Does HASS fail to start after a reboot if the conf file is not removed?
Correct, HASS simply hangs and never becomes “truly active”. I can’t browse to it, or interact with it, despite the process remaining active. I kill the process, delete the file and “hey presto”, HASS starts, a new config file is generated.
Is there any way you can sanitize some logs for me that include a few actions involving the harmony remote?
I will look through some logs and give you as much as I can - was thinking of recording a video or something too - will see what I have time for!
@Iandday Do you have an example of a working action using the send command service? I can’t get my hub to respond to the request, and home assistant isn’t logging any errors.
and here’s the section of my harmony_conf.txt for the device I"m trying to control:
35163109 - Direct TV DVR
PowerOff
PowerOn
NumberEnter
Hyphen
Number0
Number1
Number2
Number3
Number4
Number5
Number6
Number7
Number8
Number9
PrevChannel
ChannelDown
ChannelUp
DirectionDown
DirectionLeft
DirectionRight
DirectionUp
Select
Stop
Play
Rewind
Pause
FastForward
Record
SkipBackward
SkipForward
Menu
Back
List
Green
Red
Blue
Yellow
Guide
Info
Exit
RedCircle
I dont have any examples that include sending a specific command, only starting an activity. In your example it looks like you specified the start_activity service instead of the send_command service. That might be what’s causing your issue
I just installed this myself and was able to get it working quickly.
I too am experiencing a lot of latency between commands. As someone else pointed out, that might be because it’s going through a bunch of stuff. On that note, is there any hope of communicating with the Harmony Hub locally? I am not sure which route of communication that harmony-api uses (Node.js), but it is lightning fast and doesn’t miss a beat.
Aside from that, my thoughts/ideas would be:
Slugify the name when creating the harmony_conf.txt file
Switch to using the extension .conf to conform with other components
Allow devices to be called by name, instead of just by ID
Somehow add activities and devices to the attributes of the remote
If I think of any more, I’ll be more than happy to share.
Thanks again for all of your hard work in bringing this to light. This is something that has been missing from Home Assistant for far too long!
I think I can rework the underlying module to query the config once at boot instead of each time a command is called, that should slow it down.
Pyharmony does communicate with the hub locally, it only has to reach out to Harmony’s servers to swap the credentials for an auth code, all the rest is done with the XMPP server in the hub.
I initially thought about activities and devices being added as attributes but thought that would make the state screen pretty polluted. The externally generated file would still be needed to reference the available commands per device.
I’ll post an update if I can get the speed increased
Now onto my issues. Straight away, I had problems with my remote. I tried to turn on an activity on my remote, but the touch screen would not respond to anything. I could switch between devices and activities fine, but as soon as I tried to press an activity like “Watch TV”, nothing would happen on the remote. Then all of a sudden, a message came up saying “cannot communicate with Hub, try moving closer”. I’ve never seen that before.
Eventually, I tried another activity and it started. The TV turned on and it was loud! So I tried to press the mute button. Nothing. Tried to turn the volume down, nothing. Interestingly I could change the channel though.
I went back to my PC and shut down Home Assistant docker stop home-assistant and once stopped, I could control the volume on my TV again (Sonos Playbar using HTTP control from Harmony Hub).
After confirming my remote was working again, I restarted Home Assistant docker start home-assistant and once booted, my remote immediately became unresponsive. It took about 2 minutes for my remote to change a TV channel, and I once again can’t control the volume on my Sonos Playbar. I’ve also been unable to use the remote service to change the activity.
I’ve updated pyharmony to a new version as well as the remote code. Prior versions were logging into Logitech’s servers at each request to swap credentials for a token which is needed to authenticate to the local hub. This version logs into the servers at boot and reuses the token, the token appears to be fairly static, mine has stayed the same over the past three days. The reaction times have improved on my setup, hopefully everyone else is the same.
I’ve changed the generated file by sluggifying the remote’s name and changing the extension to ‘conf’.
@philhawthorne
It sounds like your hub was getting hit to hard with requests. Can you delete the remote directory in custom_components directory and replace the remote directory in your HASS installation directory? Hopefully the new method will not interfere with your remote.
I’m very excited to see that a Harmony Hub plugin is being developed for Home Assistant. Thank you!
However, I’ve just installed it using pip inside the virtual environment and I’m not sure what I’m doing wrong but I get the following result when I check the config:
(homeassistant_venv) homeassistant@homepi:~/.homeassistant $ hass --script check_config Testing configuration at /home/homeassistant/.homeassistant
16-10-31 19:09:40 ERROR (Thread-1) [homeassistant.loader] Unable to find component harmony
Failed config
General Errors:
- Component not found: harmony
Successful config (partial)
If I run it directly from where it was installed it seems to work, but if I call it as shown some posts above it fails.
(homeassistant_venv) homeassistant@homepi:~/.homeassistant $ /srv/homeassistant/homeassistant_venv/bin/harmony
usage: harmony [-h] --email EMAIL --password PASSWORD --harmony_ip HARMONY_IP
--harmony_port HARMONY_PORT
[--loglevel {WARNING,DEBUG,INFO,ERROR,CRITICAL}]
{show_config,show_current_activity,start_activity,power_off,sync,send_command}
...
harmony: error: the following arguments are required: --email, --password, --harmony_ip, --harmony_port
(homeassistant_venv) homeassistant@homepi:~/.homeassistant $ python3 pyharmony
python3: can't open file 'pyharmony': [Errno 2] No such file or directory
What have I done wrong? Any tips greatly appreciated.
The scan interval is set to 30 seconds, so you might have been right on the edge of the scan interval. I tried to manually update the status in the turn_on activity but it doesnt seem to have any effect. If you’re feeling saucy you can try to lower the value on line 29 of init.py and see if it interferes with the remote, I’d love to hear the results.