alisdairjsmyth / node-red-contrib-lifx-api

A collection of Node-RED nodes to control LIFX globes using the HTTP Remote Control API
Apache License 2.0
8 stars 5 forks source link

Can't activate scenes #11

Open bland328 opened 5 years ago

bland328 commented 5 years ago

Using node-red-contrib-lifx-api 1.2.0 under Node-RED v0.20.5, when I trigger an lifx-activate-scene node configured with my API Token, a Duration and a Selector in the form of:

scene_id:c5156204-3921-40a6-9e37-432d9ae15ah0

I do successfully get back a payload resembling this, correctly referring to the two globes in the scene:

{"payload":{"results":[{"id":"d073d5898dc3","status":"ok","label":"Light 1"},{"id":"d073d523cef3","status":"ok","label":"Light 2"}]}}

The scene, however, isn't activated.

The scene is activated, however, if I provide the same Selector and API token in the LIFX 'Try it Out' form at the bottom of:

https://api.developer.lifx.com/docs/activate-scene

I greatly appreciate the work put into this project, and I'm happy to provide more information if it might help!

alisdairjsmyth commented 5 years ago

Note there is an issue with the dependent package which impacts this capability.

bland328 commented 5 years ago

Ah! I'll watch for an update to lifx-http-api. Thanks for the quick response.

(Oops...realizing I probably shouldn't have closed, since there's not yet a fix ;) )

johnfenwick commented 5 years ago

In the file life-http-api/dist/lifx.js, line 386 needs to be changed from: url: 'lights/' + selector + '/cycle', to: url: 'scenes/' + selector + '/activate', Sorry, I don't know how to do pull/push requests!

Edit: whoops. Looks like you've already made that request @alisdairjsmyth Thanks!

alisdairjsmyth commented 5 years ago

No problem @johnfenwick - as you have noted a pull request has been submitted on klarstil/lifx-http-api with this fix

bland328 commented 3 years ago

I'm (finally) taking another look at this, but having no luck.

Based on what I see at https://github.com/klarstil/lifx-http-api/pull/6 and https://github.com/klarstil/lifx-http-api/commit/d9299fcf3370c4052b2318e5a2e5637e733d4ed1, it appears this should now be working, but I'm still having no luck, and my results still match my original post from a couple years ago.

I'm now on Node-RED 1.3.5 and node-red-contrib-lifx-api 1.2.1, and everything I've tried aside from lifx-activate-scene node works great.

However, when I trigger lifx-activate-scene, nothing happens, and the node output looks like this:

_msgid: "bb4c49b1.b1b5a8"
payload: undefined
topic: ""

Since that node is fully configured, my expectation is that even an empty message sent to the node should trigger it—do I have that right?

Edit: I see there's there's been another report of this at https://github.com/alisdairjsmyth/node-red-contrib-lifx-api/issues/14.

CypherMK commented 2 years ago

Did you get this to work? Or still the same issue? I'm running into the same problem.