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

Hello, @Wallace_Walcher

Sometimes my Harmony hub also did not response to Harmony-API request.
If Harmony Hub lost connection, connection will be repaired.
But at that time there is no connection lost event of Hub.

I experienced below situation like you.

  1. AP(WiFi) router is rebooted(Power off->on)
  2. Harmony Hub will be reconnected to WiFi.

My temporally repair way is below.

  1. Turn off(plug out) Harmony Hub and Turn on Harmony Hub
  2. Harmony Hub lost connection with Harmony-API and re-discovered.

A quick update since my post three days ago relating my reliability problems. Later that day I made three changes:

  1. Moved my Pi box so I could connect to my internal network with Ethernet instead of WiFi
  2. Added a setting so that Docker loads automatically if the Pi restarts (that may have been set already, however - not sure)
  3. Added a command to the “docker run” command that starts the harmony api to have it restart ("–restart always") if it gets stopped

So, since those changes, I have had no reliability issues whatsoever. It has worked without fail for around 72 hours now. I am not sure which, if any, of the above did the trick, but am relieved to have it stabilized.

2 Likes

Today I decided to setup some webCoRE rules…However, the command list is very limited. How do I expose all of the commands to webCoRE?

This is all I have in webCoRE…

These are some of the commands that come up in the KuKu App…

Hello,

Did you select default type?
Instead of default, please select TV type.
There are many other commands in TV type.

There is no problem in using other type.
But there is a just tile UI mismatching with your device.

Are the commands coming from Harmony or they are basic universal commands for TV type? I am looking for a specific command, which is on my AVR remote and listed as a command in the Harmony API but doesn’t populate in webCoRE.

Hello,

Please try to use ‘TV’ Device Type in the ‘KuKu Harmony’, because there are five Custom commands.
Just mapping your specific command to Custom1~5 and call Custom1~5 command at WebCoRE.

Thank you

So, I just setup my Qnap server to host all my multimedia, gonna install this as well to get my device control in affect, is there a walk through of how to do this with a qnap server?

also, I have some custom IR commands that I use to control electric fireplaces and currently an old erod curtain system, will I be able to control these with this device controller?

Thanks for great SmartApp
I have some devices which need power on/off by double click remote button. I any way to power on/off them using KuKuHarmony?

Hello,

Hm… because there is a repeat command like below, it looks like abailable with small modification.

POST /hubs/:hub_slug/commands/:command_slug?repeat=3 => {message: “ok”}

1 Like

Thanks KuKu

It is very helpful. I made small modification and it works like a charm.

I am on a Pi3. I had to restart my Pi today but I am not sure what I need to do to restart the Harmony API Server…

Do I just open a command prompt and type:
start docker harmony-api

Or do I open a command prompt and type:
docker run -ti --net=host --name harmony-api turlvo/harmony-api:latest /home/harmony-api/harmony-api/script/server

Thanks in advance!

Hello,

You can just re-run started container following below command.

docker start [container name]

If you want to do this automatically,
try to use ‘systemctl’.

I’m sorry. I know that this is probably so simple for you but I am still lost.

In Pi I have this blue up/down arrow thingy that when hovering over it it says: docker0 Link is Down

Is docker0 the name I supposed to put in between the [ ]?
Do I even use the [ ]?
What is the default container name for this? Is it harmony-api?

I’ve tried in command prompt:

docker start [harmony-api]
docker start harmony-api
docker start [docker0]
docker start docker0

I still can’t seem to get this start or at least to the point where I see the screen where it is waiting on changes from my harmony hubs…

Using ‘systemctl’, relating to docker0:

sys-subsystem-net-devices-docker0.device loaded active plugged /sys/subsystem/net/devices/

I have no idea what this means or what the command is supposed to do to start KuKu…

Sorry again for being lost here. All was well until I had to restart.

Every think was working until today.
I have noticed that harmony hub is not discorering anymore.

I get error on harmony-api

Error: bind EADDRINUSE 0.0.0.0:5224
at Object.exports._errnoException (util.js:907:11)
at exports._exceptionWithHostPort (util.js:930:20)
at dgram.js:214:18
at nextTickCallbackWith3Args (node.js:522:9)
at process._tickCallback (node.js:428:17)
at Function.Module.runMain (module.js:443:11)
at startup (node.js:140:18)
at node.js:1043:3
error: Forever detected script exited with code: 1
error: Script restart attempt #5
Starting discovery.
events.js:141
throw er; // Unhandled ‘error’ event
^

Error: bind EADDRINUSE 0.0.0.0:5224
at Object.exports._errnoException (util.js:907:11)
at exports._exceptionWithHostPort (util.js:930:20)
at dgram.js:214:18
at nextTickCallbackWith3Args (node.js:522:9)
at process._tickCallback (node.js:428:17)
at Function.Module.runMain (module.js:443:11)
at startup (node.js:140:18)
at node.js:1043:3
error: Forever detected script exited with code: 1
error: Script restart attempt #6
Starting discovery.
events.js:141
throw er; // Unhandled ‘error’ event
^

I tried restart harmony hub and harmony-api on raspberry pi. but without success
Any ideas whats is wrong?

How do you restart the harmony-api? I am trying to get this restarted as well but I do not see any logs or anything…

Hello,

I am so sorry for late response.

Please let me know typed docker command when you run a harmony-api.
There is a container name of ‘harmony-api’ in parameter
ex) --name test
please just run docker start [name].
ex) docker start test

or another docker’s container name checking way is like below.
docker ps -a

you can find ‘harmony-api’’s information.

I’ll inform you about ‘systemctl’.

Thank you.

Hello,

It looks like there is a same daemon using same port.
please check process that using ‘5224’ port on command prompt.

netstat -anp | grep 5224

or check whether there is a exist harmony-api daemon.

ps -aux | grep harmony-api

or check whether harmony-api container is already running

docker ps
or
docker ps -a

Thank you.

I kill the process and start it again

pkill -f node

script/server

Thanks again
I fixed error but still have problem with discovering hub.

The hub is discovered only after switch off and switch on harmony hub.
but it lost hub in few seconds

Hub discovered: Harmony Hub at 192.168.1.10.
Updating activities for harmony-hub.
Updating state for harmony-hub.
Updating devices for harmony-hub.
Updating state for harmony-hub.
Hub discovered: Harmony Hub at 192.168.1.10.
Updating activities for harmony-hub.
Updating state for harmony-hub.
Updating devices for harmony-hub.
Hub lost: Harmony Hub at 192.168.1.10.
Hub lost: Harmony Hub at 192.168.1.10.