Calculate energy based on other sensor value

Hi!

I have heat pump connected over modbus and MQTT. Heat pump energy is measured by Shelly EM3.

Heat pump is heating both - hot water and under floor heating. I have this information from the pump:
Screenshot 2022-10-17 at 10.46.08
Screenshot 2022-10-17 at 10.46.14

There are three values:

  1. “Heat” - floor heating
  2. “Hot Water” - hot water heating
  3. “Off” - heat pump is on idle. It still consumes about 95w of energy.

Now I have Shelly EM3 for measuring heat pump and here is the data:

What i try to achieve, is to have three separate energy sensors:

  1. Floor Heating Energy
  2. Hot Water Energy
  3. Idle Energy

Any good ideas hot to move on?

I think you can do this with the stock utility meter (Utility Meter - Home Assistant) integration, by having three “tariffs” (heating, hot_water, and idle) and an automation that calls the select.select_option service to switch between them as appropriate.

1 Like

Could you describe more in detail how to do this?

So what i did was:

Added utility meter witht three tariff options: heat, hot_water and idle

And automation:

alias: Heat Pump Utility Meter  Tariff Options
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.heat_pumo_prio
condition: []
action:
  - choose:
      - conditions:
          - condition: state
            entity_id: sensor.heat_pumo_prio
            state: Heat
        sequence:
          - service: select.select_option
            data:
              option: heat
            target:
              entity_id: select.heat_pump_daily_energy_tariffs
      - conditions:
          - condition: state
            entity_id: sensor.heat_pumo_prio
            state: Hot Water
        sequence:
          - service: select.select_option
            data:
              option: hot_water
            target:
              entity_id: select.heat_pump_daily_energy_tariffs
      - conditions:
          - condition: state
            entity_id: sensor.heat_pumo_prio
            state: "Off"
        sequence:
          - service: select.select_option
            target:
              entity_id: select.heat_pump_daily_energy_tariffs
            data:
              option: idle
mode: single

Everything works as excpected

1 Like