rainbowValue for kelvin units for tunable white bulbs?


#7

this jumps. if you want to ramp you can combine this with rainbowvalue()

btw which bulbs support 1500K?


#8

The LIFX Day & Dusk bulbs hit 1500K. Giving them a shot - hopefully I can get them to behave.

So converting Kelvin to RGB… not so simple… but there’s some code down there that might make a nice piston…


#9

nice. but probably cost $75 or something a bulb. :slight_smile:

btw, rainbow might not work since it always returns a color.


#10

I got 'em for $29.99 :slight_smile: LIFX bulb colors are amazing, but I think they were designed by artists, not engineers.


#11

try this:

($hour24 < 15 ? int(1500 + (4000 * ((time($now)/1000) / (time(“15:00”)/1000)))) : int(1500 + (4000 - (4000 * ((time($now)/1000) / (time(“23:59”)/1000))))))


#12

Awesome, that gives a rather precise number, thanks.

Now I’m dealing with an entirely different issue - I think I have maxed out the number of wifi clients my router can handle (30!)


#13

probably going to need that for rooms occupancy so thought i would put it together any ways.

300+ devices? what do you have a fully automated mansion? :slight_smile:


#14

Hah, no, only 30!

I have a bunch of ESP8266 boards doing various things, each requiring a separate connection. That in combination with wifi bulbs… Stuff is sometimes not showing up in my tables.


#15

o ok. 30 devices seem low for a router to choke on?


#16

It does seem low… I’m trying to figure out why some of them have trouble being seen.


#17

@bangali this works great, and so simple to quickly add to tunable white bulbs. As far as I can tell, it’s creating what looks like a triangle wave that peaks at 15:00 (with 5500K), reverses direction, and bottoms out at at 23:59 (with 1500K). Is that correct?

Would you be willing to break this down so I can better understand the expression syntax? I’m wondering if a parabolic curve or sine wave could be created, for instance.


#18

yep. not an isosceles since light does not peak at noon but more like ~3pm.

($hour24 < 15 ? int(1500 + (4000 * ((time($now)/1000) / (time(“15:00”)/1000)))) : int(1500 + (4000 - (4000 * ((time($now)/1000) / (time(“23:59”)/1000))))))

up the hill: int(1500 + (4000 * ((time($now)/1000) / (time(“15:00”)/1000))))

the base is 1500 so thats the leading part. 4000 is the max height of the hill. at 15:00 it should be at peak so divide current time by time at 15:00 and multiply by 4000 to calculate how close to peak it is at any given time.

'down the hill: int(1500 + (4000 - (4000 * ((time($now)/1000) / (time(“23:59”)/1000)))))`

on this one at 23:59 should be back at base of hill. so divide current time by time at 23:59 and multiply by 4000 to calculate how far from peak it is at any given time. then subtract that from peak to find how close you are to the base.

sure. just requires a little work.


#19

Cool - I’ll get to work.

In the meantime I modified the range a tad. 1500 looks like a campfire burning embers. :fire:

($hour24 < 15 ? int(1800 + (4700 * ((time($now)/1000) / (time(“15:00”)/1000)))) : int(1800 + (4700 - (4700 * ((time($now)/1000) / (time(“23:59”)/1000))))))


#20

i use 1900 and 2600 as my 2 values.


#21

thanks for asking this question. included the function here as well:

https://community.webcore.co/t/rooms-manager-smartapps-and-rooms-occupancy-dth-now-with-support-for-rules/1813/197?u=bangali


#22

I’m trying to do this too, but I want it to change kelvin value according to the outside temperature. Is this possible? I’ve been trying to figure out the rainbowValue but don’t know how to do kelvins instead of color hex codes. Any help would awesome. Thanks in advance.


#23

rainbowvalue wont work for it. a simple formula to calculate the kelvin based on temperature should work.


#24

Thanks for the reply.

You say “simple”…I say “wuh…?” :wink:

I’m not sure how to do that.


#25

try the following piston by restoring it using piston code 7ns4 and selecting the devices when prompted. i have tried to write this so its easy to change and follow … but please dont hesitate to ask questions.

also see this: :slight_smile:


#26

Thanks for the piston and the reply. Also, thanks for the info about the reply buttons. :slight_smile: I’ll give this a try and let you know what i find. Thanks!