This object is in archive! 

How to make system pick a random colour on RGBW light

Attila Hajdu shared this question 8 years ago
Answered

Hi Everyone. I need an advise.


1. I have a rule, where if I switch the virtual switch on, the RGBW bulb changes it's colour to green. If I switch off, it goes back to white.

Now, how to make the colour to be a random and not fixed green?

Imagine, virtual switch is like a scene, if turned on, I have a random colour in the room. When off, goes to full white.

Any idea?


2. Also, how can you set up continuous dimming effect from 100% to 20%?

If I would turn a virtual switch on the light would slowly dim to from 100% to 20%, and if turned off from 20% to 100%. Time to dim lets say 5 seconds...

Any idea?

Files: rule.png

Replies (7)

photo
1

There is a "Random between __ and __" puzzle in the Variable secition, but since your light is using hex values, I don't think you could use it (easily).

You might be able to use it like this:

if (random_value == 1)

HexString = "ffffff"

else if (random_value == 2)

HexString = "fffff0"

else if (...)

...

action setRGBW -> HexString

..in theory, at least.

photo
1

Hi Marius,

Thanks for the info but surely there is an easier way to do this.

photo
1

Hi, Attila. Is there an easier way, or do you think there must be an easier way?

photo
1

I would try something like this:

77d38b51c33883083ad573902e989e54

then you can fill in your color range in the two fields of gotovalue

photo
1

Will give it a go tonight.


Anyone has an idea on my second topic relating to dimming?

photo
2

I come up with below, not sure if there is an easier way. For increasing light just use reverse :-)


4df5d77eef601993c736ba2e675973e6

photo
1

probably this is one way of doung it. I'm curious if others have different idea? Wonder if there is a simple puzzle to achieve this at all.


Imagine if you turn the switch on and after 3 seconds you turn off. The off effect would be funny as the light would dim from whatever percentage to 20% and start to go up instead of just increasing the dimming from the actual state...

photo
1

You could have a variable "DimmingUp" that is set to 1 when you click on and set to 0 when you click off. You would then have to test this variable for each dimming step (between the one secons wait). You will also proably need a refresh puzzle.

BTW: Take a look at the Repeat puzzle. Together with a Increment/Decrement puzzle, you should be able to make the rule more tidy.

photo
photo
1

This device is not very good implemented. To get a specific colour you have to adjust each color seperately. And sometimes you will get some strange colors. Dimming time you can change in the advanced parameter section.

photo
1

Is that a Fibaro RGBW Modul? If yes it's look wrong. In my case it looks so:


/408b12efdf77a9b519c6eba91548a505

Leave a Comment
 
Attach a file