fill HA Energy Dashboard without using WebAPI #60
Replies: 1 comment 1 reply
-
Yes. What happens if your Home Assistant instance crashes? During that time you won't have any records of any energy flow. And what happens when you can't access the local web interface of the senec battery for some time? You won't have any records from that duration either but usually they pop up on mein-senec.de. Further more you didn't specify the method. That defaults to trapezoidal. Meaning that if HA crashed while the source sensor was displaying 2kW and then HA is restarted the next day and the source sensor displays 0kW then the duration of HA not working will not just yield 0kWh. Trapezoidal means that there is a line drawn from the 2kW down to the 0kW and the area below that line is the integration and that can be 20kWh even if the sensor in reality dropped to 0kW right after the crash. Same happens the other way around: The source sensor shows 0kW then HA crashes and you restart it the next day and the sensor immediately updates and shows 2kW. That results in quite some kWh for that duration. I've got a power station from bluetti and that doesn't provide anything else than kW values for input and output. So I had no other choice than to use riemann integrals here. And I did the same mistake and used the trapezoidal method. And then I switched off the power station to move it. When I switched it on again, the sensors immediately jumped up and the trapezoidal method resulted in 18kWh that have supposedly been discharged while the power station was off and disconnected. That's why I've switched the method to "left" and hope that this helps a bit. But it can still result in wrong integration data. And that's why I prefer using the data from mein-senec.de because that data is updated right from the source. Even if the senec battery didn't have an internet connection for some time the offline data is still uploaded once the battery is online again. At least that is what I've been seeing here. So the question is if you really really want to have this local. If you do and can live with your integration sensors starting to differ after some time from what mein-senec.de says then there is nothing wrong with using them. Just maybe don't use the trapezoid method. |
Beta Was this translation helpful? Give feedback.
-
hi all,
I found a simple way using the HA Energy Dashboard by implementeing sensors using the Riemann sum function.
See my example taken from my configuration.yaml:
sensor:
source: sensor.senec_home_v3_hybrid_solar_generated_power
name: MyHome_PV_Energy_kWh
unique_id: myhome_PV_energy_kWh
unit_prefix: k
unit_time: h
round: 3
source: sensor.senec_home_v3_hybrid_battery_charge_power
name: MyHome_Battery_Charge_kWh
unique_id: myhome_battery_charge_kWh
unit_prefix: k
unit_time: h
round: 3
source: sensor.senec_home_v3_hybrid_battery_discharge_power
name: MyHome_Battery_Discharge_kWh
unique_id: myhome_battery_discharge_kWh
unit_prefix: k
unit_time: h
round: 3
source: sensor.senec_home_v3_hybrid_grid_exported_power
name: MyHome_Grid_Exported_kWh
unique_id: myhome_grid_exported_kWh
unit_prefix: k
unit_time: h
round: 3
source: sensor.senec_home_v3_hybrid_grid_state_power
name: MyHome_Grid_State_kWh
unique_id: myhome_grid_state_kWh
unit_prefix: k
unit_time: h
round: 3
It does create 5 energy (kWh) based sensors, which can be directly added to the HA Energy Dashboard.
So the WebAPI integration is not needed.
Is there any reason not to use this data but apply the WebAPI ?
Beta Was this translation helpful? Give feedback.
All reactions