Hi guys.
I’m after a little help with this small piston I have.
What I want is when I hold my button to turn the SHM of I want the leds near the door to flash green for 5 seconds.
But I want it to then go back to the colour it was on before it goes green.
As it is now it comes on and goes green but stays green and doesn’t change back.
I’m still getting to grips with positions so any help would be great.
Thanks
Help restoring previous state on LEDs
Possible bug with sending change colour commands
Yeah switch as well as it won’t always be the same state when the piston runs.
I’m not too sure about that with the data , not sure how I’d find out.
It’s a H801 controller flashed for SmartThings , I can’t find a setting similar to that.
Thanks for the replies
what @c1arkbar is probably referring to is an option for the capture and restore tasks. if you click on those tasks in edit mode you will see it. this one:
you would set it true on the capture and restore tasks. that way the attributes are protected till the restore runs.
Thanks for that.
I’ve changed that but I only had that option on the capture and on the restore it was “empty state after restore” which I set to true.
But I had a quick try before work and it still did the same thing by staying green.
if you want to restore everything heres what i use that works consistently. note this is a lightify bulb and restoring these attributes restores everything that i needed. depending on the type of your bulb you may also need to restore the attribute color, which i dont.
also, turn off command optimization in piston settings.
Thanks I’ll try that when I finish work
So shall I keep the capture the same way I have it now?
Can I ask why you have a 1 second wait in between each restore.
Yes, the capture the same way is fine. Just note in the example I shared I save the attributes to a defined device variable. You are saving it to a local state, so you should also restore from local state.
My lightify bulbs seem to get confused otherwise
Whats the reason you save yours to a device variable?
Do you think local state will be ok for mine
that didn’t work for some reason it still stays green
this is what i get in the log i can’t understand most of it but to me it does look like it tries to restore
23/08/2017, 18:01:16 +132ms
+1ms ╔Received event [Home].time = 1503507677510 with a delay of -1379ms
+145ms ║RunTime Analysis CS > 22ms > PS > 66ms > PE > 57ms > CE
+157ms ║Runtime (37864 bytes) successfully initialized in 66ms (v0.2.0e5.20170812) (155ms)
+159ms ║╔Execution stage started
+216ms ║║Restoring attribute ‘color’ to value ’ #d500d3’ using command setColor( #d500d3)
+252ms ║║Executed physical command [Kitchen Counter LED].setColor([ #d500d3]) (36ms)
+254ms ║║Executed virtual command [Kitchen Counter LED].loadStateLocally (57ms)
+260ms ║║Executed virtual command [Kitchen Counter LED].wait (1ms)
+261ms ║║Waiting for 1000ms
+1290ms ║║Restoring attribute ‘level’ to value ‘100’ using command setLevel(100)
+1297ms ║║Skipped execution of physical command [Kitchen Counter LED].setLevel([100]) because it would make no change to the device. (6ms)
+1298ms ║║Executed virtual command [Kitchen Counter LED].loadStateLocally (28ms)
+1304ms ║║Executed virtual command [Kitchen Counter LED].wait (1ms)
+1305ms ║║Waiting for 1000ms
+2321ms ║║Restoring attribute ‘switch’ to value ‘on’ using command on()
+2325ms ║║Skipped execution of physical command [Kitchen Counter LED].on([]) because it would make no change to the device. (4ms)
+2326ms ║║Executed virtual command [Kitchen Counter LED].loadStateLocally (12ms)
+2333ms ║║Executed virtual command [Kitchen Counter LED].wait (1ms)
+2334ms ║║Waiting for 1000ms
+3373ms ║║Could not find a command to set attribute ‘$status’ to value ‘ONLINE’
+3375ms ║║Executed virtual command [Kitchen Counter LED].loadStateLocally (28ms)
+3382ms ║╚Execution stage complete. (3224ms)
+3391ms ╚Event processed successfully (3392ms)
23/08/2017, 18:01:12 +190ms
+2ms ╔Received event [Alarm Button].button = held with a delay of 279ms
+129ms ║RunTime Analysis CS > 19ms > PS > 64ms > PE > 46ms > CE
+172ms ║Runtime (37669 bytes) successfully initialized in 64ms (v0.2.0e5.20170812) (169ms)
+174ms ║╔Execution stage started
+196ms ║║Comparison (enum) held gets (string) held = true (1ms)
+201ms ║║Cancelling statement #3’s schedules…
+214ms ║║Executed virtual command setAlarmSystemStatus (10ms)
+217ms ║║Condition #2 evaluated true (28ms)
+218ms ║║Condition group #1 evaluated true (state did not change) (31ms)
+222ms ║║Cancelling statement #5’s schedules…
+230ms ║║Executed virtual command [Kitchen Counter LED].cancelTasks (1ms)
+248ms ║║Executed virtual command [Kitchen Counter LED].saveStateLocally (10ms)
+259ms ║║Skipped execution of physical command [Kitchen Counter LED].setLevel([100]) because it would make no change to the device. (5ms)
+260ms ║║Executed [Kitchen Counter LED].setLevel (7ms)
+311ms ║║Executed physical command [Kitchen Counter LED].setColor([[hex: #05ff00, hue:33, saturation:100, level:25]]) (45ms)
+312ms ║║Executed [Kitchen Counter LED].setColor (48ms)
+318ms ║║Executed virtual command [Kitchen Counter LED].wait (1ms)
+319ms ║║Requesting a wake up for Wed, Aug 23 2017 @ 6:01:17 PM BST (in 5.0s)
+328ms ║╚Execution stage complete. (154ms)
+330ms ║Setting up scheduled job for Wed, Aug 23 2017 @ 6:01:17 PM BST (in 4.991s)
+346ms ╚Event processed successfully (346ms)
please try:
- turn off command optimization in piston settings
- set TCP to never for that With statement
- instead of restoring color try capturing and restoring hue, along with the rest of those attributes. see my snippet for attributes to capture and restore and try them in the same sequence.
Thanks for the help
i give up lol
i changed everything like you said but still no luck just staying on green
i’m starting to think it’s a issue with the device handler on my controller
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.
ok. either the DH doesnt expose it or the device doesnt support it.
if you dont mind trying 2 things:
- logging the attributes values
- instead of using local store define a device variable and save and restore from this device variable.
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
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: