Harmony Hub

At line 24, it looks like this:

var mqttClient = mqtt.connect(config.mqtt_host, {username: 'harmony', password: 'REDACTED', port: 17070})

I had problem using the secure ports, and on CloudMQTT I have to specify the port.

Absolutely correct. Those state messages can then update HA accordingly. It should go both ways; hitting a switch on the HA side should turn on the relevant activity on the Hub.

I may have just had a lighting bolt moment, in that I use DuckDNS for my MQTT, instead of the local broker, so its very likely that is the reason why it hasn’t been communicating. If I don’t have any authentication (i.e. no username/pw) for DuckDNS, what would I put in after the {username:} and {password:}. Would I just leave them blank?

I am very hopeful that using the DuckDNS for the mqtt_host will solve my problems and I’m going to try as soon as I get home!

I’m not sure I understand; do you mean you use the DuckDNS address for your PI? Or does DuckDNS also provide a MQTT service?

I use it to port forward the local broker (which is on the Pi), so I guess now that I’m saying it out loud it might not matter whether it’s the IP of the local broker or the DuckDNS, since the Harmony is on the same network as the local broker

I would use the local IP of the broker.

thanks @rpitera! MQTT is communicating now. Thanks again for all your help!

Awesome! Glad we could work it out.

Maddox MQTT has been working great for activities. However, I really wanted to get device control working. Looks like it’s been done just about everywhere else using HarmonyHubControl. I compiled it into raspian and they have precompiles for OS X and others. It was super simple to get working, but to access it you will have to make script calls.

./HarmonyHubControl
Syntax:
HarmonyHubControl [harmony_ip] [command (optional)]
where command can be any of the following:
list_activities
list_activities_raw
get_current_activity_id
get_current_activity_id_raw
start_activity [ID]
list_devices
list_devices_raw
list_device_commands [deviceId]
list_device_commands_raw [deviceId]
issue_device_command [deviceId] [command]
get_config
get_config_raw

./HarmonyHubControl 10.0.1.16 list_devices
LOGITECH WEB SERVICE LOGIN : BYPASSED
HARMONY COMMUNICATION LOGIN : SUCCESS
HARMONY COMMAND SUBMISSION : SUCCESS
PARSE ACTIVITIES AND DEVICES : SUCCESS
Devices Controllable via Harmony :

“Yamaha AV Receiver”:“37313948”,“Vizio TV”:“37313947”,“Apple TV Gen 4”:“37314197”,“Panasonic DVD/Blu-ray player”:“37483620”,“Panasonic Projector”:“37313949”}

./HarmonyHubControl 10.0.1.16 list_device_commands 37313947
LOGITECH WEB SERVICE LOGIN : BYPASSED
HARMONY COMMUNICATION LOGIN : SUCCESS
HARMONY COMMAND SUBMISSION : SUCCESS
PARSE ACTIVITIES AND DEVICES : SUCCESS
Harmony Commands for Device:

“Television”:“Vizio TV”,“ID” :37313947,“Vizio”:“M70-C3”,“Functions”: {
“Power”:[
“PowerOff”,
“PowerOn”,
“PowerToggle”],
“NumericBasic”:[
“Enter”,
“.”,
“-”,
“0”,
“1”,
“2”,
“3”,
“4”,
“5”,
“6”,
“7”,
“8”,
“9”],
“Volume”:[
“Mute”,
“VolumeDown”,
“VolumeUp”],
“Channel”:[
“ChannelPrev”,
“ChannelDown”,
“ChannelUp”],
“NavigationBasic”:[
“DirectionDown”,
“DirectionLeft”,
“DirectionRight”,
“DirectionUp”,
“OK”],
“TransportBasic”:[
“Stop”,
“Play”,
“Rewind”,
“Pause”,
“FastForward”],
“TransportRecording”:[
“Record”],
“NavigationDVD”:[
“Menu”,
“Back”],
“PictureAdjustment”:[
“Pic”],
“NavigationExtended”:[
“Guide”,
“Info”,
“Exit”],
“DisplayMode”:[
“Wide”],
“PictureAdjustment”:[
“Pic”],
“GoogleTVNavigation”:[
“Netflix”],
“Miscellaneous”:[
“Amazon”,
“ClosedCaption”,
“iHeartRadio”,
“InputAv”,
“InputComponent”,
“InputHdmi1”,
“InputHdmi2”,
“InputHdmi3”,
“InputHdmi4”,
“InputHdmi5”,
“InputNext”,
“InputTv”,
“Media”,
“VIA”,
“Vudu”]}}

./HarmonyHubControl 10.0.1.16 issue_device_command 37313947 PowerOff
LOGITECH WEB SERVICE LOGIN : BYPASSED
HARMONY COMMUNICATION LOGIN : SUCCESS
HARMONY COMMAND SUBMISSION : SUCCESS

I don’t think it’s been mentioned here yet so I hope this helps someone else.

3 Likes

This is exactly how I’ve done it 2 days ago as well, here is the config for those who like to use it the same way:

scenes:
https://paste.xsnews.nl/view/vA9m1LvjjwW8X

switches:
https://paste.xsnews.nl/view/Ajd9Amm7zvkk3w

customize:
https://paste.xsnews.nl/view/ndEaGEoYLNQndy

how it looks:
http:///shot.xsnews.nl/stefan/2f14afa9d9414899.png

2 Likes

Thanks for the scripts. I noticed while experimenting that I never got the username or password options when I compiled or used the OS X precompile. How did you do it?

./HarmonyHubControl
Syntax:
HarmonyHubControl [harmony_ip] [command (optional)]

./HarmonyHubControl [email protected] passw 10.0.1.16 issue_device_command 37313947 PowerOff
HARMONY COMMUNICATION LOGIN : FAILURE
ERROR : connectToHarmony : Unable to connect to specified IP Address on specified Port

dax333, I have followed this guide on a raspberry pi, should be the same for osx:

https://www.domoticz.com/wiki/Harmony_Hub_Control

git clone git://git.code.sf.net/p/harmonyhubcontrol/code harmonyhubcontrol-code
mv harmonyhubcontrol-code HarmonyHubControl
cd HarmonyHubControl
make HarmonyHubControl

p0nts I followed the above steps and HarmonyHubControl installed under the pi directory. I can control it from the command line but how would I show the directory structure in the switch component?

Also, your screenshot does not work.

Shot should work if you copy paste the url.

Path to script is the exact path it has in the os youve installed it it. So if you put the script in /home/pi/.homeassistant you use /home/pi/.homeassistant/HarmonyHubControl as path to the script

Was anything else installed or just the 4 commands above? I’ve tried changing the path but the switch doesn’t appear to work for me.

Nothing else, just this.

Can you log into the pi, and do the following:

sudo cd / sudo find . | grep HarmonyHubControl

Send the output here

Here you go.

http://pastebin.com/V2VzxUq5

You miss a package, Please run the following:

sudo apt get -y install build-essential sudo mv /home/hass/.homeassistant/HarmonyHubControl /home/hass/.homeassistant/harmony cd /home/hass/.homeassistant/harmony make HarmonyHubControl

After that you can use the exact path I use in the switch config in one of the previous posts.

Followed the steps above and finally got it working. Thanks a lot for the support.

no problem man!

I am running HA in a RP3 using the all in one script. Could you please provide a more detailed guide on how to install the harmonz hub control in order to be able to issue commands? Many thx in advance