Comments (4)
In the post that is linked it mentions this query does not work
http://iotawatt/query?select=[net.wh,grid_consumption.wh,grid_return.wh]&begin=d&end=s&group=all
Unfortunately changing the parameter of group
to auto
or some other value the IoTaWatt backend returns an array with multiple elements. Each element for the time period of the grouping from the beginning of the year. Currently, the API is written to expect an array with a single element.
This can not be resolved without a large code change. Would take some time to resolve this one.
from iotawatt_ha.
Querying a Wh Iotawatt output will not work for HA and the energy component.
I posted a way to work around that here:
https://community.home-assistant.io/t/custom-component-iotawatt-energy-monitor-integration/254110/91?u=jyavenard
The explanation on why you can't query Wh that needs to be calculated by summing the calculations is in the thread above.
from iotawatt_ha.
@jyavenard Would the only code change (probably on the IoTawatt Home Assistant integration code side) that would need to be made is to change the negative values to positive and use the Riemann sum
?
from iotawatt_ha.
@jyavenard Would the only code change (probably on the IoTawatt Home Assistant integration code side) that would need to be made is to change the negative values to positive and use the
Riemann sum
?
Everything else can be done in HA yes.
So if you simply want to integrate the result you would add the following integration sensor:
- platform: integration
source: sensor.iotawatt_output_export
name: energy_grid_export_wh
method: right
It is better to calculate the absolute value after the integration, but care should be taken to include the attributes required by the energy screen.
If you want to calculate the absolute value before the integration you need something like:
- platform: template
sensors:
power_grid_export:
friendly_name: "Grid Power Export"
unit_of_measurement: W
device_class: power
value_template: "{{ states('sensor.iotawatt_output_export')|float|abs }}"
attribute_templates:
last_updated: "{{ now() }}"
You then use the sensor.power_grid_export with the integration.
The attribute_templates is important, because HA by default doesn't call the entity's watchers if the value hasn't changed, and the integration needs to know of all values, not just when it changes.
Adding a last_updated
attribute gets around the problem.
I automated the process above and automatically create the integration sensor with this commit:
jyavenard@fca1f93
I believe it makes for more user friendly approach.
What I don't like with the pure integration approach is that if you lose connectivity with the iotawatt (which somehow happens rather regularly at my place), then no energy is recorded during that time.
from iotawatt_ha.
Related Issues (20)
- Need graphic/logo for IoTaWatt HOT 2
- Issues with wh for a particular "solar surplus" output
- Multi-IoTaWatt setup issue with identical inputs HOT 13
- Sensor isn't updated until a new different value is read HOT 2
- Sensor state isn't updated unless the value change. HOT 1
- Energy sensors created from an IotaWatt output can yield an incorrect result HOT 8
- Sensors based on output and returning frequency or power factor return 0 HOT 1
- Entering wrong credentials does not stop setup
- Remove last_reset attribute HOT 6
- All outputs are missing in 0.1.1 HOT 25
- Confused with current versioning, and HACS vs HA built-in. HOT 3
- Entity sensor.main_2_wh from integration iotawatt has state class total_increasing, but its state is not strictly increasing. HOT 1
- Can't find integration in HACS HOT 1
- Unexpected state class HOT 1
- Unremovable Duplicated Output Entities HOT 5
- Energy use - wh vs wh_accumulated?
- After creating aggregoators these are not being discovered/added to HA HOT 1
- Error starting integration since HA 2023.5 upgrade HOT 9
- Unable to prepare setup for platform iotawatt.sensor: Platform not found (cannot import name 'VOLT' from 'homeassistant.const' HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iotawatt_ha.