node-red-contrib-nora icon indicating copy to clipboard operation
node-red-contrib-nora copied to clipboard

[feature] Add support for colored lights

Open Sw0rdf1sh1 opened this issue 5 years ago • 18 comments

Hello, what about color support for light?

Sw0rdf1sh1 avatar Mar 19 '19 20:03 Sw0rdf1sh1

It's already present on the service, the node-red node needs to be updated to support it. PRs are welcomed! :)

andrei-tatar avatar Mar 20 '19 07:03 andrei-tatar

I'm also looking at trying to get the colours working on neopixels connected to a Pi through this excellent service. What needs changing in node-red?

MrHarcombe avatar Mar 23 '19 20:03 MrHarcombe

Hi, thank you for this amazing service! :) I am actually also looking for the color support. (yes I do have the latest version installed) What needs to change to make it work? Thanks again

alexkainzinger avatar Apr 07 '19 11:04 alexkainzinger

The light node needs a new checkbox and the rules (when it's visible or not based on the other checkboxes): https://github.com/andrei-tatar/node-red-contrib-nora/blob/master/src/nodes/nora-light.html I already started working on this at some point (see the light-color id div). I might get some time to look over this in the following days.

andrei-tatar avatar Apr 08 '19 09:04 andrei-tatar

I'm waiting too for this function! :) i mounted the rgb led but i can't control the color with google

mariocarbone avatar Jun 05 '19 10:06 mariocarbone

Hello, I am using this node and I would like to be able to use the RGB of the lights. I have updated Node network and nora to its latest versions.

How is this topic going?

Bhelma avatar Sep 07 '19 10:09 Bhelma

Not too great. I usually implement only the things I also need because there's a lot of time needed to keep up (I would also like to add support for local execution). Contributions are greatly appreciated! :)

andrei-tatar avatar Sep 20 '19 10:09 andrei-tatar

I'm also waiting impatiently :) is there an estimate of when the function could be finished?

dchwilk avatar Oct 30 '19 15:10 dchwilk

Hello,

I'm trying to implement colors for NORA on node-red, but I realized that on the service you only implemented HSV (https://developers.google.com/assistant/smarthome/traits/colorsetting#rgb,-hsv,-and-color -temperature).

Any reason not to enable RGB and temperature?

FernandoWahl avatar Nov 21 '19 20:11 FernandoWahl

HSV can be converted to RGB in the plugin (or by some other node-red plugin). Just a bit of maths. Also I was thinking of updating the V (from HSV) via brightness in case of colored lights. Temperature... not sure who of the DIY-ers need this... Probably most of us will play will colored RGBs. But feel free to add support to backend as well for RGB/temperature if you find it useful. I will have a look at the PR.

andrei-tatar avatar Nov 22 '19 06:11 andrei-tatar

So I found another method to perform the core conversion, works very well. Actually, I'm using https://www.npmjs.com/package/color-convert with https://www.npmjs.com/package/node-red-contrib-function-npm. Working very well.

About HSV I didn't know this pattern before. Using here I found out more about it and realized that I can make some improvements later to optimize its use.

About PR, check the TODO that I put.

And I'm sorry for my google english translator :D

 2019-11-22 às 10 47 09

FernandoWahl avatar Nov 22 '19 13:11 FernandoWahl

I will fix the service HSV vs Hsv. Didn't notice they used different caps. Kinda weird. Thanks for noticing that! :)

andrei-tatar avatar Nov 25 '19 08:11 andrei-tatar

PR merged

andrei-tatar avatar Dec 03 '19 15:12 andrei-tatar

next, we should integrate the color temperature.

Chrischi- avatar Dec 04 '19 12:12 Chrischi-

noticed 0.0.30 with color support and tried to get it to work(before i noticed things are not finished)

Hue works but S and V need to be selectable between 0-100%

also on the readme you state this

Payload must be an object like { [on]: true/false, [brightness]: 0-100, [color]: { [spectrumHsv] : { [hue]: 0-360, [saturation]:0-1, [value]:0-1 } } }')

i think those [] need to be replaced by ""

so correct syntax is

Payload must be an object like { "on": true/false, "brightness": 0-100, "color": { "spectrumHsv" : { "hue": 0-360, "saturation":0-1, "value":0-1 } } }')

took me a while before i noticed what was wrong

regarding the saturation and value: these do not seem to work. values should go from 0-100 and not 0-1

i am feeding the light this msg.payload but only hue and brightness gets accepted

image

GravityRZ avatar Dec 05 '19 15:12 GravityRZ

Square brackets usually mean a field is optional. Of course JSON needs double quotes. However, javascript doesn't (if you write in the function node).

return {
  payload: {
    on: false,
    brightness: 32,
    spectrumHsv: {
      hue: 31,
    },
  },
};

andrei-tatar avatar Dec 06 '19 10:12 andrei-tatar

yes i write in the function node but send it out as json (just like it is received as json.

UPDATE i discoverd the problem. Sat needs to be divided between 100

discovered that everything is pushed from domoticz to node-red-nora ok going back from nora to domoticz it seems domoticz has no way of pushing back sat, only hue???

strange

GravityRZ avatar Dec 06 '19 12:12 GravityRZ

@Sw0rdf1sh1

should this not be closed.

GravityRZ avatar Jan 31 '20 11:01 GravityRZ