mango Posted March 30, 2021 Posted March 30, 2021 Hi all, Please go easy with me. Some of this is way over my head. Having recently installed some Schlage BE469 deadlocks, I have been able to setup pushover and email notifications for doors locking and being unlocked. I now want to display the user and am having difficulty making sense of how to go about it without creating a large bloated mess. Last night I've realized I may be able to do this very cleanly with the use of the correct variable syntax, but I am unsure how to apply this: ${sys.node.ZW###USRNUM} would return the correct user number. How would I convert user numbers to actual names? Any tips and hints gratefully received.
Bumbershoot Posted March 30, 2021 Posted March 30, 2021 @mango, I don't think there's an elegant way to do what you're trying to do. You have to work around ISY limitations with regards to STRINGS. The first thing I did is create a program that puts user # into an INTEGER variable, and the lock status into a STATE variable. When the status of the STATE variable changes, I have another program that will evaluate a couple of conditions, and if the conditions are met, it will use both variables in the body of an email. I put a small static table (for user lookup information) in the body of an email customization. Below is an example of what the email look like: The Garage Door lock status is ${var.2.27} 0 = Unlocked 1 = Locked Person making this change is ${var.1.5} 0 = Manual or programmatic unlock 1 = Lori 2 = Brad 3 = Zak 4 = Katherine 5 = Wally 6 = Norman 7 = Ann 1 1
MrBill Posted March 30, 2021 Posted March 30, 2021 related: essentially you can proceed as bumbershoot suggested, or you need to create a 'message', either email or Network Resource with each users friendly name. then a program for each different notification. The ISY doesn't store strings as variables. 1
mango Posted March 30, 2021 Author Posted March 30, 2021 (edited) Thanks both. I only have 6 possible users including guest so I may go with @MrBill 's suggestion. This I assume should also allow me to assign separate pushover icons per user which may be visually a plus. Coming from the land of BASIC programming many moons ago.... Edited March 30, 2021 by mango added stuff
MrBill Posted March 30, 2021 Posted March 30, 2021 I use pushover and have MANY network resources so that I can have the message customized..... Hint... discover the copy button for programs or network resources... it makes it faster to set up repetive messages and programs, Copy, edit the copy, copy, edit the copy...etc..
mango Posted March 30, 2021 Author Posted March 30, 2021 I have already used the copy function wherever it may be, thankfully. So, having lots of network resource entries has no impact on the ISY other than taking up space, correct? An entry is only called into being to run then put back freeing up resources once more? 1
MrBill Posted March 30, 2021 Posted March 30, 2021 (edited) 44 minutes ago, mango said: I have already used the copy function wherever it may be, thankfully. So, having lots of network resource entries has no impact on the ISY other than taking up space, correct? An entry is only called into being to run then put back freeing up resources once more? i think they just use up a tiny drop of space on the SD card... doesn't seem to consume vital resources. Edited March 30, 2021 by MrBill 1
larryllix Posted March 30, 2021 Posted March 30, 2021 (edited) Be aware of variable substitution also. I operate about 35 RGBW bulbs and strips from three NRs. I rarely use 1 x ON NR, frequently 1 x setLevels NR, and 1 x Off NR, for all devices. Each of the three NRs contain strings of text containing the commands. Edited March 30, 2021 by larryllix 1
mango Posted March 30, 2021 Author Posted March 30, 2021 so...I have 6 physical user numbers including guest, but I also need to add user 0 for times the door is locked manually from inside or without code from the outside (pressing the Schlage button). Each user requires only 2 notifications, unlock and lock. I could further develop the project with lock jammed and unknown (Z-Wave comms error?). Is there a battery level node?
Bumbershoot Posted March 30, 2021 Posted March 30, 2021 2 hours ago, mango said: Is there a battery level node? Yes, it's the BATLVL property. Something like this should fetch the value into a report: ${sys.node.ZW024_1.BATLVL} 1
larryllix Posted March 30, 2021 Posted March 30, 2021 (edited) When I have events to report via NRs, I use variable substitution, using numbers for rooms or devices, I always include a small chart like this. Eg. Motion has been detected in room 23 <------ was variable substituted all from one NR. Rooms: RecRm=11, EveBR=12, AftBR=13, LLand=19 GathRm=21, MBR=23, Foyer=25, MudRm=29 Shop=31 Edited March 30, 2021 by larryllix 1
mango Posted March 31, 2021 Author Posted March 31, 2021 (edited) Sorry another question: Is there a trick to adding ${sys.node.ZWXXXX.BATLVL} to the body of a pushover resource? Edited March 31, 2021 by mango
larryllix Posted March 31, 2021 Posted March 31, 2021 Only problem I have had with my NRs is if you change the values of the variable being substituted it may go out with the new value instead of the intended value. The values are substituted at send time, and not at invocation time. That becomes a problem for ISY as it's smallest time delay is 1 second and that makes rapid sending of NRs from a single NR very slow. 1
MrBill Posted March 31, 2021 Posted March 31, 2021 12 hours ago, mango said: Sorry another question: Is there a trick to adding ${sys.node.ZWXXXX.BATLVL} to the body of a pushover resource? Since you're asking this question I assume that the pushover is sending ${sys.node.ZWXXXX.BATLVL} instead of the value you're expecting. That probably means that ZWXXXX isn't correct, or there is not a BATLVL value for that node. (I don't have any Z-wave nodes to make a screen shot and circle things sorry) How is battary level expressed in the admin console as a % or volts? if volts try .CV instead of .BATLVL You could me a screen shot of the node details and post it and we might be able to help further. 1
mango Posted March 31, 2021 Author Posted March 31, 2021 MrBill you are being most helpful thank you. I am not local to the ISY at present. It's simply a case of formatting, and probbly something very simple that I am not understanding. One of my locks is ZW002, so for battery level my command would be: ${sys.node.ZW002_1.BATLVL} From memory the body line consists of: token=x&user=x&message=x Where and how do I place 'Battery Level = ${sys.node.ZW002_1.BATLVL}' ? Everything I tried last night resulted in a TCP400 error and the message could not be sent.
MrBill Posted March 31, 2021 Posted March 31, 2021 (edited) @mango here's the body of one of my pushover messages: token=[redacted]&message=The Spa Temp is ${var.2.31}\nOutdoor temp: ${sys.node.n007_temperature.ST} Wind Chill: ${sys.node.n007_temperature.GV1} \nWind: ${sys.node.n007_wind.ST}/${sys.node.n007_wind.GV0} ${sys.node.n007_wind.GV2} \n is replaced with a new line character (a.k.a return key) making this a 3 line message. Edited March 31, 2021 by MrBill 1
mango Posted March 31, 2021 Author Posted March 31, 2021 hmm, so I was doing it right, even with a new line, there doesn't seem to be any black magic stuff. As you say above then it may be the wrong values for Schalge locks? I'll dig deeper tonight, thanks again.
MrBill Posted March 31, 2021 Posted March 31, 2021 (edited) 1 hour ago, mango said: hmm, so I was doing it right, even with a new line, there doesn't seem to be any black magic stuff. As you say above then it may be the wrong values for Schalge locks? I'll dig deeper tonight, thanks again. (Note: in the text below, replace IP.ADDR.OF.ISY with the actual IP address of your ISY) you can go to http://IP.ADDR.OF.ISY/rest/nodes in a browser window to get a listing of all nodes. what is between the <address> </address> is the exact text you need for the red portion: ${sys.node.ZW002_1.BATLVL} (hint: this page can be huge... use browser search or 'find in page' to poke around for what you're looking for.) next append that to the URL in the browser: http://IP.ADDR.OF.ISY/rest/nodes/ZW002_1 that will list just the node with the included properties included, In my example we will use wind: http://WW.XX.YY.ZZ/rest/nodes/n007_wind <nodeInfo> <node flag="0" nodeDefId="wind"> <address>n007_wind</address> <name>Wind</name> <family instance="7">10</family> <parent type="1">n007_mbweather</parent> <type>1.11.4.0</type> <enabled>true</enabled> <deviceClass>0</deviceClass> <wattage>0</wattage> <dcPeriod>0</dcPeriod> <startDelay>0</startDelay> <endDelay>0</endDelay> <pnode>n007_mbweather</pnode> </node> <properties> <property id="GV0" value="1208" formatted="12.08 mph" uom="48" prec="2"/> <property id="GV1" value="334" formatted="334°" uom="14"/> <property id="GV2" value="15" formatted="NNW" uom="25"/> <property id="ST" value="291" formatted="2.91 mph" uom="48" prec="2"/> </properties> </nodeInfo> so in this case: .ST is the wind speed .GV0 is the gust speed .GV1 is the wind direction in degrees .GV2 is the cardinal wind direction so ${sys.node.n007_wind.ST} is what I would use for wind speed. Edited March 31, 2021 by MrBill 1 1
mango Posted March 31, 2021 Author Posted March 31, 2021 BOOM! Light bulb. That is gold mine information, thank you. 1
SteveT Posted March 31, 2021 Posted March 31, 2021 Related question - is there a message / variable set somewhere if a network resource call fails? I have built a few as well, and was now trying build some resiliency and alerting in if things fail - Steve
MrBill Posted March 31, 2021 Posted March 31, 2021 21 minutes ago, SteveT said: Related question - is there a message / variable set somewhere if a network resource call fails? I have built a few as well, and was now trying build some resiliency and alerting in if things fail - Steve There is not. I send important messages by multiple methods at this point. @Jimbo's node server called "Notification" doesn't have it yet, but someday it may retry when on fails. I'm also hoping that UDI Mobile will allow us to send push notifications, including critical notifications, without using a 3rd party service like we must now... no idea if that's in the roadmap tho and @Javi isn't yet taking feature requests, so we must wait and see how that evolves. 1
mango Posted April 1, 2021 Author Posted April 1, 2021 I could not work on this last night due to news of a further impending lock down here in Ontario Canada. I should be able to pick this up in the next few days, thanks again. 1
Javi Posted April 1, 2021 Posted April 1, 2021 21 hours ago, MrBill said: There is not. I send important messages by multiple methods at this point. @Jimbo's node server called "Notification" doesn't have it yet, but someday it may retry when on fails. I'm also hoping that UDI Mobile will allow us to send push notifications, including critical notifications, without using a 3rd party service like we must now... no idea if that's in the roadmap tho and @Javi isn't yet taking feature requests, so we must wait and see how that evolves. We are looking into push notifications for the UD Mobile apps, however it will be some time after our initial goals have been achieved. This would also require server side so notification triggers may, at least initially, require that the ISY is connected to the Portal. Being that connectivity is required, i'm not sure if it would help if a notification fails due to loss of portal/internet connection. Personally, all my network/home-automation equipment is on a battery backup and I use @Jimbo's Notification Node Server with Pushover and it has been more reliable/configurable than email/text notifications. Some routers, such as Nest Wifi, will notify the user when the router is offline which is also a great way to know if you will be missing notifications. A final note would be to add a timestamp to all notifications. When your mobile devices loses network connection, the device may be flooded with notifications when it is reconnected to a network. I have noticed that after regaining connection notifications may not be in the order they were sent. 2
MrBill Posted April 1, 2021 Posted April 1, 2021 1 hour ago, Javi said: We are looking into push notifications for the UD Mobile apps, however it will be some time after our initial goals have been achieved. This would also require server side so notification triggers may, at least initially, require that the ISY is connected to the Portal. Being that connectivity is required, i'm not sure if it would help if a notification fails due to loss of portal/internet connection. Personally, all my network/home-automation equipment is on a battery backup and I use @Jimbo's Notification Node Server with Pushover and it has been more reliable/configurable than email/text notifications. Some routers, such as Nest Wifi, will notify the user when the router is offline which is also a great way to know if you will be missing notifications. A final note would be to add a timestamp to all notifications. When your mobile devices loses network connection, the device may be flooded with notifications when it is reconnected to a network. I have noticed that after regaining connection notifications may not be in the order they were sent. I guess no world is perfect, I have a mix of ISY based NR and also use @Jimbo's Notification Node Server, most of the NR's came before the Notification Node Server, but I actually just created 10 new notifications as ISY NR's because It's easier to add one line to a program than the 3 or 4 it takes with the nodeserver. My biggest problem with all of the above tho is that neither the ISY nor the nodeserver do anything on fail, the message is just lost. It doesn't happen often, but it happens often enough that I'm aware of it but some notifications just vanish. I live in a rural where my only broadband option is brought to us by a gigantic cable company made with love in philadelphia and dropped packets and service drops in my RURAL area are a thing I deal with. I have a dual WAN router with LTE backup. The router notifies me when cable drops and it fails over to LTE, it notifies me when it falls back. If the ISY or the notification nodeserver either one try to fire a notification during the roughly 12 second failover (failback works cleaner) and doesn't get a "200 Ok" back...the notification is just dropped. Further, I just checked the router stats in the last 225 days I've averaged 28 dropped packets a day... most of the time the avg user would never notice a single dropped packet, at the worst they would just reload the page etc. but again when the dropped packet happens and its either the ISY or the notification nodeserver trying to send a notification it just poofs into the netherworld. To build a better mousetrap most of my notifications are sent via multiple methods, usually pushover and email, email is often sent to email and AT&T's SMS gateway because the AT&T is another weak link... the silly part is open the mailbox and I get 3 notifications if none are lost. Pushover isn't immune from occasional DOS attacks either, again it doesn't happen often but it does happen and I was aware they were getting DOS'd at least twice in the several years I've used the service. So the endgame is that I'm just really looking for ways to build more reliance into the system, no system is perfect... but then again when it comes to notifications the weakest link is something that the only thing I can do something about is send the notifications via multiple routes.... which is also why I'm aware of how often failure occurs. I always look for the root cause, from the ISY that hunt usually ends in finding a Timeout in the error log because it doesn't retry. In another forum thread I asked Jimbo if the notification node server retries on fail and he added it to the wish list. Oh and if you think I don't blame the cable giant, I do.... when it starts getting really bad I call and call, I pay for premium service and pay their option inside wiring maintenance even tho the problem is never there. Level 3 tells me my error rates are within tolerance for residential service, so my next question is can I get business service and an SLA? "I'm sorry sir, but that's not available at your address." 1 1
Javi Posted April 1, 2021 Posted April 1, 2021 31 minutes ago, MrBill said: Oh and if you think I don't blame the cable giant, I do.... when it starts getting really bad I call and call, I pay for premium service and pay their option inside wiring maintenance even tho the problem is never there. Level 3 tells me my error rates are within tolerance for residential service, so my next question is can I get business service and an SLA? "I'm sorry sir, but that's not available at your address." I've had our Public Works trucks (trash, recycling, ect) break our overhead internet lines in the alley a few times over the years. I call Centurylink and they tell me there lines are fine and that I need a new modem. When I finally convince them my eyesight is great and the line is physically broken they will come by and fix within a week. During the repair the line it is zip tied to a higher cable to prevent Public Works from breaking the line. Unfortunately the higher cable is property of Xcel Energy, eventually Xcel will come through and cut the zip tie, and the cycle continues.....Not to mention CenturyLink deciding the route the cable through a large evergreen during the last repair, so now everytime it snows I have to get a large pole and shake the branches above the cable to prevent it from breaking. Anyway, I'll see what we can do about resending messages that are missed when we are at that point. I think the Node Server approach may be needed for these situations as data persistence is needed in the event of power failure or restart. 1
Recommended Posts