firstone Posted February 16, 2023 Posted February 16, 2023 I've seen some programs in another post that basically triggers 26 hours countdown on detecting heartbeat. If I understand it correctly, every day the program time counter would restart upon receiving a refreshed heartbeat. While it technically works, I 1. Cannot combine the same program for multiple devices. 2. Because it fails by timer rather than device, I cannot use variable substitution for notification. Thus, if I have 10 devices, I need 10 program and 10 separate notification. And if I get more creative with state variables, I need 10 variables. Does it seem like an overkill? Why wouldn't program just get triggered by state change? The Heartbeat node DOES get updated correctly (to no state from On). Why can't it trigger the program? What am I missing.
MrBill Posted February 16, 2023 Posted February 16, 2023 You're correct. I have many (20+) Insteon battery devices and have a heartbeat program for each. I also have a dedicated Network Resource to send the notification via pushover. I haven't kept up with the @Jimbo.Automates Notification Node Server. The PG3 version may have some help for the need to create multiple notifications. (I'm still using my 994 and PG2 for on my live system.. whenever eisy becomes stable I'll move on). I made an Excel tool for creating repetitive Network Resources for my heartbeat and wireless tag notifications where I need multiple Network resources that are almost alike, if anyone wants it send me a PM. Here is an example: Each battery device has 3 integer variables, all 3 are reset when the battery is changed. "missed" seems to be most relevant for surface mounted insteon open/close sensors, they tend to miss random heartbeats, but that doesn't mean they are dead. The example here is that type sensor, and it missed today, but the last time it missed was 12 days ago. The Heartbeat program I use is: hb.FrontDoor - [ID 0066][Parent 0072] If 'Door Switches / Front Door / Front Door- Heartbeat' is switched On Or 'Door Switches / Front Door / Front Door- Heartbeat' is switched Off Then Wait 24 hours $iDoor.FrontDoor.HBmissed += 1 $iDoor.FrontDoor.HBmissed Init To $iDoor.FrontDoor.HBmissed Wait 2 seconds Resource 'NotificationNS.DoorTrouble.FrontDoor' Run Program 'hb.FrontDoor' (Then Path) Else - No Actions - (To add one, press 'Action') For Insteon hidden open/close sensors I use 24 hours since the heart beat "wait", which is every 21 hours (or something like that), surface open/close and leak sensors I use 25 hours for the "wait". The 2 second wait is because there needs to be a brief wait after the counter is updated before the notification is sent or the old value will be sent. It loops by running itself as the last line.
firstone Posted February 17, 2023 Author Posted February 17, 2023 5 hours ago, MrBill said: You're correct. I have many (20+) Insteon battery devices and have a heartbeat program for each. I also have a dedicated Network Resource to send the notification via pushover. I haven't kept up with the @Jimbo.Automates Notification Node Server. The PG3 version may have some help for the need to create multiple notifications. (I'm still using my 994 and PG2 for on my live system.. whenever eisy becomes stable I'll move on). I made an Excel tool for creating repetitive Network Resources for my heartbeat and wireless tag notifications where I need multiple Network resources that are almost alike, if anyone wants it send me a PM. Here is an example: Thank you. As a programmer I find the idea of copying the same thing distasteful. I have this script working in HA with ISY devices perfectly well. Just list of devices and fires e-mail when state changes. I don't see why IoX cannot do the same.
brians Posted February 18, 2023 Posted February 18, 2023 You can have one custom notification containing ${sys.program.#.name} which the calling program will be displayed. Not exactly what you are asking, but this way can minimize the amount notifications, however the notifications would be more generic but if just using for simple notification of heartbeats then probably fine. For example, if program is named "Laundry Room Leak Sensor", you then have this customization.. It has been over 26 hours since ${sys.program.#.name} detected a heartbeat. Then have a bunch of programs named matching the sensor name and each call this program if heartbeat missed. Can you show your HA program so can see how HA does it. I sorta wish IoX had more general scripting option. I think if IoX programs not really as full programs, but little subroutines and store them in a folder which I think of more as the full program. But to do basic things it is awkward sometimes because of the event driven and non-reentrant nature of how programs execute. 1
joeria Posted February 26, 2023 Posted February 26, 2023 On 2/16/2023 at 10:40 PM, firstone said: Thank you. As a programmer I find the idea of copying the same thing distasteful. I have this script working in HA with ISY devices perfectly well. Just list of devices and fires e-mail when state changes. I don't see why IoX cannot do the same. On 2/16/2023 at 4:56 PM, MrBill said: You're correct. I have many (20+) Insteon battery devices and have a heartbeat program for each. I also have a dedicated Network Resource to send the notification via pushover. I haven't kept up with the @Jimbo.Automates Notification Node Server. The PG3 version may have some help for the need to create multiple notifications. (I'm still using my 994 and PG2 for on my live system.. whenever eisy becomes stable I'll move on). I made an Excel tool for creating repetitive Network Resources for my heartbeat and wireless tag notifications where I need multiple Network resources that are almost alike, if anyone wants it send me a PM. Here is an example: Each battery device has 3 integer variables, all 3 are reset when the battery is changed. "missed" seems to be most relevant for surface mounted insteon open/close sensors, they tend to miss random heartbeats, but that doesn't mean they are dead. The example here is that type sensor, and it missed today, but the last time it missed was 12 days ago. The Heartbeat program I use is: hb.FrontDoor - [ID 0066][Parent 0072] If 'Door Switches / Front Door / Front Door- Heartbeat' is switched On Or 'Door Switches / Front Door / Front Door- Heartbeat' is switched Off Then Wait 24 hours $iDoor.FrontDoor.HBmissed += 1 $iDoor.FrontDoor.HBmissed Init To $iDoor.FrontDoor.HBmissed Wait 2 seconds Resource 'NotificationNS.DoorTrouble.FrontDoor' Run Program 'hb.FrontDoor' (Then Path) Else - No Actions - (To add one, press 'Action') For Insteon hidden open/close sensors I use 24 hours since the heart beat "wait", which is every 21 hours (or something like that), surface open/close and leak sensors I use 25 hours for the "wait". The 2 second wait is because there needs to be a brief wait after the counter is updated before the notification is sent or the old value will be sent. It loops by running itself as the last line. Thanks, I have been running similar programs for quite some time but without the counter. Quick question, once the counter has incremented up, what resets it zero when the condition is corrected?
MrBill Posted March 8, 2023 Posted March 8, 2023 On 2/26/2023 at 11:38 AM, joeria said: Quick question, once the counter has incremented up, what resets it zero when the condition is corrected? I have a program for each transmitter, that is manually run from a Home Assistant dashboard: FrontDoor.reset - [ID 01A4][Parent 01B5] If - No Conditions - (To add one, press 'Schedule' or 'Condition') Then Resource 'NotificationNS.DoorTrouble._resetCountersBegin' Wait 1 second Resource 'NotificationNS.DoorTrouble.FrontDoor' Wait 2 seconds $iDoor.FrontDoor.HBmissed = 0 $iDoor.FrontDoor.HBmissed Init To $iDoor.FrontDoor.HBmissed $iDoor.FrontDoor.BatteryDays = 1 $iDoor.FrontDoor.BatteryDays Init To $iDoor.FrontDoor.BatteryDays $iDoor.FrontDoor.TransCount = 1 $iDoor.FrontDoor.TransCount Init To $iDoor.FrontDoor.TransCount Wait 2 seconds Resource 'NotificationNS.DoorTrouble.FrontDoor' Wait 1 second Resource 'NotificationNS.DoorTrouble._resetCountersComplete' Run Program 'hb.FrontDoor' (Then Path) Else Resource 'NotificationNS.DoorTrouble.FrontDoor' It spits out a message that the counter will be reset, then gives the old totals before resetting then resets and outputs the rest counters and another message. Seems like overkill on messages but it is nice to have the final counts before reset. 1
Recommended Posts