I have a piston that had been working fine (95% of the time at least) prior to adding a Konnected device to my security system and getting access to countless sensors around the house. I decided I wanted to address a small issue I was having. The basic idea is that, if it’s daytime and the door lock state changes to Unlocked, then wait 30 minutes (I’m likely home and working on the yard or some such) and then lock the door. If it’s night then wait just two minutes and then lock the door. The complication happens when a visitor shows up at night and you get the long hello or good-bye at the door. Two minutes expires and the deadbolt locks with the door open. So, now that I have door sensor access I wanted to add a check to verify first that the door is indeed closed before locking the lock.
Some of the time this is working just fine. At other times the door sensor SEEMS to be claiming the door is open when it’s clearly closed. However, outside of this window of time, all testing never shows a time when the sensor is wrong.
That has me wondering if my piston is doing something odd that’s mixing up the situation. Is this code basically doing things the right way for this?
Thanks…