Hi, the “tv” and “macmini” are devices not activities, activities would might look like “Watch TV”. I realize there’s not a good way to see what those are right now from the paperui, they should be visible from the rest api however at http://you-server:8080/rest/channel-types/harmonyhub%3AcurrentActivity There’s a bug right now that complicates this if you have more then one hub which I’m currently trying to fix (doesn’t sound like thats a issue for you)
How can I do now with OH2 to make it works?
As you say that is complicated because of the bug you are trying to fix, do I need anything else or now it’s impossible to do because of the bug?
Ok I see the issue and the error in the code on my side, I will open up a bug for it and try and get to it soon. In the mean time if you replace the numeric id with the String version (look for the label value in the response from the REST call I posted earlier) it should work for you.
Actually I’m still confused why your Devices (which you send button commands to) have the same ID’s as activities that seem to have worked in the past? From your screenshot above it clearly shows those numbers (33974847) as device id’s an not activities, I would suggest using the activity label instead from now on until I can figure out whats going on.
Dan, related to this topic, do you have any idea why I continuously get the error:
“20:49:43.341 [ERROR] [onyhub.discovery.HarmonyHubDiscovery] - IO error during HarmonyHub discovery: No route to host: Datagram send failed”
This error shows up every ten minutes, usually in sets of 5 or 6.
Using OH2 with harmony binding 2.0.0.b4.
Note that aside from this error, the binding seems to work, e.g., I have assigned an item to the current activity, and am able to switch activities (and receive current activity values), power on/off, etc.
Any insights or thoughts on what I should be looking into would be appreciated.
{"parameters":[],"parameterGroups":[],"description":"The label/name of the current activity of a Harmony Hub","label":"Current Activity","tags":[],"UID":"harmonyhub:currentActivity"}
From where I only find “Current Activity” as a label…
You are right, it’s kind of weird…
Anyway, continuing my tests, I do have some questions:
in OH1 I had to configure my user/password… in OH2 is it not needed any more?
your comment about device ID’s same as activities made me think: when installing it I add a Hub which has an ID/label, then I install devices and it finds 2 (I only own one remote… is that a “device”?), which they are correspondent to the 2 activities I have… and they have its own ID/label…
Finally, I tried using labels and it doesn’t work:
It’s annoying because the PowerOff does work but the other no… Could it be something related with the channels created? where they should point from the previous pictures/code I posted? I guess it may be “Harmony_Activity” but I don’t know…
Yep, its not needed if you are on the same network as the Hub, this is how the Harmony Mobile app works.
The Harmony binding has two types of 'Things" , Hubs and Devices. The Hub is what you control to change the current activity. An activity on the Harmony side is like a macro, it coordinates its Devices. So if I have a TV and Amp, an activity may be “watch TV” which then knows how to coordinate the TV and Amp together (power on tv, power on amp, turn amp to input 1, etc…). You probably know all this, I’m just restating so we are clear
Devices are the Things that the Hub controls, in the example above this would be the TV and the AMP. So in the PaperUI if you have added the Hub (either through a item file or using auto discovery), then it will automatically create two more Device Things, TV and AMP. Devices can be sent “buttonPress” commands, this would be like “Play” or “Pause”.
I just pushed some fixes , if you can update to the latest version that might help. Once you do, I would be interested in what your channels look like. if you go to the swagger rest endpoint (http://your-oh2:8080/doc/index.html) and click “channel-types” → “Get Channel-Types” it should give you a nice list of Activities and ButtonPresses.
We try and discovery new Hubs and Devices every 5 (maybe 10?) mins, something is failing during this, if everything else is ok then I think this is probably unnecessary logging , although it could be something else, can you open a github issue please? Thanks.
Thank you very much for the explanation, now everything is more clear and it has sense to me =)
I have tried to update it… let me know if I did correctly:
I went to CloudBees and grabed the most recent 2.0.0 snapshot
In order not to reset all my config I updated just the /runtime/ folder, that’s it, I deleted old one and copied new one
Is that a correct procedure to update without loosing my configuration?
Then I went to the Rest API and got a list of Activities and ButtonPresses. There I found the labels I was using for my Activities where incorrect so I tried the ones found there and I got it working! I mean, now I can control the active activity with OH2.
Now I tried to map buttons, just a simple one: volume up/down for the TV device… and it didn’t worked. Here I don’t know if it’s related the problem with ID’s or anything else. I created an item:
I was able to solve it: the configuration was right but no the labels Harmony uses to refer to commands. Reading other posts I figured out that the commands do not have spaces so it worked like the following:
so, i also have trouble setting up Harmony with OH2.
I can read the current activity, but i want to call a specific activity in a rule.
In OH1 this was possible with an action, but there are no actions for OH2, right?
Could someone please point me in the right direction on how to activate an activity not using the ui?
I think you should use a rule for that.
i’ve done it this way with Alexa:
rule "Fire TV schauen"
when
Item hh_firetv changed
then
logDebug("Harmony", "Entry - Rule: Fire TV schauen")
if ( hh_firetv.state == ON ){
logInfo("Harmony", "FireTV: AN")
hh_current.sendCommand("FIRE TV")
} else {
logInfo("Harmony", "FireTV: AUS")
hh_current.sendCommand("PowerOff")
}
logDebug("Harmony", "Exit - Rule: Fire TV schauen")
end
hh_firetv it the switch that i can set or get’s set via Alexa to trigger the Harmony-activity.
it’s defined like this:
thats almost what i am looking for several hours now.
I try to find a command that is compatible with the hue emulation addon.
I tried to use your rule as you seem to want to do the same. But its not working for me. He says that he can not find the method current_activity.
where did you define the hh_current function?
my code:
home.item
Switch Harmony_KodiTV "Kodi auf Fernseher" (Wohnzimmer) [ "Switchable" ]
harmony.rules
rule "Kodi Fernsehen einschalten"
when
Item Harmony_KodiTV changed
then
//logDebug("Harmony", "Entry - Rule: Fire TV schauen")
if ( Harmony_KodiTV.state == ON ){
//logInfo("Harmony", "FireTV: AN")
current_activity.sendCommand("KODI auf Fernseher")
} else {
//logInfo("Harmony", "FireTV: AUS")
current_activity.sendCommand("PowerOff")
}
//logDebug("Harmony", "Exit - Rule: Fire TV schauen")
rule "doTivoOn"
when
Item denTivo changed from OFF to ON
then
harmonyDenActivity.sendCommand("Tivo")
end
rule "doTivoOff"
when
Item denTivo changed from ON to OFF
then
harmonyDenActivity.sendCommand("PowerOff")
end
I’ve tried several things trying to keep the two items in sync, but none have worked well.
With this, at least “Hey Google, turn on the tivo” works. (It actually turns on the TV, the receiver, sets the receiver input to tivo)