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

smartapp_av
harmony
dth_av
requires_server
project_av

(Bill S.) #597

AFAIK, you can install nodejs on the Synology DS218. I found this https://github.com/StephanThierry/nodejs4synologynas. Once you get that done, you should be able to use the npm version of the API.


(Bill S.) #598

What do you get if you go to http://<your_pi_ip>:8282?


(Bill S.) #599

(A little late) As others have said, your best bet would be to write a custom DTH (modeled on KuKu’s DTHs) OR setup the fireplace as a “aircon” type. That’s what I do with mine and utilize the 5 custom slots for functions. It works (for the most part), but it’s not as seamless as I would like it to be.


(DJAC) #600

I get a harmony page

Info

GET /hubs

GET /hubs/:hub_slug/status

GET /hubs/:hub_slug/commands

GET /hubs/:hub_slug/activities

GET /hubs/:hub_slug/activities/:activity_slug/commands

GET /hubs/:hub_slug/devices

GET /hubs/:hub_slug/devices/:device_slug/commands

Control

PUT /hubs/:hub_slug/off

POST /hubs/:hub_slug/activities/:activity_slug

POST /hubs/:hub_slug/:command_slug

POST DEPRECATED /hubs/:hub_slug/start_activity?activity=:activity_slug

POST /hubs/:hub_slug/devices/:device_slug/commands/:command_slug

Your Hubs

Main 1

GET /hubs/main-1/status

GET /hubs/main-1/activities

GET /hubs/main-1/commands

GET /hubs/main-1/activities/candles/commands

GET /hubs/main-1/activities/lg-live-tv/commands

GET /hubs/main-1/activities/make-it-cooler/commands

GET /hubs/main-1/activities/pandora-channel/commands

GET /hubs/main-1/activities/poweroff/commands

GET /hubs/main-1/devices

GET /hubs/main-1/devices/koko-aroma-dehumidifier/commands

GET /hubs/main-1/devices/candle-sticks/commands

GET /hubs/main-1/devices/lg-living-room-tv/commands

GET /hubs/main-1/devices/lg-living-room-tv-always-on/commands

GET /hubs/main-1/devices/york-climate-control/commands

Is that a good start…lol

thank you again for your time


(Bill S.) #601

Yay! That’s the desired result. You’re all set now. :smiley:

No problem!


(DJAC) #602

Only one thing…
I cant discover my hub on the smart app and
how do i make sure it will auto start on reboot


(Bill S.) #603

On the smart app, you have to make sure that you use the IP address and port. So, make sure the Harmony-API Server IP Address looks like <your_pi_ip>:8282. Don’t put http:// there as it will break it.

To get Docker to restart on boot:

# sudo vim /etc/systemd/system/harmony-api.service

    <harmony-api.service File content>
    -----------------------------------------------------------------------------            
    [Unit]
    Description=Harmony API container
    Requires=docker.service
    After=docker.service

    [Service]
    Restart=always
    ExecStart=/usr/bin/docker start -a harmony-api
    ExecStop=/usr/bin/docker stop -t 2 harmony-api

    [Install]
    WantedBy=multi-user.target
    -----------------------------------------------------------------------------

    # sudo systemctl enable /etc/systemd/system/harmony-api.service

(DJAC) #604

Yes this is the part that got me confused. I dont know how to use vim and when i puched that in… i could not exit…
Now i think my VIM has a duplicate file…
New to this

THANK YOU ITS WORKING!!! I didnt put the port number in.


(Bill S.) #605

LOL. Quick ref:

To save and exit in VIM: ESC :wq
To exit without saving in VIM: ESC :q!
To save without exiting in VIM: ESC :w!

So, just repeat the steps above for the service file using the ESC :wq command when you are done. After that, run sudo systemctl daemon-reload and then sudo systemctl enable /etc/systemd/system/harmony-api.service.


(Bill S.) #606

The other thing you might want to do is use nano instead of vim. In nano, you can use CTRL+[key] for commands and it’s a bit more intuitive. Us old folks are the ones that use vi/vim mostly. :wink:

Glad you’re up and running!


(DJAC) #607

thank you for all your help…
I really appreciate it!!
I will test it. DO you accept donations


(Bill S.) #608

No donation needed mate. I’m happy to help!


(DJAC) #609

ok so i tried this method and it seems to work but when i restart nothing happens.

also mine would only work if i put in

sudo systemctl enable docker harmony-api-server

:/etc/systemd/system $ ls
autologin@.service network-online.target.wants
bluetooth.target.wants pm2-root.service
dbus-org.bluez.service poweroff.target.wants
dbus-org.freedesktop.Avahi.service printer.target.wants
dhcpcd5.service rc-local.service.d
dhcpcd.service.d reboot.target.wants
display-manager.service remote-fs.target.wants
getty.target.wants samba-ad-dc.service
getty@tty1.service.d sockets.target.wants
halt.target.wants sysinit.target.wants
harmony-api-server.service syslog.service
harmony-api.service timers.target.wants
multi-user.target.wants


(Bill S.) #610

sudo systemctl enable docker harmony-api-server only enables the service(s). It doesn’t start them.

sudo systemctl start harmony-api-server and then sudo systemctl status harmony-api-server will start the service and then give you a status of it.


(DJAC) #611

Yes you are right. I have done that too.
That is the weird thing

i get this

sudo systemctl start /etc/systemd/system/harmony-api-server.service
Failed to start etc-systemd-system-harmony\x2dapi\x2dserver.service.mount: Unit etc-systemd-system-harmony\x2dapi\x2dserver.service.mount not found.

pi@raspberrypi:/etc/systemd/system $ ls
autologin@.service network-online.target.wants
bluetooth.target.wants pm2-root.service
dbus-org.bluez.service poweroff.target.wants
dbus-org.freedesktop.Avahi.service printer.target.wants
dhcpcd5.service rc-local.service.d
dhcpcd.service.d reboot.target.wants
display-manager.service remote-fs.target.wants
getty.target.wants samba-ad-dc.service
getty@tty1.service.d sockets.target.wants
halt.target.wants sysinit.target.wants
harmony-api-server.service syslog.service
harmony-api.service


(Bill S.) #612

Run this and post the results: cat /etc/systemd/system/harmony-api.service


(DJAC) #613

$ cat /etc/systemd/system/harmony-api.service
<harmony-api.service>
-----------------------------------------------------------------------------
[Unit]
Description=Harmony API container
Requires=docker.service
After=docker.service

[Service]
Restart=always
ExecStart=/usr/bin/docker start -a harmony-api
ExecStop=/usr/bin/docker stop -t 2 harmony-api

[Install]
WantedBy=multi-user.target

Looks right!!


(Bill S.) #614

sudo systemctl start /etc/systemd/system/harmony-api.service
Run that ^^^ (remove the -server part).


(DJAC) #615

I get the same result

sudo systemctl start /etc/systemd/system/harmony-api.service** Failed to start etc-systemd-system-harmony\x2dapi.service.mount: Unit etc-systemd-system-harmony\x2dapi.service.mount not found. **_~ cd /etc/systemd/system_
**:/etc/systemd/system sudo systemctl start /etc/systemd/system/harmony-api.service** Failed to start etc-systemd-system-harmony\x2dapi.service.mount: Unit etc-systemd-system-harmony\x2dapi.service.mount not found. pi@raspberrypi:/etc/systemd/system


(Bill S.) #616

Ok, let’s try sudo systemctl start harmony-api.service && sudo systemctl status harmony-api.service