[SOLVED] Recent en working solution for Harmony Hub Devices

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

jpvaneijk
Posts: 77
Joined: Thursday 07 June 2018 21:57
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Noordwijk, Netherlands
Contact:

[SOLVED] Recent en working solution for Harmony Hub Devices

Post by jpvaneijk »

Hi All,

I've been working myself through a serious amount of topics on this subject on multiple fora.
The native support for the Harmony Hub in Domoticz is great but lags the functionality for the use of the individual devices. #willthereeverbesupportforthis

Is there any recent en and working solution and/or howto so I can change TV channels or change/mute the volume?

My devices:
  • Raspberry Pi 3B+ running Domoticz V3.9654
  • Logitech Harmony Hub
  • TV decoder: Arris VIP2952 (for switching channels)
  • TV: Samsung UE49KS7502UXXH (for use as Monitor)
  • AVReceiver: Denon AVR-3800 (no Wifi/ethernet) for volume
The Harmony Hub itself controles everything flawlesly so my first wish is a solution using the Harmony Hub.
Thanks for any contribution guys.
Last edited by jpvaneijk on Thursday 28 June 2018 18:04, edited 1 time in total.
User avatar
gizmocuz
Posts: 2548
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Recent en working solution for Harmony Hub Devices

Post by gizmocuz »

#willthereeverbesupportforthis, well this is an open source project, please contribute some code

Another thing is, WHY you need to do this via domoticz ?

WHY don't you get yourself something like an amazon alexa, and ask here to tune to netherlands 2 ?

Seems much easier then to launch domoticz, press a remote control/favorite list, and tune to a channel,
it is probably faster to do so with the original harmony remote.

I also have a harmony, and i use domoticz to turn everything off (when i tell my hourse to go to sleep for instance),
or change to movie, or change activity to tv

I bed 99% of the time when you change to a channel you have to adjust the volume anyway

Another solution could be to get yourself an OpenPLI enabled STB, and via HTTP commands you can switch channels or do whatever you want it to do.
Then you can use a standard domoticz switch to send an http command

Another option is to use a standard switch (with an HTTP action), and use a third party program like

https://github.com/maddox/harmony-api

So... will this every be supported.... it is already, and maybe you can contribute some code ?
Quality outlives Quantity!
jpvaneijk
Posts: 77
Joined: Thursday 07 June 2018 21:57
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Noordwijk, Netherlands
Contact:

Re: Recent en working solution for Harmony Hub Devices

Post by jpvaneijk »

Hi Gizmocuz,

Thanx for the (quick) reply.
I'm pretty new at this and I'm verry sorry if a gave an impression that I'm not happy with Domoticz or all the work that's been done so far.
So far my only experiance with code is the terminal in Raspbian and I got that one only 6 weeks ago.

If there's any moment that I feel comfortable writing some code of my own that's interesting enough to share on Domoticz (or anywhere for that matter) you can be sure I will do so. For now, I totaly get your responce :oops:
Never intended any offence, just frustration on my part.
Another thing is, WHY you need to do this via domoticz ?
The harmony Hub is not supported in my Google Home. The workarround I found was using Domoticz in combination with Controlicz.
This is great for activitys and working verry wel but I'm missing the changing channels or volume options.
WHY don't you get yourself something like an amazon alexa, and ask here to tune to netherlands 2 ?
Perhaps not the right choice for this issue, but as said, I got myself a Google Home speaker.
Seems much easier then to launch domoticz, press a remote control/favorite list, and tune to a channel,
it is probably faster to do so with the original harmony remote.
You are absolutly right.
Another option is to use a standard switch (with an HTTP action), and use a third party program like
https://github.com/maddox/harmony-api
Thanx, I will give this a try and send you som dutch stroopwafels if it's up-n-running
So... will this every be supported.... it is already, and maybe you can contribute some code ?
Again, 'you are right and I'm sorry. I've been working on a solution for many hours and the hashtag was my personal frustration. It will not happen again.

Thanx for now!
gordonb3
Posts: 111
Joined: Saturday 31 March 2018 22:24
Target OS: Linux
Domoticz version: Custom
Location: Delft, NL
Contact:

