# Hour Meter in Transaction Groups

**URL:** <https://forum.inductiveautomation.com/t/hour-meter-in-transaction-groups/87062>\
**Category:** Ignition\
**Created:** [March 8, 2024, 8:16pm UTC](https://forum.inductiveautomation.com/t/hour-meter-in-transaction-groups/87062 "2024-03-08T20:16:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dwayne\_Schwartz](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@Dwayne\_Schwartz](https://forum.inductiveautomation.com/u/Dwayne_Schwartz)\
**Post date:** [March 8, 2024, 8:16pm UTC](https://forum.inductiveautomation.com/t/hour-meter-in-transaction-groups/87062/1 "2024-03-08T20:16:05Z")

</div>

How do I set the hour meter to reset every night at midnight? I have it counting every minute a status is 1. Just want to reset that counter at midnight each evening.

---

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [March 8, 2024, 9:18pm UTC](https://forum.inductiveautomation.com/t/hour-meter-in-transaction-groups/87062/2 "2024-03-08T21:18:29Z")

</div>

The manual has some instructions on how to set it up to reset on a condition:

> **[Hour and Event Meters | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/ignition-modules/sql-bridge-transaction-groups/hour-and-event-meters#reset-an-hour-or-event-meter-based-on-a-condition)**
>
> Hour meter and Event meter refer to the Value Mode option settings on Tags in Transaction Groups. The Value mode drives values that are used to create values that determine how long a value was true. While the selected Value Mode for most...

You'll need to set up an expression tag that keeps track of the time until next midnight and add it to your transaction group:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/5/c532b302558313a71b50649ff62d97781a198399.png)  
The reason I have it add a day before getting midnight is that `midnight()` by itself will get you _last midnight_ (day starts at midnight, etc.)

Set up your hour meter item and choose "reset on condition" to reset whenever your seconds to midnight gets low enough (make sure the number is larger than your transaction group rate or you'll skip right past midnight without noticing):

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/2/a2ed0c537827300a2016846a16614efd70a052d1.png)

---

<div class="post-metadata">

**Author:** ![Dwayne\_Schwartz](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@Dwayne\_Schwartz](https://forum.inductiveautomation.com/u/Dwayne_Schwartz)\
**Post date:** [March 9, 2024, 5:29pm UTC](https://forum.inductiveautomation.com/t/hour-meter-in-transaction-groups/87062/3 "2024-03-09T17:29:33Z")

</div>

Perfect. Thank you!
