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

Cannot get Selector to find anything #10

Open jmesberg opened 5 years ago

jmesberg commented 5 years ago

I only have one LIFX light so far, so if I leave the Selector blank everything is working exactly as expected, but if I try to specify a filter for the Selector, I get nothing.

I've tried 'Group' (e.g. Group: Bedroom), 'Label' (e.g. Label: Bedroom Lamp), and 'ID' (ID:xxxxxxxxxxxxx) and nothing works. I may be getting the syntax wrong but I've tried just about every combination I can think of.

syntax I've tried (using the Label example):

Label:Bedroom Lamp Label:"Bedroom Lamp" "Label":"Bedroom Lamp" {"Label":"Bedroom Lamp"}

Suggestions?

alisdairjsmyth commented 5 years ago

Sorry for my delayed response. If you are using the node's configuration panel, you should specify the selector without quotation marks.

lifx-list-lists-config

Alternatively if you are injecting via a message, you specify the selector as follows: { "selector": "label:Hall Near Door" }

jmesberg commented 5 years ago

Thank you very much. I will try this tonight.

John

On Oct 17, 2018, at 2:17 AM, alisdairjsmyth notifications@github.com wrote:

Sorry for my delayed response. If you are using the node's configuration panel, you should specify the selector without quotation marks. https://user-images.githubusercontent.com/11627564/47065777-e4e04900-d22f-11e8-909d-97bd7f607ea7.PNG Alternatively if you are injecting via a message, you specify the selector as follows: { "selector": "label:Hall Near Door" }

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alisdairjsmyth/node-red-contrib-lifx-api/issues/10#issuecomment-430503218, or mute the thread https://github.com/notifications/unsubscribe-auth/ANl-LzM0UYNTkqjSjnnElYjjD8MUe_Smks5ulsuKgaJpZM4XaXT-.

jmesberg commented 5 years ago

Works like a charm, thank you. [one comment if you intend to update your docs….remind people that this is case sensitive}

One more question: When using the set-state node I can set color fine with this:

but when I try to add saturation like this (see below) it errors with “color does not have a valid value”

I tried putting a comma or a semicolon between the two attribute settings but got same error each time. How do I get saturation values to work? (note: your documentation points to the LIFX URL which suggests that saturation should work as shown above). What about setting using RGB — how would I provide the parameters in that case?

If you’d like I will do a pull to update all your docs when I have this working properly.

John

On Oct 17, 2018, at 2:17 AM, alisdairjsmyth notifications@github.com wrote:

Sorry for my delayed response. If you are using the node's configuration panel, you should specify the selector without quotation marks. https://user-images.githubusercontent.com/11627564/47065777-e4e04900-d22f-11e8-909d-97bd7f607ea7.PNG Alternatively if you are injecting via a message, you specify the selector as follows: { "selector": "label:Hall Near Door" }

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alisdairjsmyth/node-red-contrib-lifx-api/issues/10#issuecomment-430503218, or mute the thread https://github.com/notifications/unsubscribe-auth/ANl-LzM0UYNTkqjSjnnElYjjD8MUe_Smks5ulsuKgaJpZM4XaXT-.

alisdairjsmyth commented 5 years ago

Color is expressed in terms of hue, saturation, kelvin, and brightness components in a single string. For example to set the global named Hall Near Door to Deep green at 50% brightness you would use the message payload: { "selector": "label:Hall Near Door", "color": "hue:120 saturation:1.0 brightness:0.5" } or alternatively specify the value hue:120 saturation:1.0 brightness:0.5 in the configuration panel.

The following is an example of using RGB: { "selector": "label:Hall Near Door", "color": "rgb:255,255,0" }

I was planning to update the documentation, but I am open to a pull request if you want to contribute.

jmesberg commented 5 years ago

Thanks again for your prompt help. I haven’t yet tried passing the JSON message (will try later) but in the selector panel this doesn’t work. Hue alone works, but adding anything else to the string in the selector panel generates a “color does not have a valid value” error. Also, please note that you have a separate brightness field in the panel so it doesn’t seem logical to include brightness in the string.

