How do I use a template sensor to count # of people taking shower today?

Hello Folks.
I have 2 humidity sensors in my 2 bathrooms, and looking at the graph, figured everyone probably could tell that I have 4 people taking showers each day.

I know a template would be needed, to count the # of people have been in shower for the day… and if possible I’d like the counter to reset at, say, 1am each day.

How do I approach this? Where do I start?

Do I make two template binary sensors off the two humidity sensors, to know when “someone” is showering at the moment, and then make another template sensor to count (how?) the # of times the two template binary sensors being on ? How do I reset the counter? Do I need automation and/or script to achieve the whole thing? Or can it be done in some elegant way, where I would only need to make one template sensor (vs 3, plus automation, etc.) in a self-contained fashion - no external automation nor script needed?

There are a bunch of ways to accomplish this…

Make a template binary sensor off the two humidity sensors, to know when “someone” is showering; then use a History Stats sensor to count the “on” states. Concurrent showers in the two room might be an issue…

Or, you could use a combination of template binary sensors and a trigger-based template sensor.

template:
  - binary_sensor:
      - name: Shower active Bathroom 1
        state: "{{ states('sensor.bathroom_1_humidty')|float(0) > 65 }}"
        delay_off: "00:05:00"
      - name: Shower active Bathroom 2
        state: "{{ states('sensor.bathroom_2_humidty')|float(0) > 65 }}"
        delay_off: "00:05:00"

  - triggers:
      - trigger: state
        to: 'on'
        from: 'off'
        entity_id:
          - binary_sensor.shower_active_bathroom_1
          - binary_sensor.shower_active_bathroom_2
      - id: reset
        trigger: time
        at: "00:00:01"
    sensor:
      - name: Daily Shower count
        state: |
          {% set current = (this.state or 0)|int(0) %}
          {{ 0 if trigger.id == 'reset' else current + 1 }}

Alternatives to consider:

MeasureIt custom integration

Maybe Wash Data could be leveraged to handle it…? That’s probably overkill, but it might make it easier to get an accurate count of concurrent showers.

Sweet! Looks like we do have multiple ways to do it. I am going to look into the trigger-based template sensor.