Electricity meters with HAN interface

Using the instructions in Norwegian on one of the links I provided before, I’m reading data from the meter on a Raspberry Pi. Now looking for ways how to integrate it with OpenEnergyMonitor, view data in Emoncms and if possible also communicate data locally to a PLC using Modbus TCP.

Hi Sven

How are you reading the meter on the Pi?
I have a similar set up. I get the data using MQTT so I have NodeRed on the pi subscribing and then posting to Emoncms using MQTT. It also enables me to format data before posting to Emoncms.

Hi Ian

The Pi presently runs the software, which you can read about in Norwegian on the first link I provided before. It gets the data from the meter through a USB interface, which I purchased on the web. As I understand, an alternative software written in Python is available on GitHub - Danielhiversen/AMSreader: AMS reader, which can use MQTT (but I have not tried that yet).

There is a related discussion in Norwegian on Lesing av HAN - The Easy Way (TM) - WIP - Strømsparing og strøm-overvåkning - Hjemmeautomasjon, which includes for example information about different attempts to use Python

As well as using MQTT to send the data to an emoncms system, another possibility is to post the data over HTTP using the Feed API. To see how to do that, go to the Feed List page of your emoncms system and near the top of the page towards the right hand side there is a link ‘Feed API Help’. Click on that for details and examples.

In Portugal we have smart meters with HAN ports. They are RJ12 providing 5v and RS485 with modbus.
Is this something similar to other countries in europe?

I’m designing a small device with wifi that plugs directly to the meter to sends data to emoncms, that may have usage on other countries.

As I understand it, RJ45 and RJ12 are used in Sweden and Norway. I live
in Sweden and in my area the Norwegian version is used. There is some
information about the protocols on https://hanporten.se/. At least in
some cases, Mbus is used.

Chaverio, if you would make your device so it ca be used here in
Sweden/Norway, I would be interested to hear.

ESPHome and HA have already done this - Energy Management in Home Assistant - Home Assistant

That’s interesting, thanks. Does any of it work in the UK to allow access to any data from a smart meter other than the flashing light data I can see from a dumb meter?

No, as the UK spec doesn’t include the RJ11/12/45 output socket.

On the prototype I’m using Tasmota with scripting that supports modbus (and other protocols) for interfacing smart meters.

I’ve just compared the pinouts and the Swedish uses P1 proprietary protocol. The Norwegian uses M-Bus and the Portuguese uses Modbus RTU over RS485.

How about other countries?

Portuguese (RJ12 RS485 Modbus)

Swedish (RJ12 P1)

Norwegian (RJ45 M-Bus)
Is power available on the other pins?

OK thanks. I suspected not. It seems a typical UK cock-up, at least from the consumers’ point of view.

1 Like

Indeed yes we get shafted again.

The only options in the UK seem to be.

  1. Use an API to access the 30 minute interval updated data from the DCC network - this is possible free of charge and should work with all energy providers
  2. Use an API to access the same data from your energy provider - not supported by all providers
  3. Get a CAD - Consumer Access Device which can do much more frequent updates. The CAD resides in your house and in theory should be accessible locally but none of the CAD devices available in the UK allow this and instead you have to access the data via the CAD makers API and the CAD makers cloud servers. Here there has been some progress. Originally you could not buy CAD devices as an end-user and then for a period there was literally just one product available, now there are - gasp! at least three available.

Really scraping the bottom of the barrel - there might be optical sensors available but most if not all cannot cope with reading the LCD display of smart meters, and finally an energy clamp to measure yourself electrical current draw.

Note: There is a US company making a CAD which does support local access but it is not approved for UK use and not fully compatible with SMETS2 and sadly the manufacturer is showing no interest in addressing UK market requirements. It would admittedly cost a fair amount to get UK certification. Without certification it cannot be paired to your HAN - Home Area Network.

Note: In the UK the HAN is a Zigbee wireless network used to link the smart electricity meter, the smart gas meter (if you have one), the IHD - In Home Display (the gadget shown in the adverts), and if you have one the CAD - Consumer Access Device. The HAN is locked down using a special energy standard - not the same as used by e.g. Zigbee smart light bulbs. Only approved devices can be connected to the HAN. There was originally some talk of home appliances also being linked directly to the HAN so they could be set to run at cheaper i.e. lower demand times of the day or be turned off automatically.

If the government had a clue (they don’t) they would require the CAD makers to allow local data access. This would be simple to implement the - CAD device already has a web interface as this is used to connect to your home WiFi so it can then upload the data over the Internet to the CAD makers cloud servers - just so you can then redownload the same data back to your computer. :angry:

Due to the fact that all UK CAD devices only allow access via their cloud servers - if the CAD maker goes bust or decides to charge you for access you are screwed. There have been several cases of smart home products being effectively killed when the maker either goes bust or shuts down the service. I know of at least two smart lighting brands which went bust resulting in all the smart light switches stopping functioning completely and having to be ripped out. This is one of the main advantages of HomeKit since the spec requires that HomeKit work purely locally with no-need for a cloud service. (Unfortunately Apple has done a terrible job marketing and expanding HomeKit.)

1 Like

This is no longer True. Glow have recently introduced an update to their CAD to enable local MQTT so you can get 10s data locally now.

But I agree the UK spec is FUBAR.

2 Likes

That sounds hopeful. Do you have a link please?

edit: I found Glow — Local MQTT. Here at last … free upgrade in version… | by Joshua Cooper | Medium Is there any emoncms integration yet? Do people actually have it working?

Will need a little Node Red to extract just the power/energy data.

Might be a job for an emonhub interfacer - @TrystanLea @glyn.hudson in the longer term.

I have one here but need my meters to reconnect properly before I switch it on and see the data format.

The other way would be to use HA or Telegraf to extract the power/energy elements of the JSON.

Ah, thanks. I’d probably hack one of the little perl scripts I use for interfacing everything else then. I’ll be interested to hear whether it all works well when you get it set up. Might be a reason to get a smart meter once the alt-HAN stuff is widely available.

Hi @nchaveiro , also here a user from Portugal.
I was investigating and this

seems the way out to read the Portuguese electricity distributor power meter HAN interface.
Or have you found a way out? If yes, can you share?
Thanks a lot.

Hi Nuno, for Portugal the puzzle is solved.
I’ve done my own ‘EDP box’ device that plugs on the meter and use a customized tasmota script to post directly via WIFI to emoncms. If interested i can share.

See the links :

Some photo of the HAN Wifi Modules I’ve assembled: