Tag Archives: Home Assistant

Recording your Energy Meters with Home Assistant

Introduction

This post is about how setup Home Assistent to gain a greater understanding of how you use the energy in your home. These instruction are for if you only have is a regular electricity meter, without having additional power monitoring installed. (Installing additonal power monitoring typically requires the services and costs of an electrician.) It is possible to manually record your daily power usage from your meter and enter it into Home Assistant.

NOTE: It is possible to use just an ‘input_number’ to get the data and display it on the screen in Home Assistant, and display it in graphs etc. Unfortunately, this data is only currently maintained for 10 days and is then dropped. Using a ‘sensor’ template will treat this data like a regular sensor.

Also

  • If automated monitoring is available later then this setup can be used to give you even more insight (with minimal changes);
  • Individual device monitoring can be added though the use of relatively inexpensive ‘Smart Plugs’ which both allow remote switching control of appliances, and individual appliance energy monitoring.

The following instructions assume that you have an operational ‘Home Assistant’ system (it is very easy to obtain, install and configure if you don’t), and are able to make use of the ‘Energy’ dashboard. Some familiarity with Home Assistant is also assumed. (Home Assistant is availble as a downloadeble system image for the RaspberryPi, as well as fully installed system in the Home Assistant Green).

Note: As this meter reading process is a manual version workaround of an eventual automated system, the time of the input of the reading into Home Assistant is taken as the time of the meter value. This needs to be kept in mind, as this timestamp is used to calculate daily usage etc. so it isn’t possible to record a set of readings and then input them at a later date. It is best to enter them into Home Assistant as soon as possible.

Daily Meter Readings

While Home Assistant is designed to be used with an automated meter reading system, it is still possible to get data and make useful observation with daily meter readings. The following describes how to set this up. The final result will be a meter reading dashboard with data entry fields, and a energy dashboard that can display the energy usage of the household over an extended period, say a month or a quarter.

The process is then:

Manual meter reading
--> Data entry into Home Assistant
--> Display household energy usage.

The example installation that this article uses is a household with a bi-directional electricity meter (records and displays power import and export separately), with solar panels and an inverter with an energy production meter.All of these are displayed in kWh.

It is possible to use the same method to add addition meter readings, and the example shows that this has also been done to record the gas meter reading and daily egg production.

Note: Using the ‘total’ meter reading, rather than a ‘daily’ value, ensures that
possible errors caused by the meter reading process are minimised. Any error in
a reading will be ‘fixed’ by a correct subsequent reading.

These instructions are for Home Assistant – 2024.7.1. As Home Assistant is under active development, this may change.

Getting Started

Home Assistant will need several entitles configured for each meter being recorded.

The first meter that we will consider is for electricity from the grid, which we will call “home_electricity_import”. Additional meters to consider will be “home_electricity_export” (excess energy sent back to the grid), “home_electricity_solar” (energy produced by the PV system), “home_gas_import” (gas meter readings) and “home_product_eggs” (how productive have my chickens been) and are added in exactly the same way.

We create an ‘input_number’ entity for recording the meter reading, and then create a ‘sensor’ entiry (via a helper/template) which makes the reading available to the rest of the system as a sensor.

Add a ‘input_number’ entity

Create an ‘input_number’ entity for entering the meter reading with the following. From:

Settings 
-> Devices and Services
-> Helpers (top menu)
-> CREATE HELPER
-> Number

then press ‘Create’

The entity that is created has the full name of “input_number.home_electricity_import”.

After the entity has been created, the details can be edited by selecting from the entity screen in “Devices and Services” and clicking on the ‘configuration’ (cog) button.

In addition to the above parameters, this screen allows you to allocate the entity to an Area, or allow integration with voice assistants, amongst other things.

The meter reading can updated in Home Assistant by entering the new value in the field displayed when the entity is selected. The time of the input is used as the time of the reading.

(Setting up a dashboard to allow data entry will be described shortly.)

Add a ‘sensor’ entity based on the meter reading

We now need to create an entity with uses the value from the meter reading, and can be used in the Energy dashboard.

Similarly to the last step, we wantot create a ‘templete’ sensor from the helper
menu.

Settings
-> Devices and Services
-> Helpers (top menu)
-> CREATE HELPER
-> Template
-> Template a sensor

then press ‘Submit’

The entity that is create has the full name of “sensor:home_electricity_import” and should have automatically picked up the value of the meter reading.

