[RELEASE] KuKuHarmony - DTH and SmartApp that support to control devices in Logitech Harmony(using Harmony-API)

It’s still working for me, so I would say yes.

If you get it working you can probably use Webcore along with this to send a pause command when your doorbell triggers.

As for having the latest firmware scroll up as I mentioned in my previous post. It tells you how to enable the correct setting so Kuku will work.

Been having some harmony issues and checked and lo and behold the hubs are no longer being detected. They are at the same IPs they were previously, any idea what might be the issue, or how I might troubleshoot? I’ve cycled the router, pi, and hubs in various orders.

I just set this up with the intent of seeing button pushes and am having some trouble. I installed using the IoTRant instructions and as far as I can tell harmony_api is running. I checked at https://<Pi_IP>:8282 and got the info page. I double checked on the Pi and see that the docker container is running. I do have the SmartApp all set up and some devices added. So, the server bits appears to be working. The ST SmartApp appears to be working. All my devices registered with Harmony are detected.

I’ve added a few of the Harmony-connected devices (TV, DVR, Fire TV, BDP). All defined as a TV. In the Classic app I even see the remote control page. However, that’s where everything stops. These seem to be just switches; both apps (Classic & new) erroneously says they are all on. I am seeing no history at all on them.

My goal is to detect a play, pause, or stop button press on these to adjust the room light dim level. I’ve defined custom1, custom2, and custom3 respectively. But 1) I’m not seeing that any input detection happens at all, and 2) am not sure how to see these triggers if they exist at all.

What am I missing?

I think there is an issue with the latest hub release.
I see that the commands are not working anymore, before the updated it was fine… Anyone else experience any issue?

Nevermind, I removed the devices and re-added them again, and it is working now…

@KuKu any plans on updating this for the new app so the devices don’t show offline?

3 Likes

I second this. There seems to be a lot of DTH and Smartapps not working with new app or limited functionality! :(. I would look into a lot of these myself but wouldn’t no where to start on converting them.

I am quite tech savvy though if anyone wants to point me in the right direction? Smartthings seem very quiet since this new app migration begun…

Well good news. The devices no longer show as offline but they’ve still got a ways to go since they basically don’t show much at all.

1 Like

Is there anyone Kind enough to guide me through with this install… I’m kinda a newbie with Docker and language here… I know I’m asking a lot… I want to run it on my synology.

I was able to install Docker on my synology.
I was able to go under docker and find under registry jonmaddox/harmony-api
I figured it out how to create a contrainer and run it.

But that’s it that where Im stuck. I should be fine for the smartapp part but need help for running server and how to do it.

Thanks!

This may or may not help. I used it for my raspberry pi. Not sure if the commands would be the same at all.

Thanks for the help I will try as I can resolve my issue at the moment. And I will let you know. Really appreciated that someone replied to this old thread.

For some reason the turlvo-harmony-api1 can’t seem to run. I click to run and it unexpectedly stops.
I was also able to get the jonmaddox-harmony-api1 to run wihtout problem.

But since I don’t understand the difference between them will this still works? Or should I get another one?
Is the turlvo-harmony down? And it’s the reason why it does’t work?

Thanks!

Nevermind I figured out everything and got it working.
Running docker and Harmony-api on my synology.
Everything Good. Thanks again!

For the interested ones.

  1. on your synology download Docker on the package center.

  2. Open Docker - Registry - search for jawilson/Harmony-api and download.

  3. Create a notepad file with this code in it.

    {
    “hubs”: [
    {
    “name”: “Living Room”,
    “ip”: “ENTER THE IP ADDRESS OF YOUR HUB”
    }
    ]
    }

and name the file config.json

  1. Copy this file anywhere on your synology.
  2. In docker go to Image - Launch - advance settings.
  3. Volume tab - add folder (select the folder where you put the config.json file).
  4. In mount path enter /config
  5. Apply - this will create a container in the container tab of docker. Make sure it’s running.
  6. If you double click on the container you will find the local port. Use the IP adress of your host (synology) with local port .

Exemple 192.168.0.165:41455.

THanks hope this help at least someone.

Oh yea don’t forget to enable the XMPP on your HUb.
harmony app - Menu - harmony setup - add/edit devices & activities - remote & hub - Enable XMPP.

Thanks again @GRClark for pushing me to search further.

5 Likes

i keep getting the string error from my config file, running on win 64 -> node.js. Checked and rechecked everything in line one and the rest.

{
“enableHTTPserver”: true, “hubs”: [{“name”:“Harmony Hub”,“ip”:“192.168.87.186” }]}
“mqtt_host”: “mqtt://127.0.0.1”,
“topic_namespace”: “harmony-api”,
“mqtt_options”: {
“port”: 1883,
“username”: “harmony”,
“password”: “harmony”
“rejectUnauthorized”: false
}
}

I:\harmony-api-master\harmony-api-master>node app.js
internal/modules/cjs/loader.js:1193
throw err;
^

