lopelex / node-red-contrib-harmony

Node-RED integration for Harmony hub
MIT License
13 stars 6 forks source link

[Feature request] Commands via msg.payload #7

Closed bakman2 closed 4 years ago

bakman2 commented 4 years ago

It would add a lot of flexibility if one could send the command via msg.payload instead of separate nodes. Like a pulldown option --set via msg.payload--

Then one could use eg;

// sequence
node.send({payload:"Power"}}
node.send({payload:"HDMI1"}}
node.send({payload:"Guide"}}
node.send({payload:"Down"}}
...

Where payload should match the available commands. Delay could be controlled with a delay node.

I like this node a lot but sequence programming or controlling from a different source is a pain.

lopelex commented 4 years ago

try this: https://github.com/lopelex/node-red-contrib-harmony/commit/6084b164fcd31948cd5e3d786d6208aee293eb20 npm install https://github.com/lopelex/node-red-contrib-harmony.git

lopelex commented 4 years ago

Also improved command node input handling. https://github.com/lopelex/node-red-contrib-harmony/blob/a830d9438662692f32e802c6849700dc6c62bdc8/nodes/command.js#L33 Now you can send objects like: {"command":"Mute","deviceId":"53280812"} or preselect an activity and send: {"command":"Mute"}

bakman2 commented 4 years ago

Fantastic stuff, thanks a lot!

MattL0 commented 3 years ago

hi . is there a way to send multiple command (same and diff) in the json with delay option and count?