Harmony ButtonPress Rules only working if sent via Paper UI

I am trying to create a simple rule which watches for the Play or Pause button on my XFinity DVR via the Harmony remote to turn my Hue bulbs on and off.

If I head over to Dashboard under Paper UI and fire off a Pause or Play, it works perfectly. If I click play or pause on the harmony remote, nothing. What am I doing wrong?

I am currently just trying to get the rule to log the commands being pressed by the Item I have created:

String HarmonyMasterDVR "Master DVR Button Press" { channel="harmonyhub:device:MasterBedroomHub:44090833:buttonPress" }

And the rule:

rule "Bedroom DVR item received command"
when
    Item HarmonyMasterDVR received command
then
    logInfo("Harmony", "DVR button command: " + receivedCommand)
end

This item binding is inbound therefore you will never get a command from the device. Commands are sent to devices.
Change your rule trigger to:

rule "Bedroom DVR item received update"
when
    Item HarmonyMasterDVR received update
then
    Thread::sleep(100) // Time for the event bus to update the value
    logInfo("Harmony", "DVR button command: " + HarmonyMasterDVR.state.toString)
end

Thanks so much for the fast reply!

I just through your code in and still nothing :frowning: No output to the server log.

Also, when I use Paper UI, I am getting the log output, but I am getting:

DVR button command: UNDEF

IMHO:
@vzorglub was correct about the missing information from the device (your remote) however the change to " received update" has no effect since the remote does not send anything to OH (it is simply not intended to do such)!

Thanks @opus,
I don’t know the Harmony binding. It was just an educated guess.
How can the OP get feedback to OH?

I guess I am confused to why you would even use the binding if you can not react to commands that are happening within the binding?

Right, there has to be a way to get this data without using openHab interfaces to control your devices, why would you have a Harmony remote, if you were using only openHab to control your devices… That literally makes no sense, this sees like a major flaw in the Harmony binding…

Also, there has to be a way, because I can get it to work when listening for activity changes (switching between watching TV and Playing PS4). So if we can listen for that, why cant we listen for Play/Pause button presses?

I have admit that I have no knowledge about that binding. My statement was based on the reported situation.
The remote only sends commands ( to the device). In order to react on such commands OH needs to receive those commands ( and assume the command was received by the device) or the device needs to send its state to OH.
According your last statement the Harmony binding gets state reports from the devices, if the change from play to pause is also send has to be looked at. Reading the documentation migth help.

Dan,
That’s not how the binding works. The buttonPress is outbound only, it allows you to send commands TO the devices. The reason it works when you do something in PaperUI is because OH is made aware of something changing. The Harmony does not send updates to OH when a button is pressed.

The only thing the binding will update coming back to OH would be the activity that you’re currently on.

I wanted to do something like you back in the day, so I actually have a Harmony as well as a GlobalCache unit that I used to capture that IR data. It wound up being way overly complicated for what I wanted and there were better ways to get what I needed(I still have it if you’re interested lmk). I watch for play/pause events based on the activity.

For example, when someone is casting from Plex(the Harmony reports the activity as “Chromecast” and the plex client for that TV is playing), I can monitor that with the Plex Binding. (You can also use the Chromecast binding which I think gets updated w/ play/pause events).

If you need to go that crazy with things, than you probably need something like the GlobalCache GC devices, they will get you the raw data you need to make those decisions.