Help restoring previous state on LEDs


#15

Thanks for the help
i give up lol
i changed everything like you said but still no luck just staying on green :frowning:
i’m starting to think it’s a issue with the device handler on my controller


#16

one last try?

instead of capturing and restoring Color, capture and restore Color Temperature. leave the rest as is.

to be clear, i dont know your specific device and if it works with the device or the DH. but this might be worth one last try.


#17

i was going to try the color temperature but i don’t get the option for it


#18

ok. either the DH doesnt expose it or the device doesnt support it.

if you dont mind trying 2 things:

  1. logging the attributes values
  2. instead of using local store define a device variable and save and restore from this device variable.

#19

ive just had a try but i’m not sure how you do either
i think ive created the variable right but not sure how you link it to the capture and restore states
and sorry i dont know how to log the variables im still quite new to this.
Thanks


#20

take a look at the capture and restore in this example and the corresponding device variable saveLight that is defined at the top of this piston:


#21

Wooh must admit most of that is beyond me :frowning:
but i will give it a go tomorrow when i can get my head around it getting late here (UK)
one thing i did notice on that is you capture the attributes on a separate “with” to the restore shall i separate mine?
And noticed on mine it says after the capture “Only if store is empty” but yours doesn’t say whys that.
Thanks for all your help


#22

ehh, if you look through it a bit i am sure you will figure it out.

ok.

no that was just the flow for my piston.

yeah, i was thinking about that. lets remove that for now. just dont hold on to the button multiple times within seconds of each other, so the captured valuea do not get overwritten. :slight_smile:


#23

import this one and try:


#24

Thanks for all your effort with that pal…
But that didn’t work either stays green all the time.
Maybe it’s like you say it’s the device not allowing it I’ll try and contact the guy who wrote the firmware to see his thoughts.


#25

sure thing. sorry to hear. mind if i ask, what is the brand of the bulb?


#26

It’s not a bulb it’s a RGB controller (H801) for my LED step lights.
I flashed it with SmartThings firmware which works great.
There is a setting in the Smartapp to restore previous state on boot so it must remember.
community.smartthings.com/t/release-smartlife-h801-rgbw-led-strip-wifi-controller
Sorry about the late reply I got a message saying reached maximum posts for a new member lol


#27

ok. if you dont mind my asking the obvious, did you import the piston i posted or modify the one you had, for the last try?


#28

also, would you try this one please and post the log output?


#29

Hi sorry been in bed night time here :slight_smile:
Yeah I imported your piston , I’ve just imported that piston but can’t test it till later now as I’m in work :frowning:
Thanks


#30

hey, no worries, all of us have to sleep and work. :slight_smile:


#31

Just tried that latest one and it didnt work either :frowning:
I did notice though after the 10 second wait the light flickered but stayed green and also if the lights are off when the piston runs it will flash green then turn off as it should its only when the lights are on it doesn’t work properly.


#32

hmm … do you have the log output? what were the values?


#33

From what i can make out it seems to run and do what it should i can’t see any errors

