Inverter power tracking (for heat pump)

I have just connected the newly installed pv inverter to the existing HA installation to gain some insights about its yield. While I’m planning to connect a heat pump for the domestic water, I’d like to get an idea how long during each day the inverter output power is continuously above a certain threshold. Any suggestions / ideas on how to best implement this with automation and / or scripting?

Thx
Andreas

Create a template binary sensor that is on when your power is above the threshold.

template:
  - binary_sensor:
      - name: "Power above threshold"
        state: >
          {{ states('sensor.power')|float(0) > 42 }}

Feed that to the history stats integration to record how long that sensor is on each day.

sensor:
  - platform: history_stats
    name: "Time above threshold today"
    entity_id: binary_sensor.power_above_threshold
    state: "on"
    type: time
    start: "{{ today_at() }}"
    end: "{{ now() }}"
1 Like

Thanks a lot for the suggestion. Unfortunately I saw it just now, while I didn’t receive a notification as expected. This looks pretty easy compared to the initial ideas coming to my mind to tackle this.