Re: Recent en working solution for Harmony Hub Devices

Post by gordonb3 »

Hate to say, but it is really the Harmony Hub itself being the issue here. The problem is not that we can't send commands to individual devices from Domoticz, but that Harmony Hub does not report anything back when we issue those commands. This also means that it does not send any informational messages when you issue commands from the normal remote or the phone app. As a result there is no way that we can ever know the state of any device. We can't tell whether it's on or off, what the volume level is, what channel it is at. And that's the reason why it is not in Domoticz.
User avatar
gizmocuz
Posts: 2548
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Recent en working solution for Harmony Hub Devices

Post by gizmocuz »

That might be partly true, but this -> "Change TV channels or change/mute the volume" should work,
as you can create a list of favorite channels, and select them from the remote, and also controlling the volume/mute works.
Maybe there is no status/return that says what channel is selected, or if the volume is muted, but sending those commands might/could/should work
Quality outlives Quantity!
gordonb3
Posts: 111
Joined: Saturday 31 March 2018 22:24
Target OS: Linux
Domoticz version: Custom
Location: Delft, NL
Contact:

Re: Recent en working solution for Harmony Hub Devices

Post by gordonb3 »

As said: yes, we can send those commands.

AFAIK there is currently no support for devices with an unknown state in Domoticz though. Any button I click will want to show me that I clicked it and you end up with buttons reporting the exact opposite of the actual state. Or in the case of channel select: a completely different channel than you are watching and making it impossible to select it because according to our interface it is already on.
jpvaneijk
Posts: 77
Joined: Thursday 07 June 2018 21:57
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Noordwijk, Netherlands
Contact:

Re: Recent en working solution for Harmony Hub Devices

Post by jpvaneijk »

On GitHub I found harmoniHubCLi : https://github.com/sushilks/harmonyHubCLI
It's not fast, but it's running. For a test I did:

Code: Select all

cd harmonyHubCLI

Code: Select all

node harmonyHubCli.js -l 192.168.2.174 -d 'AV-ontvanger Denon' -c 'Mute'
Is there anyway to script this in Domoticz guy's? Sorry if I'm beeing like a noob, as said, I'm pretty new at this and I can't seem to find an easy answer to this.
gordonb3
Posts: 111
Joined: Saturday 31 March 2018 22:24
Target OS: Linux
Domoticz version: Custom
Location: Delft, NL
Contact:

Re: Recent en working solution for Harmony Hub Devices

Post by gordonb3 »

There's also an up to date version of HarmonyHubControl: https://github.com/gordonb3/HarmonyHubControl/

I think you'll find this to be quicker than using node. To use that from Domoticz you can add a dummy switch and enter the required command as a ` script://` action in the On/Off action properties of the switch.
jpvaneijk
Posts: 77
Joined: Thursday 07 June 2018 21:57
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Noordwijk, Netherlands
Contact:

Re: Recent en working solution for Harmony Hub Devices

Post by jpvaneijk »

Thanks.
I'm having some trouble getting it up and running. Seems the .exe can't be found?

Code: Select all

bash: HarmonyHubControl.exe: opdracht niet gevonden

Code: Select all

./HarmonyHubControl [MY EMAIL] [MY PSSW] [HUB IP]
gives:
Syntax:
HarmonyHubControl [harmony_ip] [command]
where command can be any of the following:
list_activities
list_activities_raw
get_current_activity_id
get_current_activity_id_raw
start_activity <ID>
start_activity_raw <ID>
list_devices
list_devices_raw
list_device_commands <deviceId>
list_device_commands_raw <deviceId>
issue_device_command <deviceId> <command> [...]
issue_device_command_raw <deviceId> <command> [...]
get_config
get_config_raw


Adding another command give's the same result. Can you advise?

Can you also give me an example for a Domoticz-script?
gordonb3
Posts: 111
Joined: Saturday 31 March 2018 22:24
Target OS: Linux
Domoticz version: Custom
Location: Delft, NL
Contact:

Re: Recent en working solution for Harmony Hub Devices

