I built a piston that updates the white color temperature of a tunable white LED bulb based on the current ambient light levels outside as measured by a NodeMCU ESP8266 device hooked up to an Adafruit color sensor.
It works just fine if I use the ‘Set Color Temperature’ task but it’s very abrupt as there is no fade. I noticed the task called “Fade Color Temperature…” but it just doesn’t work at all unfortunately.
Here is the logs, first for the Fade Color Temperature (which does not do anything), and then using Set Color Temperature which works fine:
Fade Color Temperature event log:
+1ms ╔Received event [NodeMCU1 (colorTemperature1)].colorTemperature = 3201 with a delay of 413ms
+184ms ║RunTime Analysis CS > 22ms > PS > 46ms > PE > 117ms > CE
+195ms ║Runtime (37109 bytes) successfully initialized in 46ms (v0.2.0e5.20170812) (193ms)
+196ms ║╔Execution stage started
+213ms ║║Comparison (integer) 3201 changes = true (1ms)
+215ms ║║Condition #12 evaluated true (8ms)
+217ms ║║Condition group #1 evaluated true (state did not change) (10ms)
+223ms ║║Evaluating switch with values [[i::32d37b8cba6f053831867ae6061de516::colorTemperature, v:[t:integer, v:3201, d::32d37b8cba6f053831867ae6061de516:, a:colorTemperature, i:null, x:false, vt:string]]]
+231ms ║║Comparison (integer) 3201 is_inside_of_range (integer) 1 .. (integer) 2699 = false (4ms)
+239ms ║║Comparison (integer) 3201 is_inside_of_range (integer) 2700 .. (integer) 6000 = true (4ms)
+243ms ║║Cancelling statement #8's schedules...
+299ms ║║Executed physical command [null].setColorTemperature([100]) (28ms)
+300ms ║║Executed virtual command [SYLVANIA Smart RT5/6 Tunable White].fadeColorTemperature (40ms)
+305ms ║╚Execution stage complete. (109ms)
+316ms ╚Event processed successfully (316ms)
Set Color Temperature event log:
+2ms ╔Received event [NodeMCU1 (colorTemperature1)].colorTemperature = 4052 with a delay of 131ms
+242ms ║RunTime Analysis CS > 25ms > PS > 56ms > PE > 161ms > CE
+253ms ║Runtime (36509 bytes) successfully initialized in 56ms (v0.2.0e5.20170812) (249ms)
+254ms ║╔Execution stage started
+273ms ║║Comparison (integer) 4052 changes = true (1ms)
+276ms ║║Condition #12 evaluated true (9ms)
+277ms ║║Condition group #1 evaluated true (state did not change) (12ms)
+284ms ║║Evaluating switch with values [[i::32d37b8cba6f053831867ae6061de516::colorTemperature, v:[t:integer, v:4052, d::32d37b8cba6f053831867ae6061de516:, a:colorTemperature, i:null, x:false, vt:string]]]
+293ms ║║Comparison (integer) 4052 is_inside_of_range (integer) 1 .. (integer) 2699 = false (4ms)
+302ms ║║Comparison (integer) 4052 is_inside_of_range (integer) 2700 .. (integer) 6000 = true (3ms)
+306ms ║║Cancelling statement #8's schedules...
+805ms ║║Executed physical command [null].setColorTemperature([4052]) (489ms)
+806ms ║║Executed [SYLVANIA Smart RT5/6 Tunable White].setColorTemperature (491ms)
+812ms ║╚Execution stage complete. (559ms)
+823ms ╚Event processed successfully (823ms)