Harmony Hub Binding Rule (not exist in the registry) [SOLVED]

Hi,

I am new to OpenHab. I am using Amazon Ha Bridge with openHab for verbal commands to Amazon to control my harmony hub. Connection to hub looks good. I just have a rule error that not sure what to do.

When issued a verbal command to Amazon Echo, “Alexa, turn on Harmony TV”, I got the following in openHab console:

[WARN ] [.w.internal.servlet.CmdServlet] - Received command ‘ON’ for item ‘HarmonyTVSwitch’, but the item does not exist in the registry

My demo.items file has below switch:

/* Harmony Hub /
String Harmony_Activity “activity [%s]” { harmonyhub="
[currentActivity]" }
Switch item=Harmony_Activity mappings=[PowerOff=‘PowerOff’, Movies=‘Movies’, TV=‘TV’]

Switch HarmonyTVSwitch

my rule has the following:

// Rule for Harmony Hub
rule "TV On"
when
Item HarmonyTVSwitch received command ON
then
harmonyStartActivity(“TV”)
end

rule "TV Off"
when
Item HarmonyTVSwitch received command OFF
then
harmonyStartActivity(“PowerOff”)
end

I do have all the Harmony Hub jars in addons folder. Please help. Thank you.

Could be you have to set up a label (at least “”), but I’m not sure. :confused:

I put in a label but still doesn’t work.

Switch HarmonyTVSwitch “Switch”

I think this item definition might be incorrect and hence interrupts the parsing of your items file:

What happens if you change it to:

Switch Harmony_Activity mappings=[PowerOff='PowerOff', Movies='Movies', TV='TV']

27maximilian,

You are my hero. That works perfectly. I have been pulling my hair out. Oh My God. I like to buy you a beer. Thank you thank you so much.

You have no idea how happy I am. Thanks.

To recap: I changed to the following, as suggested and it works. Also, I put the string below in my demo.items file.

Switch Harmony_Activity mappings=[PowerOff=‘PowerOff’, Movies=‘Movies’, TV=‘TV’]

Great. I am glad it works.

Sorry for my misunderstanding, are you talking about items or sitemaps files?

> My demo.items file has below switch
> /* Harmony Hub */
> String Harmony_Activity   "activity [%s]"   { harmonyhub="*[currentActivity]" }
> Switch item=Harmony_Activity mappings=[PowerOff='PowerOff', Movies='Movies', TV='TV']

And then

Switch Harmony_Activity mappings=[PowerOff='PowerOff', Movies='Movies', TV='TV']

The same name Harmony_Activity for String and Switch?