Hi all,
I have an Ikea on/off switch that I use to control a RGBW LED strip connected to a Shelly RGBW2. I have the on/off working but now I want to use the long press on/off to dim the white of the LED strip.
I figured I would need to know the current white setting and then send a new message to the RGBW2 with the current white setting + 5. But how do I get the current white setting from the status message?
This is the status message, the white is set to 125 here.
{
"lights":
[{
"ison":false,
"source":"http",
"has_timer":false,
"timer_started":0,
"timer_duration":0,
"timer_remaining":0,
"mode":"color",
"red":0,
"green":0,
"blue":0,
"white":125,
"gain":28,
"effect":0,
"transition":0,
"power":10.48,
"overpower":false
}],
"meters":
[{
"power":10.48,
"is_valid":true,
"overpower":false,
"timestamp":1663629453,
"counters":
[
8.309,
1.018,
0
],
"total":2170
}],
"inputs":
[{
"input":0,
"event":"",
"event_cnt":0
}]
}
- How do I get this value for white (125 here) from this message?
- And how do I increase that value by 5? (I’m guessing a change node?)
- And finally, how do I use the new value (130) in the new message to send to the RGBW2?
The new message would have to look like this:
{
red : 0,
green : 0,
blue : 0,
white : 130,
on : true
}