-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backport HA iotawatt integration changes #26
Conversation
Querying the iotawatt for accumulated energy of a power output sensor will typically return the wrong value due to how the calculations are performed. So rather than relying on the Iotawatt to perform those calculations we instead calculate the energy value locally by using the Riemann Sum Integration. The energy will be calculated after each read (performed every 30s) The generated sensor will have a name in the format: "IotaWatt Output Sensor Integral". One downside over the energy sensor (ending with .wh) is that the energy will not accumulate following a reboot and the data will be lost. This could be improved by querying the IotaWatt for the average power since it was last queried. Fixes gtdiehl#18
…ted by reading at regular intervals the energy value from the iotawatt. When declaring outputs relying on a mathematical expression (using other than + and - operator), the default energy sensors can't be used While the `integration` integration could be used, the advantage of those sensors is that they won't lose data if the connection to the iotawatt is lost or if rebooting the HA instance. In these cases, the sensor will fetch the data from when it last stop. This change requires iotawattpy 0.1.0 Fixes gtdiehl#18
fly-by change, re-organise method order to be more consistent with other modules.
… no loss of data across reboot.
…rom iotawatt to quickly populate the accumulated energy sensors rather than wait for an extra 30s
…ns. There can't be accuracy loss resulting from this operation, making it unnecessary to use fractionals.
So I have just updated HA to 2021.9.0 and am now using the 'built in' integration, but I have issues with sensors in the energy dashboard. The instructions on the HA page are not clear, or not working as expected. Can you explain what I need to do to have valid sensors for the energy dashboard? |
If you are using a net solar system and need import and export ; the current version in iotawatt can't work. Simply put the custom_components/iotawatt folder in the HA custom_components and restart HA |
It's a last minute change in HA that broke it: home-assistant/core#55554 This branch fixes it ; you just need to use the integration in custom_components for now. |
So Im not installing the 0.0.8 release, but a specific branch? How do I achieve this? |
If you want to get up and running right now, update the This is the example for the Home Assistant webpage
In the above example there are two sensors on the IoTaWatt, |
"WattHours": IotaWattSensorEntityDescription( | ||
"WattHours", | ||
native_unit_of_measurement=ENERGY_WATT_HOUR, | ||
device_class=DEVICE_CLASS_ENERGY, | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"WattHours": IotaWattSensorEntityDescription( | |
"WattHours", | |
native_unit_of_measurement=ENERGY_WATT_HOUR, | |
device_class=DEVICE_CLASS_ENERGY, | |
), | |
"WattHours": IotaWattSensorEntityDescription( | |
"WattHours", | |
native_unit_of_measurement=ENERGY_WATT_HOUR, | |
state_class=STATE_CLASS_TOTAL_INCREASING, | |
device_class=DEVICE_CLASS_ENERGY, | |
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The class is already set on the high resolution sensor.
this will only work with 2021.9 ; will approach this differently. |
This pull request is to be put on top of https://github.com/jyavenard/iotawatt_ha/tree/IntegrateLocally
It backports all the changes made into HA's official iotawatt integration and add the high resolution energy sensors.