HomeAssistant energy management component

Hey guys - i think this is on topic, if not let me know and I’ll create a new post.
I’m new to IotaWatt and Home assistant and I’m trying to integrate into the HA Energy but for the life of me can’t work out how to get get IotaWatt as a energy source. I’ve followed what i can with the instructions. It would be amazing if anyone could provide instructions in simple terms to get it working.

Screen Shot 2021-09-08 at 6.13.40 pm

1 Like

I think there is an error in the yaml integral sensors. It should be sensor: instead of sensor ioatawatt:.

It looks like the error is in the instructions. I have submitted a request to fix the error.
HA Pull request

Unfortunately that didn’t help although this code from another thread did once I edited the sensor to match the name of mine. I’m guessing the name needs “wh” in it possibly?

It might have had more to do with the names having imbedded spaces.

I updated and quickly looked at adding these sensors in. It seems like the integration for HA is incorrectly using Wh instead of kWh. Which means it just gets ignored and not shown as a option for the energy meter. There isn’t really a good reason the energy system can’t handle Wh and do a little dividing to get kWh.
Given that Watts are already directly imported, should the integration be changed to pull in the data from iotawatt as kWh?

That’s not why you are having these problems. The Official HA integration enforces some rules that are inappropriate for IotaWatt outputs.

There’s a HACS version in the works that should make all of this work more intuitively. .

Interesting. This isn’t anything I urgently need. Is the longer term plan to have the official integration be the one to use or HACS? I can wait a bit to enable the integration if that is the long term plan. I’ve had to migrate other things from HACS to standard integrations and it can be painful.
On a side note, it seems so dumb they’ve setup HA in such a way that updating seemingly small things like integrations forces releasing an entire update for the whole thing. I have been hoping HACS, but better/easier to use, will be the way you install integrations. More like a plugin. For example, there was a long string of time where my Chamberlin MyQ garage door kept getting broken due to API changes. So HA was releasing entire new releases just for that fix.

I’m not going to get into how HA runs their business. I’m just looking out for IoTaWatt users and what I think serves them best.


Fair enough.
Do you view the longer term path to be the HACS implementation or the built-in integration?

I’d like to understand this also. I’ve been holding off on upgrading any of my IotaWatt<->HA integration components as it seems like the path forward is somewhat in a state of flux. It would be great to get some info from the guys who have been working on this as to what the best long term strategy is going to look like. Obviously things change, but its difficult from a user perspective to know what to do right now.

Thanks to everyone involved in this so far. Looking so forward to this integration getting settled down as both projects are awesome!

Not going to get into everything that is going on, except to say that we are going to fix this using some changes to IoTaWatt and what is anticipated to be a HACS integration. I’m disappointed that Hass decided to release something that I objected to and its reflecting badly on IoTaWatt. They have their reasons I suppose.

What I currently have in development works well with the original 0.0.6 @gregtd HACS integration. I hope to have that out in ALPHA in a few weeks. There is another user that has improved on that and has committed to doing the work on a HACS version that will optimize the new feature in IoTaWatt.

Rules in HA make submitting that version for release impossible. I don’t want to get into a discussion on this. Design by committee is overrated. Comments will be welcome when the new effort is released.

1 Like

Sounds good. I’ll hold off as the dust settles some.

We appreciate your work on this and the product as a whole! FWIW my Iotawatt is one of those devices that I plugged in and setup, then just forgot about. As it quietly just does it’s job. No painful maintenance, no manual reboots. It just works!

I’m hopeful that as the HA stuff matures that could be a great long term win. Having HA be the center of data collection and display makes a lot of sense and should be easier for users to setup and maintain. It lines up well with my preferred approach of having a solid, dedicated device like Iotawatt or Hue hub doing the core of the real work and HA as the thing that can tie lots of things together.

As @overeasy mentioned, I as well I don’t want to go into details that are in the past. I can speak to the current state of affairs.

We currently have two main release streams for the IoTaWatt integration. Which I hope at some point will be dropped to only include the HA bundled integration.

HA 2021.9.0 is bundled with an IoTaWatt integration but for the sensors to appear in the Energy Dashboard you have to create entries in the configuration.yaml file for each sensor you want to have appear in the Dashboard. As well to if you are monitoring solar on an Input on the IoTaWatt that is doing both import and export you have to create Outputs, splitting the Outputs from the IoTaWatt web interface is required using either version of the integration.

The custom_component IoTaWatt integration available through HACS is available with the 0.2.1 being the latest release. This has a similar code base as the bundled HA integration but the main difference is you do not need to manually add an entry in the configuration.yaml for the sensor to appear in the Energy Dashboard. Another change, is the addition of the Accumulated sensor that has a more accurate Wh reading based on how we query the IoTAwWatt, this is thanks to @jyavenard hard work! There are other smaller changes but those are this biggest ones.

As I mentioned I hope that the bundled HA IoTaWatt integration will at some point be the only version, so for now as code gets changed in either integration PRs will be opened and code merged. But as @overeasy pointed to on the HA side it is a committee and some changes do not get approved :disappointed:. Which means the custom_component will have what I guess I would term our vision of what the integration should support and do.

1 Like

@gregtd, @jyavenard , and @overeasy - Thank you all for working on this integration with Home Assistant. Your efforts are much apprciated!

Quick question about the 0.2.1 HACS integration - Am I correct to assume that when configuring the HA Energy feature, that the “Accumulated” sensors are the ones to choose? This makes the most sense to me, but I just wanted to double check.

Also, does the 0.2.1 HACS version support multiple IoTaWatt devices? Can I simply add a second IoTaWatt integration for a second IoTaWatt device?


@ogiewon The accumulated sensor would be the one to choose. Depending on your Output calculation on the IoTaWatt the .wh and the Accumulated sensor could be the same or off. I would say to error on the side of caution and use the accumulated sensor.

As far as supporting multiple devices it should. I personally haven’t tested it, but early on during coding a person did discover two IoTaWatts and the only issue was the Voltage sensor for the second not appearing. That was fixed.

1 Like

@gregtd - thank you for the quick response. I appreciate it.

All of my Outputs are configured to simply output Watts, not Wh, and no solar. So, the accumulated sensors it is! :slight_smile:

The accumulated sensor in @jyavenard 's version is a valient attempt to overcome an inherent deficiency in Energy. It is a real-time dashboard, not a time-series database. There is no provision for providing lost data after any sort of outage. The new feature in IoTaWatt will maintain the running import and export totals so that after an outage, at least the daily totals will be correct. The integration does it’s best to get data for short outages, but in the end is limited by the fact that it’s working from net data that gets less and less accurate as an outage duration increases. I should note that this situation is not unique to IoTaWatt. It is a characteristic of Energy.

I am using 0.0.6 with multiple devices.


For iotawatt inputs or outputs that are just defined as just the addition of another you can use the .wh just fine, the results will be the same.

If your outputs are using min/max or other operators you just use the « accumulated » ones

That’s incorrect. The accumulated sensors will remain accurate even after an outage. When connection resume, the integration fetches the missing data since the last successful query.

I’m just barely dipping my toe into home assistant integrations and just recently got my Iotawatt up and running. I’ve not been successful with EMONCMS yet, but I’m working on that. Are there tutorials or guides out there someone can recommend to get HA and Iota talking to each other from a newbies perspective?