Creating a Simple Counter using a Super Tile

Total “Newbie” here trying to create a simple toilet flush counter that resets daily using a Super Tile to see on a dashboard populated from my Hubitat environment. I’m using a vibration sensor affixed to the flush handle as the event trigger; clueless as to what to do next in setting up an appropriate variable (& rule) whereby the counter increments after each flush gets displayed, then the counter gets reset at midnight & ready for the next day’s events to trigger.

Any and all advice/code examples would be graciously accepted.

Totally doable. I have a counter that counts the number of times a motion sensor was triggered on my porch. Its all set-up on Hubitat using a basic rule and a variable.
On sharptools you add a regular thing tile, Hero layout, edit tile to use you variable counter attribute.
I didn’t use super tile to make this one, but you could if you wanted to add more attributes
image

Could you share a screenshot of the Hubitat rule you refer to/created?
Does that same rule allow for an automatic daily reset (i.e: based upon a specific time such as midnight?)

Go to Hubitat Settings / Hub Variables. Create a variable, mine is called PorchMotionCount. Make it a ‘variable’

Now click on ‘variable’ of the variable on Hub Variables page, Name the device, Save. This will be the connector device name used use on sharptools and will show up on hubitat device list

Go to Hubitat Apps/ Rule machine. Create rule if the “sensor” is tripped add 1 to your variable

Then Hubitat Apps / Sharptools. Add this new device and save.
Then Sharptool dashboard / edit / add thing / add device / Hero layout / edit, assign the variable as the attribute. Done.

Edit: 3:53pst 3/822

1 Like

Here the Hubitat App / Rule Machine details:

You could add another rule to reset the variable to Zero at a specific time if needed.

1 Like

Thanks so much for your input - so far so good from what you’ve provided.
I am stuck on getting the counter to reset for the next day i.e: at midnight. Thoughts/rule suggestions welcomed. I sure am a variable novice :face_with_diagonal_mouth:

Just make a new Rule like this so this counter uses 2 rules, one to add and one to reset at a certain time
image