How to find devices specific commands and how to run actions

I’d like to trigger single Harmony commands on specific devices as well as actions (already defined with the harmony-app) using Javascript rules such as:

device = "XBox1_SendButtonPress";
command = "PowerOn"; 
events.sendCommand(device, command);

This basically works. My problem is that I don’t know which commands to use (‘PowerOn’ was just a lucky guess). As described in the end of the binding description I entered “http://192.168.178.25:8080/rest/channel-types” and got: “{“error”:{“message”:“Authentication required”,“http-code”:401}}”). What do I need to do to get all commands of all added harmony-devices?

Furthermore, I’d like to run actions. This should work with a statement like this:

events.sendCommand(xxx, yyy);

with either xxx or yyy being the action’s name and the other a specific command. Can you tell me which?

The docs are still couched in OH2 land, for OH3 you would need to add security to the REST request.
Or use API Explorer for a more interactive play area.

Assuming you mean binding derived actions, no it should not work like that. sendCommand is all about Items. You’d use getActions() first.
But I do not think the Logitech binding exposes any openHAB actions in this sense. We are probably talking about different things (with a small t).

1 Like

This was new to me but worked fine. I now figured out the available commands and (for now) everything is clear. For other users with similar questions:

I don’t think we’re talking about the same thing: I mean the harmony actions: In the harmony app you can define “actions/rules”, e.g.‘xBox spielen (Play XBox)’: Turn on receiver, wait 1s, change receiver channel to DVD, turn on Projector, turn on xbox.
All one would have to do, is start that “action” ‘Xbox spielen’: Check the Rest-Information for the device and then a rule like this triggers the ‘action’:

device ="HarmonyHubHarmonyHub_currentActivity";
command = "Xbox spielen"; 
events.sendCommand(device, command);

A little counterintuitive (at least to me) might be the channel name, which is not “sendCommand” but “currentActivity”.

That’s your Item, you can call it what you like. Item name does not have to be related in any way to the name of any of the channels that you might link it to.

sendCommand() is all about Items and has no idea channels even exist.