SyntaxError: I:\harmony-api-master\harmony-api-master\config\config.json: Unexpected string in JSON at position 89
at parse ()
at Object.Module._extensions…json (internal/modules/cjs/loader.js:1190:22)
at Module.load (internal/modules/cjs/loader.js:1000:32)
at Function.Module._load (internal/modules/cjs/loader.js:899:14)
at Module.require (internal/modules/cjs/loader.js:1042:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object. (I:\harmony-api-master\harmony-api-master\app.js:11:14)
at Module._compile (internal/modules/cjs/loader.js:1156:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:1176:10)
at Module.load (internal/modules/cjs/loader.js:1000:32)

Hi @notsky,
That json is not valid. It had a few issues between missing commas and brackets out of place, also the type of “quotation marks” seem to be the curly kind and that is not valid either. Try this instead

{
	"enableHTTPserver": true,
	"hubs": [{
		"name": "Harmony Hub",
		"ip": "192.168.87.186"
	}],

	"mqtt_host": "mqtt://127.0.0.1",
	"topic_namespace": "harmony-api",
	"mqtt_options": {
		"port": 1883,
		"username": "harmony",
		"password": "harmony",
		"rejectUnauthorized": false
	}
}

also this website might help you in the future https://jsonlint.com/

1 Like

thanks so much, will try this out

Thanks for the code, that was the trick to get up and running. The issue now is actually controlling anything, looks like the server is not receiving commands from ST. I am able to find the hub and add devices, but when i try a simple on/off test from the smartthings UI… its failing, says network error, nothing logs in the server console. This type of test should work, right? Node.js is latest stable release, but i am not using the classic app.

Was able to find hub, list devices, and add:

device shows in ST:
Imgur

But a simple power toggle fails:
Imgur

Logs from when i added the device in the ST app show, but no commands come across:

I:\harmony-api-master\harmony-api-master>node app.js
Starting discovery.
Hub discovered: Harmony Hub at 192.168.87.186.
Updating activities for harmony-hub.
Updating state for harmony-hub.
Updating state for harmony-hub.
‘[2020-05-24T17:34:33.813Z] - ::ffff:192.168.87.27 - GET /hubs 200 5.064 ms - 24b’
‘[2020-05-24T17:34:34.261Z] - ::ffff:192.168.87.27 - GET /hubs 200 0.219 ms - 24b’
‘[2020-05-24T17:34:37.233Z] - ::ffff:192.168.87.27 - GET /hubs/harmony-hub/devices 200 0.836 ms - 724b’
‘[2020-05-24T17:34:37.369Z] - ::ffff:192.168.87.27 - GET /hubs/harmony-hub/devices/denon-av-receiver/commands 200 1.102 ms - 13198b’
Updating state for harmony-hub.
‘[2020-05-24T17:34:37.823Z] - ::ffff:192.168.87.27 - GET /hubs/harmony-hub/devices 200 0.267 ms - 724b’
‘[2020-05-24T17:34:37.941Z] - ::ffff:192.168.87.27 - GET /hubs/harmony-hub/devices/denon-av-receiver/commands 200 0.447 ms - 13198b’
Updating state for harmony-hub.
‘[2020-05-24T17:34:44.411Z] - ::ffff:192.168.87.27 - GET /hubs 200 0.277 ms - 24b’
Updating activities for harmony-hub.
Updating devices for harmony-hub.
Updating state for harmony-hub.
Updating state for harmony-hub.

Thanks for any tips!

update, tried disabling the firewall in case there was some unknown socket i didnt know about, same result. Also tried via the classic ST app and no change. The node server side app also crashes out after a while:

Updating state for harmony-hub.
events.js:287
throw er; // Unhandled ‘error’ event
^

Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:205:27)
Emitted ‘error’ event on Socket instance at:
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: ‘ECONNRESET’,
code: ‘ECONNRESET’,
syscall: ‘read’
}

Any ideas? Maybe windows is just not the best enviro to get up and running.

Special thanks to @Mmarques for posting the detailed Synology setup above. The key for me is to use the correct Docker package (jawilson) and not the default/popular one. Also, depending on your setup, you might want to double-check that copy and pasting the config.json example he has does not give you any formatting errors. On my Mac, it switched the quotes to invalid ones. I had to run it through a JSON validator to correct it.

Now on to my question - I have a very specific use case. I want my wife to be able to lower the volume using a Zigbee 4-button remote she has by her bedside. The remote is ST compatible and can be tied to turning on and off lights and devices, dimming lights, turning on Modes/Scenes, etc. I often play games or watch movies too loudly in an adjacent living room so I want her to be able to press a button and have it drop the volume 4-6 steps. I have KukuHarmony setup with my AV Receiver setup as a device in ST. I have On and Off tied to Volume down and I have the Zigbee remote button setup as a toggle so each time she presses it, it just keeps pressing Volume Down. This works but is tedious.

What I’d like to get working is tying the button press to a series of commands like “Volume Down, Pause 0.5s, Volume Down, Pause 0.5s, Volume Down …” Does anyone know how this can be accomplished?

Thanks!

I guess I’m missing why the pause .5 seconds. But you should be able to do this in webcore.

I use a similar setup with Webcore to control a window AC unit. I have to toggle the fan button a set number of times to go from auto to max.
Possibly you can set one of the custom buttons in Kuku to set a volume level if that possible .
You’ll see where I used custom buttons in the screenshot I uploaded.

Attached I’ve uploaded a screen capture of a portion of the Webcore piston.

@TN_Oldman The pause is just because in my experience some AV equipment doesn’t like it when you spam it with commands. The pause is not really necessary. I already have my remote button tied to Volume Down but I can only get it to send one command. There’s no feature in Advanced Button Controller to send a macro or series of commands.

Can you give me some more instruction on how to setup this webcore? The buttons in Kuku are all tied to actual devices; so in this case I’ve added my AV Receiver so the buttons there are what’s on a typical controller. From there I can tie it to my remote but via really simple functions like power on and off. The only way I can even get it to control volume is of a work around - i defined the AVR’s power and power off command as Volume Down (for both). So the remote actually thinks it’s turning the AVR on and off, but each time you press it, it ends Volume Down. I am not sure how to setup a webcore that ties into Kuku to have it actually send Volume Down more than once. Any help would be appreciated.