General question. If I run a piston to turn on a light for example, but the light is already on, does the piston automatically recognize that it is on and not try to turn it on again, or do I need an IF, THEN to check if it is already on? It appears it is the latter from my testing, is that correct?
It will just send the command to turn on the light. If the light is on, it will just stay on, no harm done. Having the versatility of supporting all device commands means I canāt test their state before sending a command - there is not one single line of code that deals with the āonā command on its own. The same line of code that executes āonā executes āoffā, āsetLevelā, āsetHueā, etc. I think itās a small price to pay, sending the command to a device thatās already in that state. And no harm from it either. Performance wise, itās me testing the attribute (using resources) or me sending the command (using resources). If the DTH is smart enough to filter the āonā because the light is already āonā, it spares the zwave/zigbee network tooā¦
There is a way. Via Save/Load state, but thatās not ready yet, I am currently testing the save/load state from variable. Then Iāll have the save/load state locally and globally, Iāll explain what they do. But I am now testing this, when I have it working, Iāll update the CoRE on github.
On switch on you could save the state of the two lights to either a variable or the local store, then turn both on. On switch off, you then load the state from the variable you previously saved it to. This will revert both lights to the state they were in before you turned them onā¦
Thanks and I will see what happens tonight!
No worries. I only ask because I noticed that my LED under-cabinet lights in the kitchen increase in brightness momentarily and then revert back to the setting specified in the piston, if theyāre already on. I do have two actions for the light, Turn On and then Set Level. Maybe I can take out the Turn On action. I will experiment a little. Or for that light specifically, I can add an IF, THEN. I only have the issue with that light.
Thanks.
Yeah, for color/color temp lights, turn on may modify some other parameters too, depending on the DTHā¦
Another question. I recently integrated my ADT Alarm into ST using the approach detailed here. It works great. ST recognizes it as both a Lock, which allows toggling Arm Away, and as a switch, which allows toggling Arm Stay.
I want to create a piston that runs a Routine (Iām Back!) when the alarm is āunlockedā, i.e. when Arm Away is turned off (which can only mean it goes to Disarmed state, you canāt go from Arm Away to Arm Stay).
I created the below (Dashboard still not showing step details for me), but it just flat out didnāt work. Nothing happened when the alarm moved from Arm Away to Disarmed. Any ideas please?
Can you please enable debugging and then check the logs? Thank you
Turned on debugging. Where do i access the logs?
Go to your IDE and click on Live Logging. Then unlock that lock⦠and watch the screen.
Nothing shows up at all. I tested other things and those do show up, but nothing when I āunlockā the alarm at all. Also tried re-locking it too. Nothing on the Live Logging page at all. Also donāt see the Home Alarm device in the top section that lets you filter by device. Perhaps the device handler (AD2SmartThings v4.1) doesnāt log?
Or not working?
Well its working in that it is in fact turning the alarm on and off - I verified in the ADT app.
So it can control ADT, but does it change the lock status when you disarm ADT? Is the ālinkā bedirectional? Maybe it updates the lock status every few minutes?!
Yaaay. I canāt wait to be confused when setting it up when itās ready 
How are you guys seeing this visualization�
I feel like Iām missing something really cool hereā¦
Yep its bidirectional. I just disarmed it using the ADT app and it immediately showed as disarmed in ST. And I have ālocking the lockā (i.e. setting alarm to Arm Away) as part of my āGoodbye!ā routine which runs when all presence sensors leave the house, and that has been working fine.
Which āvisualizationā are you referring to?
Do you see any logs from that device when you arm/disarm ADT?
No nothing, using both ST and the ADT app to arm/disarm. I found the below in the device handler code, should I change āfalseā to ātrueā?
// Parse incoming device messages to generate events
def parse(String description) {
//log.debug "Parsing: ${description}"
def isDebugEnabled = false