Post by gordonb3 »

HarmonyHubControl does not require username and password. Simply specify the IP address (or internal DNS name) as the first parameter and it should return the current activity. Add one of the list* commands to let it return information about activities, devices and what commands you can give it. I have not actually worked on making the CLI more comprehensible than it was in the original unmaintained code, but the idea is that the "raw" methods will only return pure json for use in web pages and other automation systems and the non-raw methods (also) produce user readable output.

With regard to scripting first place to look would be here: https://www.domoticz.com/wiki/Scripting_in_Domoticz
jpvaneijk
Posts: 77
Joined: Thursday 07 June 2018 21:57
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Noordwijk, Netherlands
Contact:

Re: Recent en working solution for Harmony Hub Devices

Post by jpvaneijk »

Ok. Thanx. It's working now. Great.
Can you give me an example for using this in a domoticz-script in a dummy-switch?

Thanx!
gordonb3
Posts: 111
Joined: Saturday 31 March 2018 22:24
Target OS: Linux
Domoticz version: Custom
Location: Delft, NL
Contact:

Re: Recent en working solution for Harmony Hub Devices

Post by gordonb3 »

Something like this:

Code: Select all

"script://" + $path-to-harmonyhubcontrol + "/HarmonyHubControl" + " " + $IP + " issue_device_command " + $deviceID + " " + "1 0 0" 
Or a more strict example:

Code: Select all

script:///opt/HarmonyHubControl/HarmonyHubControl 192.168.0.60 issue_device_command 1234567  1 0 0
Will switch to channel 100 (do note the spaces between the last three digits)

You can specify up to three commands to issue_device_command specifically for above reason, so you can also do something like this:

Code: Select all

script:///opt/HarmonyHubControl/HarmonyHubControl 192.168.0.60 issue_device_command 1234567 VolumeUp VolumeUp
jpvaneijk
Posts: 77
Joined: Thursday 07 June 2018 21:57
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Noordwijk, Netherlands
Contact:

Re: Recent en working solution for Harmony Hub Devices

Post by jpvaneijk »

Sorry for the late responce. It's all working great!
For now this is the best solution to use your Pi in combination with Harmony Hub devices and Google Home speaker (and Controlicz by Madgeni).
If (when) Google gets the dutch language this will no longer be necessary Logitech will also support the Dutch language.

Some codes working for me:
AV Receiver

Code: Select all

script:///home/pi/HarmonyHubControl/HarmonyHubControl 192.168.2.3 issue_device_command 55207356 Mute
script:///home/pi/HarmonyHubControl/HarmonyHubControl 192.168.2.3 issue_device_command 55207356 VolumeUp
script:///home/pi/HarmonyHubControl/HarmonyHubControl 192.168.2.3 issue_device_command 55207356 VolumeDown
script:///home/pi/HarmonyHubControl/HarmonyHubControl 192.168.2.3 issue_device_command 55207356 ModeStereo
script:///home/pi/HarmonyHubControl/HarmonyHubControl 192.168.2.3 issue_device_command 55207356 ModeDolby/DTSSurround
Decoder TV

Code: Select all

script:///home/pi/HarmonyHubControl/HarmonyHubControl 192.168.2.3 issue_device_command 55207349 ChannelPrev
script:///home/pi/HarmonyHubControl/HarmonyHubControl 192.168.2.3 issue_device_command 55207349 ChannelUp
script:///home/pi/HarmonyHubControl/HarmonyHubControl 192.168.2.3 issue_device_command 55207349 ChannelDown
script:///home/pi/HarmonyHubControl/HarmonyHubControl 192.168.2.3 issue_device_command 55207349 Record
script:///home/pi/HarmonyHubControl/HarmonyHubControl 192.168.2.3 issue_device_command 55207349 Select
script:///home/pi/HarmonyHubControl/HarmonyHubControl 192.168.2.3 issue_device_command 55207349 Exit
Thanx a million for your assistance guys and your patience ofcourse.
User avatar
Ascari
Posts: 30
Joined: Thursday 28 September 2017 21:35
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9
Location: Belgium
Contact:

Re: [SOLVED] Recent en working solution for Harmony Hub Devices

Post by Ascari »

Hello,

How I can install the PyHarmony ?

I want just the possibility to add Dummy Mute Switch for my harmony.

Thank
steef84
Posts: 37
Joined: Friday 30 August 2013 20:24
Target OS: NAS (Synology & others)
Domoticz version: DS213+
Contact:

Re: Recent en working solution for Harmony Hub Devices

Post by steef84 »

gordonb3 wrote: Monday 25 June 2018 20:07 Something like this:

Code: Select all

"script://" + $path-to-harmonyhubcontrol + "/HarmonyHubControl" + " " + $IP + " issue_device_command " + $deviceID + " " + "1 0 0" 
Or a more strict example:

Code: Select all

script:///opt/HarmonyHubControl/HarmonyHubControl 192.168.0.60 issue_device_command 1234567  1 0 0
Will switch to channel 100 (do note the spaces between the last three digits)

You can specify up to three commands to issue_device_command specifically for above reason, so you can also do something like this:

Code: Select all

script:///opt/HarmonyHubControl/HarmonyHubControl 192.168.0.60 issue_device_command 1234567 VolumeUp VolumeUp
Tried you HarmonyHubControl but somehow cannot get it to work. The script ends with a "null" Any hints in for what im missing? Trying to VolumeUp my AVR

Code: Select all

pi@raspberrypi:~/domoticz/scripts/python/HarmonyHubControl $ ./HarmonyHubControl 10.0.0.152 issue_device_command 54611955 VolumeUp
LOGITECH WEB SERVICE LOGIN     : BYPASSED
HARMONY COMMUNICATION LOGIN    : SUCCESS
HARMONY COMMAND SUBMISSION     : SUCCESS
null
DeviceID is correct and double checked. Extra info

Code: Select all

pi@raspberrypi:~/domoticz/scripts/python/HarmonyHubControl $ ./HarmonyHubControl 10.0.0.152 list_device_commands 54611955
LOGITECH WEB SERVICE LOGIN     : BYPASSED
HARMONY COMMUNICATION LOGIN    : SUCCESS
HARMONY COMMAND SUBMISSION     : SUCCESS
PARSE ACTIVITIES AND DEVICES   : SUCCESS
Harmony Commands for Device:

{
   "Amplifier" : "HEOS HomeCinema",
   "Denon" : "Heos HomeCinema",
   "Functions" : {
      "Miscellaneous" : [
         "InputAuxIn",
         "InputCoaxIn",
         "InputHdmiArc",
         "InputHdmiIn",
         "InputOpticalIn"
      ],
      "PlayMode" : [ "Repeat", "Shuffle" ],
      "TransportBasic" : [ "Stop", "Play", "Pause" ],
      "TransportExtended" : [ "SkipBack", "SkipForward" ],
      "Volume" : [ "Mute", "VolumeDown", "VolumeUp" ]
   },
   "ID" : 54611955
- Stefan
gordonb3
Posts: 111
Joined: Saturday 31 March 2018 22:24
Target OS: Linux
Domoticz version: Custom
Location: Delft, NL
Contact:

Re: [SOLVED] Recent en working solution for Harmony Hub Devices

Post by gordonb3 »

Hmmm.... Does it not do the VolumeUp?

I think if you do the `issue_device_command_raw` version of the command it will show you a status OK in json. The `null` you are seeing is from trying to output a variable that is in fact never filled.
CronoS
Posts: 135
Joined: Wednesday 15 July 2015 23:40
Target OS: -
Domoticz version:
Contact:

Re: [SOLVED] Recent en working solution for Harmony Hub Devices

Post by CronoS »

This is an old threat, but hopefully someone can help... I want to setup the HarmonyHubControl plugin, to have more control on my Hub, but I don't know how to install it on a Synology? Anyone advice how I can install it? I have the Domticz with the plugin support, but I don't get the file structure..

I want to use it with Controllicz and Google Assistent. The built-in plugin for Harmony Hub is working OK, but I want to have more control for audio, channels etc..
JerryZvW
Posts: 7
Joined: Sunday 29 May 2016 19:23
Target OS: Linux
Domoticz version:
Contact:

Re: [SOLVED] Recent en working solution for Harmony Hub Devices

Post by JerryZvW »

Hi All,

just started with this, I'm able to connect to the hub but when I request a list of activities :
jerry@server:~/HarmonyHubControl$ ./HarmonyHubControl [email protected] password 192.168.0.xx list_activities
LOGITECH WEB SERVICE LOGIN : BYPASSED
HARMONY COMMUNICATION LOGIN : SUCCESS
HARMONY COMMAND SUBMISSION : SUCCESS
PARSE ACTIVITIES AND DEVICES : SUCCESS
Activities Available via Harmony :

-1 - PowerOff
Same with the devices... :
jerry@server:~/HarmonyHubControl$ ./HarmonyHubControl [email protected] password 192.168.0.xx list_activities
LOGITECH WEB SERVICE LOGIN : BYPASSED
HARMONY COMMUNICATION LOGIN : SUCCESS
HARMONY COMMAND SUBMISSION : SUCCESS
PARSE ACTIVITIES AND DEVICES : SUCCESS
Devices Controllable via Harmony :
But when I do a get_config, I do see all kinds of activities and devices in the output.
Am I doing something wrong ? or am I missing something?
Can I use the information from the get_config output to control my devices ?
(I will try this today....)

Thanks,
Jerry
JerryZvW
Posts: 7
Joined: Sunday 29 May 2016 19:23
Target OS: Linux
Domoticz version:
Contact:

Re: [SOLVED] Recent en working solution for Harmony Hub Devices

Post by JerryZvW »

I did find the activity id's for the activities I use by starting the activity and putting in the following command :
jerry@server:~/domoticz/scripts/HarmonyHubControl$ ./HarmonyHubControl [email protected] password 192.168.0.xx get_current_activity_id
LOGITECH WEB SERVICE LOGIN : BYPASSED
HARMONY COMMUNICATION LOGIN : SUCCESS
HARMONY COMMAND SUBMISSION : SUCCESS
Current Activity ID is : 33716588
with this I am able to start the activity like so :
./HarmonyHubControl [email protected] password 192.168.0.xx start_activity 33716588
However I'm unable to start the activity using the method described in the wiki. (domoticz_main). My domoticz_main script looks like this :
#!/bin/sh

startup_path=$1
hardware_id=$2
device_id=$3
status=$4
status2=$5
devname=$6

echo "startup_path=${startup_path}, hardware_id=${hardware_id}, device_id=${device_id}, status=${status}, status2=${status2}, devname=${devname}"

//TV

if [ "$device_id" = "3855" ] ; then
if [ "$status" = "On" ] ; then
exec `/home/jerry/domoticz/scripts/HarmonyHubControl/HarmonyHubControl [email protected] password 192.168.0.xx start_activity 29493890` &
fi
fi

//RADIO

if [ "$device_id" = "3856" ] ; then
if [ "$status" = "On" ] ; then
exec `/home/jerry/domoticz/scripts/HarmonyHubControl/HarmonyHubControl [email protected] password 192.168.0.xx start_activity 33716588` &
fi
fi

//AV control

if [ "$device_id" = "3854" ] ; then
if [ "$status" = "Off" ] ; then
exec `/home/jerry/domoticz/scripts/HarmonyHubControl/HarmonyHubControl [email protected] password 192.168.0.xx start_activity -1` &
fi
fi
But I'm having no success with this when I switch them on or off...
Does anyone know why..? It should work as far as I can see, as the same rule in the terminal works flawless.

Thanks
renerene
Posts: 351
Joined: Wednesday 03 August 2016 11:36
Target OS: -
Domoticz version:
Contact:

Re: [SOLVED] Recent en working solution for Harmony Hub Devices

Post by renerene »

Is it possible to play a Spotify playlist in random order on a specific device?
Would be great if this is possible. Listen to music, with just one press on Dashticz or Domoticz
Post Reply

Who is online

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