Harmony Hub binding clarification on OpenHAB2

Greetings all,

I need some clarification on using the Harmony Hub binding.

Currently I have a fully configured and working OpenHAB2 instance which I use to remotely control my Philips Hue bulbs (but nothing else, yet).

I have added the Harmony Hub binding, discovered my hubs, and discovered the things attached to each hub. I have located the page that lists all the possible button presses but have no idea how to pass the commands to the things themselves.

So far I have created a string item and linked it to one of the things but I can’t seem to move passed this.

Any help provided is greatly appreciated.

Maybe this can help. I use it this way:

items-File:

String		Harmony_Activity		"Harmony Activity [%s]"		<harmony_logo>	(gHarmony)		{channel="harmonyhub:hub:HAP-HarmonyHub:currentActivity"}
String		HarmonyOnkyoAVR     	   	"Onkyo AV Receiver"		<harmony_logo>	(gHarmony)		{channel="harmonyhub:device:HAP-HarmonyHub:11660638:buttonPress"}
String		HarmonyAppleTv4K    	   	"Apple TV 4K"			<harmony_logo>	(gHarmony)		{channel="harmonyhub:device:HAP-HarmonyHub:11660633:buttonPress"}
String		HarmonySamsungTV	  	"Samsung TV"			<harmony_logo>	(gHarmony)		{channel="harmonyhub:device:HAP-HarmonyHub:48936858:buttonPress"}
Number		Harmony_Activity_TV		"Samsung TV"					(gHarmonyActivity)
Number		Harmony_Activity_Radio		"Radio"						(gHarmonyActivity)
Number		Harmony_Activity_PS4		"PS4 pro"					(gHarmonyActivity)
Number		Harmony_Activity_ATV_Pic	"Apple TV Bild"					(gHarmonyActivity)
Number		Harmony_Activity_ATV_Mus	"Apple TV Musik"				(gHarmonyActivity)

settings-file:

Text item=Harmony_Activity label="Multimedia [%s]" icon="harmony_logo" valuecolor=[=="PowerOff"="#00CD00",!="PowerOff"="#ff9933"] {
	Switch item=Harmony_Activity label="Medien" icon="harmony_logo" mappings=[PowerOff="Off", "Fernsehen (Samsung TV)"="TV", "Radio Analog"="Radio","PS4 Wiedergabe"="PS4"]
	Switch item=Harmony_Activity label="Apple TV" icon="apple_tv" mappings=["Fernsehen (Apple TV)"="mit Bild", "AppleTV Musik"="ohne Bild"]
	Switch item=HarmonyOnkyoAVR label="Volume" icon="volume_control" mappings=[VolumeDown="-",VolumeUp="+",Mute="x"]
	Text item=Divider_Harmony icon="receiver"
	Switch item=HarmonyOnkyoAVR label="Sender Radio" icon="" mappings=[1="SRF1",2="SRF3",3="Top",4="FM1"]
	Switch item=HarmonyOnkyoAVR label="Sender Radio" icon="" mappings=[PresetPrev="CH -",PresetNext="CH +"]
	Text item=Divider_Harmony icon="screen"
	Switch item=HarmonySamsungTV label="TV Sender" icon="" mappings=[1="SRF1",2="SRF2",3="SRFi"]
	Switch item=HarmonySamsungTV label="TV Sender" icon="" mappings=[ChannelDown="CH -",ChannelUp="CH +"]
	Switch item=HarmonySamsungTV label="TV Funktionen" icon="" mappings=[SmartHub="SmartHub",Guide="Guide",Info="Info"] 			
	Switch item=HarmonySamsungTV label="TV Navigation" icon="" mappings=[DirectionDown=" â–Ľ ",DirectionLeft=" â—„ ",DirectionRight=" â–ş ",DirectionUp=" â–˛ ",Return=" â—„â•ť"] 			
	Switch item=HarmonySamsungTV label="TV Navigation" icon="" mappings=[Menu="Menu",Tools="Tools",Exit="Exit"] 			
	Switch item=HarmonySamsungTV label="TV Player" icon="" mappings=[Rewind="<<",Play=" ► ",Pause=" ‖ ",Stop=" ■ ",FastForward=">>"] 			
}		
2 Likes

… or read the docs, everything is explained nice and easy :grinning:

https://docs.openhab.org/addons/bindings/harmonyhub/readme.html

1 Like

Thanks all for the help.

I will try to compare those config files to what I have and try to make sense of it.

The key you’re probably missing (well I was) is the mapping bit. That’s where you set what the “button press” you’re sending actually is …

1 Like

This is exactly what I was missing.

Everything is working great now.

Thank you all !

1 Like

I understand this concept, but it seems like the different commands are already mapped since they can be sent with the drop-downs in PaperUI. I feel like there should just be some way to access those instead of having to create the mappings in an Items file.

This has been the most confusing part of setting this up for me. And frankly, the documentation is a bit lacking when it comes to setting up the Harmony Hub. Nowhere does it tell you that you have to define the mappings.

I’m not a savvy coder, so I would appreciate it if someone could give a simple example of how to map a power toggle command as a switch (or button). Thanks.

Sure, I’m no savvy coder either, but I’ve managed to muddle together enough to control my heat pump - generally via lots of copy paste from other peoples items & sitemaps. Time to share!

My items line for the Harmony device (12345678 isn’t the device but you’ll get it, dunno what I should cloak)

String LHeatPump        "Lounge HeatPump" <switch> { channel="harmonyhub:device:LivingRoom:12345678:buttonPress" }

And my sitemap has

Frame label="Heat Pump" {
                //Text item=Harmony_Activity
                Switch item=LHeatPump mappings=["Heat_Auto_22"="On", "OFF"="Off", "Heat_High_22"="High", "Cool_19"="Cool"]

Now, I’m not really using the PaperUI, just for setup purposes, I’m using classic so that I have it on my phone nicely via the app. The more you control how you want to interface with OpenHab the better it gets. Plus you get nice easy one shot buttons like that, rather than multi step selecting from a pull down and pushing buttons.

I hope this helps and answers your question.