24/08/2017, 19:17:09 +180ms
+0ms ╔Received event [Home].time = 1503598630837 with a delay of -1658ms
+135ms ║RunTime Analysis CS > 24ms > PS > 50ms > PE > 62ms > CE
+149ms ║Runtime (41230 bytes) successfully initialized in 50ms (v0.2.0e5.20170812) (147ms)
+150ms ║╔Execution stage started
+196ms ║║Restoring attribute ‘level’ to value ‘79’ using command setLevel(79)
+333ms ║║Executed physical command [Kitchen Counter LED].setLevel([79]) (136ms)
+334ms ║║Executed virtual command [Kitchen Counter LED].loadStateLocally (153ms)
+339ms ║║Executed virtual command [Kitchen Counter LED].wait (1ms)
+340ms ║║Waiting for 1000ms
+1364ms ║║Restoring attribute ‘saturation’ to value ‘’ using command setSaturation()
+1390ms ║║Executed physical command [Kitchen Counter LED].setSaturation([]) (25ms)
+1390ms ║║Executed virtual command [Kitchen Counter LED].loadStateLocally (42ms)
+1396ms ║║Executed virtual command [Kitchen Counter LED].wait (0ms)
+1396ms ║║Waiting for 1000ms
+2421ms ║║Restoring attribute ‘color’ to value ’ #dd00e2’ using command setColor( #dd00e2)
+2448ms ║║Executed physical command [Kitchen Counter LED].setColor([ #dd00e2]) (26ms)
+2449ms ║║Executed virtual command [Kitchen Counter LED].loadStateLocally (43ms)
+2454ms ║║Executed virtual command [Kitchen Counter LED].wait (0ms)
+2455ms ║║Waiting for 1000ms
+3480ms ║║Restoring attribute ‘hue’ to value ‘0.0’ using command setHue(0.0)
+3589ms ║║Executed physical command [Kitchen Counter LED].setHue([0.0]) (108ms)
+3590ms ║║Executed virtual command [Kitchen Counter LED].loadStateLocally (127ms)
+3595ms ║║Executed virtual command [Kitchen Counter LED].wait (1ms)
+3596ms ║║Waiting for 1000ms
+4610ms ║║Restoring attribute ‘switch’ to value ‘on’ using command on()
+4633ms ║║Executed physical command [Kitchen Counter LED].on() (22ms)
+4633ms ║║Executed virtual command [Kitchen Counter LED].loadStateLocally (28ms)
+4637ms ║╚Execution stage complete. (4488ms)
+4644ms ╚Event processed successfully (4645ms)
24/08/2017, 19:16:59 +18ms
+1ms ╔Received event [Alarm Button].button = held with a delay of 81ms
+141ms ║RunTime Analysis CS > 25ms > PS > 60ms > PE > 56ms > CE
+149ms ║Runtime (41230 bytes) successfully initialized in 60ms (v0.2.0e5.20170812) (148ms)
+150ms ║╔Execution stage started
+166ms ║║Comparison (enum) held gets (string) held = true (1ms)
+171ms ║║Cancelling statement #3’s schedules…
+186ms ║║Executed virtual command setAlarmSystemStatus (12ms)
+188ms ║║Condition #2 evaluated true (29ms)
+190ms ║║Condition group #1 evaluated true (state did not change) (30ms)
+193ms ║║Cancelling statement #5’s schedules…
+208ms ║║79
+208ms ║║Executed virtual command [Kitchen Counter LED].log (1ms)
+220ms ║║0
+221ms ║║Executed virtual command [Kitchen Counter LED].log (1ms)
+233ms ║║ #dd00e2
+234ms ║║Executed virtual command [Kitchen Counter LED].log (1ms)
+245ms ║║0
+246ms ║║Executed virtual command [Kitchen Counter LED].log (2ms)
+258ms ║║on
+259ms ║║Executed virtual command [Kitchen Counter LED].log (1ms)
+289ms ║║Executed virtual command [Kitchen Counter LED].saveStateLocally (23ms)
+1757ms ║║Executed physical command [Kitchen Counter LED].setLevel([100]) (1463ms)
+1758ms ║║Executed [Kitchen Counter LED].setLevel (1465ms)
+1811ms ║║Executed physical command [Kitchen Counter LED].setColor([[hex: #05ff00, hue:33, saturation:100, level:25]]) (47ms)
+1812ms ║║Executed [Kitchen Counter LED].setColor (50ms)
+1817ms ║║Executed virtual command [Kitchen Counter LED].wait (0ms)
+1818ms ║║Requesting a wake up for Thu, Aug 24 2017 @ 7:17:10 PM BST (in 10.0s)
+1825ms ║╚Execution stage complete. (1675ms)
+1827ms ║Setting up scheduled job for Thu, Aug 24 2017 @ 7:17:10 PM BST (in 9.993s)
+1843ms ╚Event processed successfully (1843ms)


#34

thanks. now please turn off logging and lets see the values printed from these statements: