Harmony Hub and Domotict 3.8153 new command?

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!
Post Reply
ProjektC
Posts: 55
Joined: Sunday 17 December 2017 18:59
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: Germany
Contact:

Harmony Hub and Domotict 3.8153 new command?

Post by ProjektC » Saturday 30 December 2017 21:25

Hi

I copied the Harmony Hub and several devices from my old Logitech remote control.
I can control my devices on the iPhone, but Domoticz only finds two commands.

Harmony PowerOff
Harmony TV "Action"

I have activated the 5 minutes under Settings.
When I send a signal on the iPhone, I assumed that my domoticz would find and store the signal.

Can't I use my Vu+ Sat with the EPG or pause button in Domoticz?
Can't Domoticz access all commands from the Logitech hub?

bye
Attachments
1234b.jpg
1234b.jpg (63.29 KiB) Viewed 1345 times
1234a.jpg
1234a.jpg (115.64 KiB) Viewed 1345 times

Nautilus
Posts: 780
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi
Domoticz version: beta
Location: Finland
Contact:

Re: Harmony Hub and Domotict 3.8153 new command?

Post by Nautilus » Sunday 31 December 2017 1:31

Domoticz integration unfortunately covers only for the activities. To trigger individual commands, you need a virtual (selector) switch and an external script such as: https://github.com/sushilks/harmonyHubCLI. For each button (level) of the selector switch you can assign a different script to trigger a different command...:)

ProjektC
Posts: 55
Joined: Sunday 17 December 2017 18:59
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: Germany
Contact:

Re: Harmony Hub and Domotict 3.8153 new command?

Post by ProjektC » Sunday 31 December 2017 12:22

It looks very complicated.
Is there an example of how this is done on a Raspi 3 with Domoticz?

Nautilus
Posts: 780
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi
Domoticz version: beta
Location: Finland
Contact:

Re: Harmony Hub and Domotict 3.8153 new command?

Post by Nautilus » Monday 01 January 2018 0:25

ProjektC wrote:
Sunday 31 December 2017 12:22
It looks very complicated.
Is there an example of how this is done on a Raspi 3 with Domoticz?
It is not actually that complicated. Easiest way I'd say is to run:

Code: Select all

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash
sudo apt-get install -y nodejs
npm install harmonyHubCLI
Here I'm not sure if both node and nodejs are needed, I use both in any case.

After the installation you can run commands e.g. like this:

Code: Select all

node /home/pi/node_modules/harmonyHubCLI/harmonyHubCli.js -l 192.168.11.70 -d Vahvistin -c '["VolumeDown","VolumeDown","VolumeDown","VolumeDown","VolumeDown",]' -m
This sends five "VolumeDown" commands to my receiver. "Vahvistin" is the device name for the receiver that I use in Harmony and the IP is the Hamony hub's IP. Also, syntax is a bit different for single and multiple commands. This is for single command:

Code: Select all

node /home/pi/node_modules/harmonyHubCLI/harmonyHubCli.js -l 192.168.11.70 -d "Vahvistin" -c "VolumeUp"
The easiest might be to wrap it in a bash script and call that form Domoticz. You could e.g. have a bash script /home/pi/domoticz/HarmonyDeviceCommand.sh:

Code: Select all

#!/bin/bash
device_name="$1"; command_name="$2"
node /home/pi/node_modules/harmonyHubCLI/harmonyHubCli.js -l 192.168.11.70 -d "$device_name" -c "$command_name"
exit 0
And then call it directly from a switch's "On" / "Off" action or set it to a selector switch level like:

Code: Select all

script:///home/pi/domoticz/HarmonyDeviceCommand.sh Vahvistin VolumeUp
I don't think you can call .js scripts directly so therefore wrap it in a bash script first.

FunFair
Posts: 37
Joined: Wednesday 04 October 2017 11:29
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Harmony Hub and Domotict 3.8153 new command?

Post by FunFair » Friday 16 March 2018 20:26

Nautilus wrote:
Monday 01 January 2018 0:25
ProjektC wrote:
Sunday 31 December 2017 12:22
It looks very complicated.
Is there an example of how this is done on a Raspi 3 with Domoticz?
It is not actually that complicated. Easiest way I'd say is to run:

Code: Select all

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash
sudo apt-get install -y nodejs
npm install harmonyHubCLI
Here I'm not sure if both node and nodejs are needed, I use both in any case.

After the installation you can run commands e.g. like this:

Code: Select all

node /home/pi/node_modules/harmonyHubCLI/harmonyHubCli.js -l 192.168.11.70 -d Vahvistin -c '["VolumeDown","VolumeDown","VolumeDown","VolumeDown","VolumeDown",]' -m
This sends five "VolumeDown" commands to my receiver. "Vahvistin" is the device name for the receiver that I use in Harmony and the IP is the Hamony hub's IP. Also, syntax is a bit different for single and multiple commands. This is for single command:

Code: Select all

node /home/pi/node_modules/harmonyHubCLI/harmonyHubCli.js -l 192.168.11.70 -d "Vahvistin" -c "VolumeUp"
The easiest might be to wrap it in a bash script and call that form Domoticz. You could e.g. have a bash script /home/pi/domoticz/HarmonyDeviceCommand.sh:

Code: Select all

#!/bin/bash
device_name="$1"; command_name="$2"
node /home/pi/node_modules/harmonyHubCLI/harmonyHubCli.js -l 192.168.11.70 -d "$device_name" -c "$command_name"
exit 0
And then call it directly from a switch's "On" / "Off" action or set it to a selector switch level like:

Code: Select all

script:///home/pi/domoticz/HarmonyDeviceCommand.sh Vahvistin VolumeUp
I don't think you can call .js scripts directly so therefore wrap it in a bash script first.
Thank you very much for this! Works perfect! :D

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest