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

Hi, Just want to say that this looks actually awesome, I cam across this by accident, but I was disappointed to see that device control had not been opened up on the harmony API. This will make control so much easier and allow me to also voice control much easier compared to the awful harmony Alexa integration…

However… one problem! I have a windows computer as my 24/7 server… I assume I can’t run this directly in any way and I will need to run a virtual machine in virtual box? Anyone else on windows that can advise what setup they are using, if I need to put a Linux distro on a VM that’s fine although my linux experience is minimal, I don’t really want to run a full ubuntu install…

Any help . advice welcome :slight_smile:

I installed via docker on Ubuntu. However, the docker container seems to get killed as soon as its started :frowning:

I found no solution so far.

Cheers for the reply, I also noticed that there is a docker version for windows, so will give that a go this evening and let you know if I have any luck!

Hello JAKE,

Does Your window’s computer is always turned on?
There is a window’s docker program. You can run docker with maddox docker image(x86).


https://hub.docker.com/r/jonmaddox/harmony-api/

Hi,

What did you use docker image?
Let me know your platform for example x86, arm(CPU and OS).

@KuKu I am using Ubuntu on AMD x64 cpu.

I can retry from scratch if you like and come up with a small guide if it helps improving the wiki.

Let me know. Thanks for replying.

@vikas
Did you use my harmony-api docker image?
That is a image for a Rasp(ARM).
If not, please share any log?

@KuKu Did’nt see a RaspPi reference on https://github.com/maddox/harmony-api#docker

I just installed docker on Ubuntu and then installed the harmony-api container as described in wiki.

Any pointer on how to get this running on Ubuntu? I have my Ubuntu server running 24x7 very reliably. Does the script option work on Ubuntu?

Please run command “docker ps” and check whether container is alive.
If it is alive,
Run command “docker attach [container name]”(detach Ctrl + p + q) and see the log.

If it is not alive, is there any log after running container?
docker run --name=“harmony-api” -v /path/to/your/config:/config -p 8282:8282 -d jonmaddox/harmony-api

So I’ve given it a go, I’ve got docker running in a virtualbox followed the vague instructions to get harmony-api running and the docker falls flat on it’s face with the error “can’t find module /config/config.json”…

I’ve decided once again that linux is an absolute PITA to do even the most simple task, I’m very technically minded but just no patience with this type of thing… will wait for an alternative…

@KuKu

I tried that.

Please see log here - https://0bin.net/paste/pShHKtmYpljSP6TT#Vf-1uXhv5BMTyEdko9leazUDXJstIqmWOHDHuhKwIZz

@Entityxenon @vikas

It looks like same issue like below link.

Please make a config.json on your machine linked docker container by command.

  • Location :
    When you run a container, you should change from /path/to/your/config to your local path for config like below.

example) /path/to/your/config => /temp/config
$ docker run --name=“harmony-api” -v /temp/config:/config
-p 8282:8282 -d jonmaddox/harmony-api

  • File : (Computer) **/temp/config/**config.json
    {
    “mqtt_host”: “mqtt://127.0.0.1”,
    “mqtt_options”: {
    “port”: 1883,
    “username”: “someuser”,
    “password”: “somepassword”,
    “rejectUnauthorized”: false
    }
    }

And if you try to use auto hub discovery function, you need to change from “-p 8282:8282” to “–net=host”.

@KuKu

Thanks. Tried this but did not work exactly. Following worked for me.

{
“mqtt_host”: “mqtt://127.0.0.1”,
“mqtt_options”: {
“port”: 1883,
“username”: “harmony user”,
“password”: “harmony pw”,
“rejectUnauthorized”: false
},
“topic_namespace”: “home/harmony”,
“hub_ip”: “192.168.1.109”
}

docker run --name=“harmony-api” -v /home/user/harmony-api:/config
–net=host -d jonmaddox/harmony-api

Now i can try out your SmartApp :slight_smile:

Hello @KuKu

I’m wondering, on a raspberry PI whats the best way to run the harmony-api? standalone? ( /server ) or npm? or docker?

The reason why i’m asking is that sometimes the connection to hub is lost and not resumed back…i’, using the standalone run /home/pi/…/server

@KuKu

You have any tips on what to try since your app won’t discover my harmony hub? thanks…

@Fredrik
Hi,
Please let me know command you used.
If you used Jonmaddox docker image,
you’d better check comment related to discovering.

Hub discovery requires host networking (–net=host). However, you can specify your Harmony Hub IP address in config.json as hub_ip.

Hello @fearz
Hm… I think that docker is better than other way.
In my case using docker at Rasp, I also experienced connection lost with hub and I didn’t know exactly why it happen.
In that case I turn off and on Hub sometimes.

Hello @KuKu

Then why not adding to your script auto-reconnect?

Hello @fearz
I am sorry for late response.
hm…there is a routine of discovering to find again hub when hub is disconnected.

It looks like that hub’s state is on between offline and online.
To clarify this problem, need more logs when issue is happened.
If you have a harmony-api logs at that time, please share that.
Thank you.

the idea of this smartapp is amazing and exactly what I’m looking for to control my electric fireplaces, the only downfall for me is that I do not have any servers running or any computer for that matter…its too bad it can’t be incorporated right into smartthings