How to record energy use based on entity state


I’ve been struggling with how to achieve separating out the energy usage recorded by air source heat pump between heating and domestic hot water production.

I am recording energy usage from the MCU with a Shelly EM and so capturing the total energy use by the heat pump.
The heat pump provides an entity to say whether it is heating (radiators and underfloor heating) or idle.

I have noticed it is recording energy usage whilst idle and the other available entities suggest this is for hot water.

So…, How would I go about creating two new entries ‘ASHP-heating’ and ‘ASHP-dhw’ that record energy usage based on whether the ‘ashp-status’ entity is in an idle state or not?

If it the status is idle, energy usage should be recorded under ‘ASHP-dhw’ if not then recorded under ‘ASHP-heating’.

If someone could give me a couple of clues I’d like to be able to help work this out!


Use a utility meter (monitoring the EM) with two tariffs. This will create two separate energy sensors.

Switch tariffs with an automation that triggers on your heating being active or idle.

1 Like

Genius! Works great. Thanks