Does anyone have any examples of how to count and store the number of counts for a sensor. Say a contact sensor, motion sensor or water sensor.
I'd like to set up a water sensor on my sump pump and count the number of cycles every day and store that if possible. I'd like to use hubigraph with this if possible, but I'm unsure of how to count each time for a sensor trigger.
The simplest solution likely involves writing a Rule Machine rule (or two) along with a Hub Variable of type Number. RM can do simple variable arithmetic (e.g. "add 1"), triggered by your monitored sensor values throughout the day, and if you reset said variable to 0 at midnight, it becomes a daily counter.
Up to you to script these rules, as well as account for whatever reporting (Notification or Graphing) you want done in conjunction. For that purpose, may I recommend WebCoRE's built-in Graphing facility, which includes a LTS (long-term storage) Fuel Stream to record variable values for you over time.