The icon for the entity is automatically picked up from the ‘device class’ but can be changed in the entities ‘configuration’ screen.

Add entities to a dashboard

Before we attempt to setup the built-in Energy dashboard, we can check that everything is working as expected by usung two entity cards, one to display the ‘input_number’ and one to display the associated ‘sensor’ entity that we have just created.

  • input_number.home_electricity_import
  • sensor.home_electricity_import

Note: The card for the ‘input_number’ should display a data entry field, where
you can enter the current meter reading. When you do this, the ‘sensor’ card
should automatically change to reflect the new value entered.

Repeat for more meter readings

In the previous setup, whereever ‘home_electricity_import’ is used, replace this
with the name of new meter to be configured, and repeat the steps.

Energy Dashboard

With the meter readings now being recorded, it is possible to import the data into the Energy Dashboard.

To configure

Menu: Energy 
-> … (top right menu)
-> Energy Configuration

Then

Electricity grid -> ADD CONSUMPTION

then press ‘Save’

Note: It is possible to create entities to track the existing energy price
“home_energy_import_price” in AUD/kWh. This is left as an exercise for the
reader.

If the other meter reading entities have been created, then they can also be
added in a similar way,

Electricity grid -> ADD RETURN
Solar panels -> ADD SOLAR PRODUCTION
Gas consumption -> ADD GAS SOURCE

Note: The gas meter reading for my meter measures the gas in m^3. The bill is
charged by kJ. Your gas bill should show the factor that is used by the gas
company to make the conversion from volume (m^3) to energy (kJ).

The energy dashboard should now start recording your energy usage. It will take
a while (possibly up to an hour) to register a new meter reading each day, but after a while you will now be able to see you energy usage and generation broken down by day, month etc.

Note: There is nothing stopping you recording meter reading more often than
daily. It may be interesting and worthwhile doing a day of hourly readings to
determine where the daily peak periods are.

Energy use of individual appliances

The energy dashboard also allows monitoring data for individual devices to be
added to the display. I use the Athom Smart Switch v2 ESPHome (there is also a new version based on the ESP32-C3). These Smart Plugs, once connected to your Wifi network, are automatically detected by Home Assistant what can then monitor and control these devices.

Automating the Manual Meter Reading

It the reading of the meter can be automated and fed into Home Assistant then
manual meter reading will no longer be required, and the reading can also be done much more often.

Once the data is being read into Home Assistant, via a meter reading
sensor entity, the template sensor we created can be modified to use this new sensor instead of the ‘input_number’ entity.

Note: Some finessing may be required to match the new meter reading with the old
ones eg. by adding or subtracting a fixed ‘offset’ amount.

Digression (and Rant) about Automated Meter Reading in Australia

<rant>

For many of the electricity smart meters around the world, there are Home
Assistant integrations which allow their data to be read automatically, possibly
as often as every 10 seconds. These were originally designed for in-home energy displays, and some countries even mandated a standard for this (eg. the P1 port on the Netherlands)

In Australia, unfortunately, the smart meters that are being installed in the
National Electricity Market(NEM) do not come with this feature. For electricity
customers, AEMO (the market operator) is relying on the Energy Retails to supply
this information to their customers, but this customer data is typically only
made available the next day after the ‘market settles’ (typically 24 hours
later).

One solution is for individuals to install their own energy monitoring meter,
inline and behind their electricity providers meter. This allows a home owner to
capture the data that they need, but comes with its own issues.

  • the installation requires an electrician;
  • the meter readings may not agree with the existing meter, and would not be
    accepted by the energy supplier in a dispute;
  • it isn’t (easily) possible this way to take the monitoing wigh tyou if you move house;
  • it would a difficult option for a rental tenant;
  • it adds another point of failure into the home network

In Australia there is also a commercial market with product lines dedicated to providing this missing functionality. A lot of these products also put your data into the cloud, which can then be used by the collecing service to sell to other businesses.

Your power usage should be made available to you as you use it, and not 24 hours after the event, and this should be available to all consumers by default.

All electricity customers are currently paying for smart meters in their electricity bills as there is a smart meter allowance included in the “default market offer” (DMO) which is used by the energy retailers for creating that energy plans on th eNEM.

Changing this for consumers does not appear to be a priority for anyone involved
in the industry.

</rant>

Update: It appears as though there are particular models of Smart Meter being used in Victoria that has a Zigbee based “In Home Display” that can provide this functionality.