I’ve tried:

hue:240 Works hue:240 saturation 0.8 doesn’t work hue:240 saturation 0.8 brightness 0.75 doesn’t work hue:240 saturation 0.8 kelvin:2500 doesn’t work

Thanks for your continued help.

John

On Oct 19, 2018, at 12:16 AM, alisdairjsmyth notifications@github.com wrote:

Color is expressed in terms of hue, saturation, kelvin, and brightness components in a single string. For example to set the global named Hall Near Door to Deep green at 50% brightness you would use the message payload: { "selector": "label:Hall Near Door", "color": "hue:120 saturation:1.0 brightness:0.5" } or alternatively specify the value hue:120 saturation:1.0 brightness:0.5 in the configuration panel.

The following is an example of using RGB: { "selector": "label:Hall Near Door", "color": "rgb:255,255,0" }

I was planning to update the documentation, but I am open to a pull request if you want to contribute.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alisdairjsmyth/node-red-contrib-lifx-api/issues/10#issuecomment-431239812, or mute the thread https://github.com/notifications/unsubscribe-auth/ANl-LyIgLpHDRuuuEi_cgUhbY8V917Fvks5umVIugaJpZM4XaXT-.

jmesberg commented 5 years ago

whoops, I forgot to show the colons in my example below — I do have them correctly written in the panel though, e.g.

hue:240 saturation: 0.8

On Oct 19, 2018, at 6:41 AM, Mesberg John mesberg@gmail.com wrote:

Thanks again for your prompt help. I haven’t yet tried passing the JSON message (will try later) but in the selector panel this doesn’t work. Hue alone works, but adding anything else to the string in the selector panel generates a “color does not have a valid value” error. Also, please note that you have a separate brightness field in the panel so it doesn’t seem logical to include brightness in the string.

I’ve tried:

hue:240 Works hue:240 saturation 0.8 doesn’t work hue:240 saturation 0.8 brightness 0.75 doesn’t work hue:240 saturation 0.8 kelvin:2500 doesn’t work

Thanks for your continued help.

John

On Oct 19, 2018, at 12:16 AM, alisdairjsmyth <notifications@github.com mailto:notifications@github.com> wrote:

Color is expressed in terms of hue, saturation, kelvin, and brightness components in a single string. For example to set the global named Hall Near Door to Deep green at 50% brightness you would use the message payload: { "selector": "label:Hall Near Door", "color": "hue:120 saturation:1.0 brightness:0.5" } or alternatively specify the value hue:120 saturation:1.0 brightness:0.5 in the configuration panel.

The following is an example of using RGB: { "selector": "label:Hall Near Door", "color": "rgb:255,255,0" }

I was planning to update the documentation, but I am open to a pull request if you want to contribute.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/alisdairjsmyth/node-red-contrib-lifx-api/issues/10#issuecomment-431239812, or mute the thread https://github.com/notifications/unsubscribe-auth/ANl-LyIgLpHDRuuuEi_cgUhbY8V917Fvks5umVIugaJpZM4XaXT-.

alisdairjsmyth commented 5 years ago

I am able to submit the following through the configuration panel of the set state node: hue:240 saturation:0.8; hue:240 saturation:0.8 brightness:0.75; and hue:240 saturation:0.8 kelvin:2500. Each new state is subsequently visible via the list lights node.

Below is an extract from stdout showing the value of the payload being submitted to the underlying LIFX API.

21 Oct 21:39:31 - [info] [lifx-set-state:Test] {"color":"hue:240 saturation:0.8","fast":false} 21 Oct 21:41:33 - [info] [lifx-set-state:Test] {"color":"hue:240 saturation:0.8 brightness:0.75","fast":false} 21 Oct 21:42:51 - [info] [lifx-set-state:Test] {"color":"hue:240 saturation:0.8 kelvin:2500","fast":false}