Hi guys - I’ve had a piston that’s been working for a few years without any issues. I’m running webCore v0.3.110. Maybe this functionality broken when I updated webCore weeks ago and I just hadn’t noticed, but I can’t think of any changes I’ve made to the system and this piston hasn’t been touched in a long time.
The piston is designed so that (among other things) when th piston contact sensor changes to open, it checks to see if it has been closed for at least 240 minutes. If so, it goes on to do other things such as turn lights on.
For some reason this stopped working a while ago, but I’m not sure when it broke.
I’ve included only the relevant portion of the piston for various reasons, but hopefully its enough to get some ideas. I also included the logging:
I debugged this today and found something quite odd. As you can see from the log, it did properly detect that the sensor’s contact changed to open, so the first part of the IF statement passed. BUT the second IF condition that checks to see if it had been closed for > 240 minutes evaluated to false according to the log, but should have been true!
I checked the detailed Device Info in SmartThings for this sensor. It shows that prior to this state change, the state had been Closed for 10 hours (600 minutes). See this:
It seems the logic of the piston is correct, but for whatever reason webCore doesn’t know the proper amount of time that the sensor had been closed. I’m not sure how long it things it had been closed, but certainly it thinks it was less than 240 minutes or the condition would have evaluated to true.
Any ideas what may be going on here and how I can troubleshoot it further? I don’t think the issue is with the piston itself since it had been working for a very long time without any changes to it. So perhaps something changed in webCore or SmartThings and therefore I need to take a different approach to determining if the door had been closed for 240 minutes? In fact, I’d be happy to just change it to a different type of condition/check if that may solve it without having to troubleshoot more…
Thanks everyone!