mcisar Posted January 19, 2020 Share Posted January 19, 2020 Hoping someone may be able to give me a quick example of how to "fancy up" a simple program. I have a very basic program written to lock a Yale lock, I trigger this program using one of my keypadlinc buttons. I'd kind of like to spruce up the program to give me a little more peace of mind but not quite sure how to start. Ultimately I'd like to have it... lock the lock check the status to see if it's locked if it's not locked try again a couple of times checking the status after each try if it still is not showing locked send a notification to warn me whether its just not showing as locked for some reason, not responding or jammed... or low battery if thats possible. Thanks! Link to comment
DennisC Posted January 19, 2020 Share Posted January 19, 2020 I use a program to monitor the lock status. Whenever the status changes, an email is sent. No guessing and I always know the status of the lock. Link to comment
oberkc Posted January 19, 2020 Share Posted January 19, 2020 I would want to experiment around here, but I wonder if there is a place for a query action? An early conceptual approach could be something like: if button is pressed then llock door wait a couple of seconds query door run check program check program (disabled) if Door is unlocked then send notification Link to comment
mcisar Posted January 19, 2020 Author Share Posted January 19, 2020 DennisC, there is definitely a place for the type of monitoring you are talking about but I find that too many notifications can get you acclimatized or overloaded to the point where you just don't see/hear them any longer. Open the door to check the mail "door is unlocked" "door is locked", take out the trash "door is unlocked" "door is locked". Because of my work I already get way more than my share of notifications from monitored equipment so it's kind of a matter of "don't tell me when something goes right... just tell me when it goes wrong". If I'm really curious for some particular reason I can always double check the status but otherwise I'm happy for ISY to do the checking for me with the knowledge that it'll let me know when there's something I need to know (ie. ISY tried to lock the door 3 times and it's still unlocked... check this out). There's nothing right or wrong about one method or the other, just a matter of preference. Link to comment
mcisar Posted January 19, 2020 Author Share Posted January 19, 2020 Oberkc that's kind of what I was thinking, but with a loop of some sort around the locking/checking (and I suppose when it comes right down to it the status check could come first, if the door is already locked we don't need to lock it). I'm just not sure how to do the loop I want in ISY-speak. so essentially to "flowchart" it... :start is door locked --> yes, end program --> no --> have we tried to lock it 3 times yet --> no, lock it then go back to start to check again --> yes, send a notification saying something's wrong :end program Link to comment
oberkc Posted January 19, 2020 Share Posted January 19, 2020 49 minutes ago, mcisar said: I'm just not sure how to do the loop I want in ISY-speak This would probably require some type of variaable. Without thinking too hard (it is a Sunday afterall) and without worrying too much about exact syntax, perhaps this could provide a useful starting point for you: if button is pressed then lock door wait a little bit query lock run check program check program (disabled) if door is unlocked and variable is less than some number then query lock increment variable Run this program again (if path) else run notification program notification program (disabled) if door is unlocked then reset variable send message else Reset variable 1 Link to comment
Recommended Posts