How to display a counter value back on the HA front end

Hi all

Just playing with the first of my many ideas. I am monitoring a house pressure pump and as a part of that I have a counter increment each time it starts

At the moment I havent worried too much about a front end and using the stock one with HA. It has the normal info circles at the top with various bits of info.

How can I display the counter value in one of those circles?

And secondly I need to create a trigger that occurs as soon after midnight as possible. I program in Pascal extensively and usually record a timestamp of the time at midnight for a date and then just keep checking it each few seconds against the current timestamp. When the current time is greater than the recordered timestamp by atleast 86400 we are in a new day.
Is there an easier way ordo it that way

Once you create the counter in HA it should automatically create a counter.xxx entity_id and if you haven’t done anything at all with your frontend then that counter should already be displayed there. I think… I don’t have any counters so I assume they work the same way as all the other entities in HA do. If for some reason they don’t then you can just put the counter entity in a group and display that group on the frontend.

As to the trigger at midnight then you can create a time_date sensor then use that state (00:00:00) as the trigger in your automation.

Thanks finity.

I am ever the pesimist and as a breakdown electrician have spent all my life working on stuff that “will never break” so normally in my software I dont hardcode like an alarm in as if the software etc is offline at in this case midnight, it misses the event :slight_smile:

Yep thats me. Its usually offline as I am tinkering.

But I did manage to use a function to get the date (as in the day of the month) and compare it against the day for the current time. If they differ then its a new day be it 1 second after midnight or if I have been tinkering its 3 am. It then writes the day value back to a file and wont do it again till tomorow.

Will try the counter now.

Me too. The good news is that we will always have job security because stuff ALWAYS breaks!