Home Assistant Integration

So I’ve had emonCMS for a few years. I’ve recently upgraded it to the latest Oct 19 16GB image and its running perfectly. I’ve also recently (last week) discovered Home Assistant!

I’m trying to work out the best way to integrate the two and I wanted to get some feedback. From what I can see I have three options:

  1. Use the emonCMS integration in Home Assistant.
  2. Get the emonHUB MQTT broker to push to the HA MQTT broker like all my Sonof Tasmota smart plugs do.
  3. Get the HA MQTT broker to subscribe to the emubHUB MQTT broker.

1 seems to be the obvious choice but I wanted to see what other people are doing? Are there advantages and disadvantages to each of the above?

I should add I am running HA on its own Raspberry PI 4 Model B separate to the emonCMS emonPI unit and I want to keep emonCMS logging its own data as well as publishing to or subscribing from HA.


Depends what you want in terms of data and what you are going to do with it.

This gives you access to all the emoncms Feeds

This gives you Raw data.

If you publish anything to MQTT from the emoncms input processing this is better than 2. Create a ‘bridge’ between the 2 Brokers.

1 is probably the best.

Great, thank you for your response. I’ve gone with 1 and it was simple to set-up and get working. I have all 4 sensor readings in Home Assistant now.

Thanks again.

1 Like

A screen shot of it running on my iPhone in home assistant.

1 Like

As I have just discovered HA in the last week and now have it running on a RPI4B and have an interest in energy consumption and we have PV I am very interested in this thread.

So my question is this. If I wanted to go with your option 1 (as you have done) what else would I need to purchase?

I also have another question about CT sensors. I already have them in place for the PV solution - can I had another pair for the HA monitoring solution or will that skew the results?
Great thread - thank you.

What do you currently have?

Fair question :slight_smile:

I have my ha setup on a dedicated RPI4B 8GB. If possible- apart from HA aintegration components - I would like to leave that “as is” even though it may mean buying another RPI. I may have a spare RPI3B but not sure if that works.

I also have 3 spare CT clips from a spare wattson we bought - I hope I’ve attached a photo of these bits!

The existing monitoring setup uses an optimerrsion panel with CT plugs connected to house and PV feeds. We need that capability left in place as it helps top up the immersion

Thanks for any guidance you can offer.

I also bought one of these which I believe is a 433 board for the RPI but I can’t for th3 life of me remember why!

And where does that data go?

The data feeds from the CT sensors go into the optinersion panel. The only option to take data out of that is via an sd card whixh can be put in the underneath.

Trouble is I don’t want to have to go to the faff of frequently removing and reinserting SD cards into the unit.

I think by that you mean “Can I use two c.t’s on the same wire or cable that are otherwise independent of each other?”
The answer is yes. There might be a tiny effect on the calibration of each - probably not measurable in normal use - but I wouldn’t expect any even slightly significant effect.

But is HA only monitoring, or does it/will it control anything? If it does or it will in the future, I would suggest that you carefully consider possible interaction between controlled loads, which might mean that the points at which the monitoring takes place need to be chosen very carefully. Otherwise, you might get into the situation where the two controllers are competing against each other, rather than working on a priority basis.

I can’t see any labelling on those split-core current transformers, so unless they say “xx : 50 mA”, “XX : 0.333 V”, or something like that, or you have some documentation, or you can measure their properties, it’s impossible to say whether they can be re-used.

You are right - I was talking about having the existing sensors and the “new homeassistant” sensors on the same cables.

The HA components will be monitoring only

Thank you (and everyone else who replied) for your input.

The emoncms component is only useful if you are running emoncms (or using emoncms.org) and that is only useful if you have a means of feeding data to emoncms.

It is indeed a RFM69Pi @433 MHz. You would use it to receive data coming by radio on the ISM band from either emonTx’s or emonTH’s.

I think we’re missing the big picture. What is it that you’re trying to achieve, and what equipment do you have that you haven’t yet mentioned. Bear in mind all we know is what’s written in this thread, because there isn’t much of a hint in what you wrote last July, other than you had then a “PV system they key parts of which are the panels, an optimmersion controller and a wattson monitor.” and from the photo above, it looks as if the Wattson monitor is not in service.

To summarise what I am trying to achieve

I want to be able to capture the mains energy being used by the house (in terms of electricity being taken from the grid) and the power being generated by the PV so that we can see at a glance the net consumption of power.

I want to be able to import this data into homeassistant and display graphically. This bit I can do - here is a simple display from homeassistant which I have running on an RPI so to summarise I need a mechanism for collecting the usage data and feeding into HA.

I believe the existing power monitoring platform (optimersion and wattson) are irrelevant to this new requirement as it will be left in place as it will just run in parallel

SO in terms of the homeassistant requirement all I believe I need is the way of importing the data presented by the CT monitor clips and capturing that in homeassistant.

At the time of writing my July Post I didn’t even know homeassistant existed which is why I started th3 new thread (this one)


Here is the sort of display I’m trying to create

That reads to me as if you need to gather the data first, so you want a complete OEM system to measure voltage and currents relating to your grid and PV infeeds, process the numbers and supply the data to Home Assistant. You will be ignoring your existing optimersion and wattson.

Noting three c.t’s in the earlier photo, is yours a normal domestic UK single phase supply, or is it three-phase? Do you have a single PV installation or is it several and you want detailed information from each part, and is your inverter(s) capable of exporting data that you’re able to interpret (i.e. can the inverter tell you what its output is or do you need to measure it)?

Thank you. Let me try and answer each question.

Yup - it’s isingle phase UK supply. I only provided the picture of the 3 CTs because I was asked what bits I had. I have those spare because we had to purchase a wattson to replace a faulty unit.

Yes I want to gather the data first and then incorporate it into a HA dashboard.



In that case, and on the assumption that you have a single PV infeed to measure, and it feeds in near your meter/consumer unit¹, I think you need an emonPi with 2 c.t’s and one a.c. adapter, plus its 5 V USB power supply. If you have a spare RPi, you might consider the emonPi Shield kit and enclosure kit Energy Monitors - Energy Monitor Components & Kits - Shop | OpenEnergyMonitor rather than a complete assembled emonPi, or with the other bits as the Solar bundle if you wish.

¹ Meaning there’s a double socket outlet near where you can locate the emonPi; and the c.t. cables will reach, or you can and are willing to extend the c.t. cables.

If the PV feeds into your final ring sub-circuit at a remote point, then it won’t be as simple as this.

Once you’ve got the data, it’s over to Brian to tell you how to get it out of this Pi and into the one running Home Assistant (he usually recommends a separate Pi for each task).

1 Like

That makes perfect sense - thank you.