HomeAssistant energy management component

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?

Thanks!

@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.

2 Likes

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?

I’m researching this device - I have read it can provide real-time data, what is the update frequency of power available in Home Assistant? I want to view real-time power changes with at least a one second update interval - is that possible? If the Home Assistant integration doesn’t do one second updates, is there an output stream (json, mqtt, etc) available as I could write a script to read that stream and create a real-time sensor in HA. Thanks

There are currently 2 versions avail - the bundled HA version and the custom integration version. I’m sticking with Greg’s custom version as it automatically adds all Iotawatt’s sensors. You can get the step by step at link

1 Like

3 posts were split to a new topic: Corrupted Datalog

Question: How taxing is this integration on the IoTaWatt?

I was looking around trying to find how often it’s actually polling the IoTaWatt. Given that the IoTaWatt can’t sample while answering queries, I want to make sure to make sure it wasn’t doing anything too crazy.

I just started playing around with some smart switches and automations in Home Assistant and thought it would be fun to integrate my also new IoTaWatt with it. This custom integration works great and the values are very close to what the IoTaWatt itself is reporting in the Graph+ graphs. I’m not exactly sure were the differences come from, but it’s probably close enough. For instance, the Graph+ graph shows my total consumption for yesterday at 41.2 kWh while the Energy screen in HA is showing 41.31 kWh. Likewise, my HVAC usage shows as 9.34 kWh in Graph+ and 9.38 kWh in HA.

~Dan

What is the current recommendation for setup with the HA Core integration?

Do I need to create template integration sensors at outlined here or can I just use the wh sensors in Home Assistant?

It is trivial. The queries are less taxing than requests made by the status display every second. The actual queries are for a single time period and so take only a few milliseconds. If you want to know the impact on sampling, those metrics are displayed in the statistics section of the status display. The maximum sample rate possible is 40 cycles/second at 60HZ and 33.3 at 50Hz. The samples per cycle should never be effected.

I am not recommending the current HA integration. It was a pretty good idea when it was a HACS offering, but was edited hastily by the HA folks and is now difficult to use. They are just getting into the energy business and will probably discover and improve things as time goes on.

There is a development release of IoTaWatt that will support an updated HACS integration that should be super easy to use and very accurate. I expect it will be generally available in about a month.

There are still issues with HA energy in that it does not have an updatable time-series database, and so it can’t be a reliable place to go for any kind of analysis of historical usage, but it can be a pretty good real-time or daily dashboard if the communications link is reliable.

2 Likes

Have these updates been released?

The new “integrator” capability in IoTaWatt is in the latest release. It allows highly accurate tracking of energy import and export.

The situation has not changed with HASS however. It is still only reliable as a real-time dashboard as it has no capability to recover history after any lapses in communication or server reset. Moreover, the user who has taken over the HA IoTaWatt integration is unwilling to make recommended changes after modifying it for his own purposes.

So it’s fine as a real-time dashboard but I would recommend using the IoTaWatt Graph+ Or PVoutput for serious performance analysis.

This is unfortunate. I prefer Home Assistant as my main interface and bought IoTaWatt specifically after the Energy integration was releases.

Is there a public issue we can comment on? Its hard to follow exactly what the issue is.

Are there still plans to make a custom component that works better with IoTaWatt?

The main problem has nothing to do with IoTaWatt or any other data collection device regardless of how it is integrated. HASS energy component only allows adding real-time data, so if there is any lapse of communications or server availability (restarts, power fail), NO integration can provide it with the lost data. So historical data is only as good as the historical connection and uptime availability.

IoTaWatt has uploaders for three external time-series databases - influxDB, emoncms and PVoutput. Whenever there is any lapse in communications or server availability, it will send the missed data. Unfortunately that’s not possible with HASS as there is no way for an integration to provide anything but real-time data.

Issues with the current integration are secondary to that design flaw of HASS energy. They are user interface issues that make it somewhat more difficult to use, but do not restrict functionality.

You have the best tool available for sending energy data to HASS, it’s just that HASS Energy itself is very lightweight.

3 Likes

I see. Thanks for the detailed explanation.

Assuming I am using Home Assistant, is it better to use the wh, wh_accumulated sensors, or the watt sensor with integration being calculated on Home Assistant side?

EDIT: Nevermind… I see you updated the documentation with your recommended setup using the Integrators feature. Thank you!