DaveL17 wrote:I'm also considering some additional python code to track the number of pump cycles per day but haven't gotten around to that yet.
I couldn't figure out the code, so I used triggers and schedules. Not for a pump, I use it to track internet stability. Between urban sprawl and COVID, my internet is up/down like a yo-yo.
I use a running timer for network uptime and another running timer for network downtime. Those provide the total up and down times by today, yesterday, last week, last month, this week, this month, this year (and a few other data points I don't use).
I wanted a pulse counter to track # of down times, not just duration totals. So, whenever my network goes down, DowntimeTodayVariable +1. DowntimeThisWeek +1, DowntimeThisMonth +1, and DowntimeThisYear +1
The next part is schedules.
Nightly at midnight. Set DowntimeYesterday to DowntimeToday. Set DowntimeToday to 0.
Weekly at midnight. Set DowntimeLastWeek to DowntimeThisWeek. Set DowtimeThisWeek to 0.
Monthly on the 1st. Set DowntimeLastMonth to DowntimeThisMonth. Set DowntimeThisMonth to 0.
Jan1. Set DowntimeLastYear to DowntimeLastMonth. Set DowntimeThisYear to 0.
Iv'e only been doing this for about 1-1/2 months and yes, my internet has been down for over 17 hours and 136 times during that period. Like I said, a total yo-yo.
Now, before you do what I did....
https://forums.indigodomo.com/viewtopic.php?f=333&t=23842 howartp is working on a Pulse Counting plugin.