swissmanu / harmonyhubjs-client

A Node.JS library which allows you to interact with your Logitech Harmony Hub.
https://github.com/swissmanu/harmonyhubjs-client
MIT License
155 stars 42 forks source link

Possibility to use "standard keys" of harmony hub #36

Open manne01 opened 7 years ago

manne01 commented 7 years ago

I am talking about keys like mute, vol+, vol-, prog+, prog- etc. These keys are on the physical harmony, remote control and for each activity harmony knows which device handles that command. I press the same key, no matter what activity is running currently.

Is it possible to execute these standard activities using this client? Or do I have to know the running activity first?

swissmanu commented 7 years ago

are you talking about controlling a device "by default"? or do you want to trigger arbitrary functionality in your program code?

in case you are asking the first: this is not possible. you need to know at least the device you want to communicate with first. the remotes implements this via the "devices" menu. harmonyhubjs-client does not have a way to work with single devices yet. (contribution welcome ;) )

otherwise the second is your goal: as far as i remember, the hub does never forward any key presses to other clients; it translates them to device-specific commands only. so no, you can't trigger some specific code attached to harmonyhubjs-client upon a key press.

did i interpret you question one way or the other correctly? :)

manne01 commented 7 years ago

Hmmm...I think none of both but more the second:

In the end i want to use https://github.com/pmant/ioBroker.harmony which uses harmonyhub-js-client.

In ioBroker.harmony I can only change activities and send commands to dedicated devices.

My question is, if the hub translates from say activity1.mute to denonreceivermodelxyz.mute - could I add something to harmonyhubjs-client (and use it in ioBroker.harmony) to provide a abstract version of the functions mute, vol+, vol-, prog+, prog- and some others - which would send this to the hub and the hub would execute it on whathever device is (in the configuration) configured to mute for the running activity.

As I did not find the possibility in iobroker.harmony I checked harmonyhubjs-client and assume it is notpossible there as well. This is why I write in here now.

In iobroker.harmony I can use e.g. myInstance.myHub_Name.myDeviceName.mute now, but I would enhance iobroker.harmony to have e.g. myInstance.myHub_Name.CurrentActivity.mute. Or at least to myInstance.myHub_Name.myRadioActivity.mute

Hope this makes things clearer now?! Do you see a possibility for this?