-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
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
Powerwall integration accumulation wrong for site counters #102042
Comments
Hey there @bdraco, @jrester, @daniel-simpson, mind taking a look at this issue as it has been labeled with an integration ( Code owner commandsCode owners of
(message by CodeOwnersMention) powerwall documentation |
Could this be related to what I'm seeing incorrectly calculated in my peak time consumption sensor? I've outlined the issue here in the forums. https://community.home-assistant.io/t/tesla-powerwall-incorrectly-calculating-daily-energy-import-during-peak-times-as-of-oct-13-2023/629212 I've enabled debug logging, but I'm not sure what else I would need to gather here. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
This is not a stale issue. The Tesla Powerwall sensor is incorrectly reporting consumption of energy that does not match the actual Tesla app. Please advise on what else should be gathered to help here. |
@ziptbm thanks for your extensive writeup. Something that would be interesting to know is the software version of your powerwall. |
Visiting the direct IP of my powerwalls shows customer version as 23.28.2 27626f98. I'm seeing peak generation daily reported from this sensor in HA, but the Tesla app shows 0 actual consumption from the grid during that time. Please let me know if I can check anything else. Thanks! |
I seem to be having the same or similar issue. Data is getting messed up in comparison to what the Tesla app and my energy provider are showing. See my post here: https://community.home-assistant.io/t/using-tesla-powerwall-data-on-the-ha-energy-dashboard/333357/30?u=shanelord |
Just want to chime in here, that this issue affects me too. Im pretty sure this is affecting everyone who had tried to use these sensors. I had create my own integration and utility_meter sensors to depend on. |
@mkanet would you mind sharing the yaml for what is working for you? |
@ziptbm sure. Presuming your Tesla Powerwall Integration source sensor names are: Ultimately, you will be able to use the The above utility_meter sensors rely on the below respective I have also included some other sensors below that take advantage the sensors above. You can then finally have accurate NOTE: I also included one 1 bonus sensor called: I am not sure if these broken sensors can be fixed in the Tesla Powerwall Integration or the Powerwall API itself. I'm guessing if this issue is in the API itself, it would require a fix in the Powerwall firmware. template:
- sensor:
#Put your Tesla Powerwall Integration source sensors here:
- name: APF Grid Entity
device_class: power
state_class: measurement
unit_of_measurement: W
state: "{{ (0 - states('sensor.powerwall_site_power')|float(0)*1000)|int(0) }}"
- name: APF House Entity
device_class: power
state_class: measurement
unit_of_measurement: W
state: "{{ (states('sensor.powerwall_load_power')|float(0)*1000)|int(0) }}"
- name: APF Generation Entity
device_class: power
state_class: measurement
unit_of_measurement: W
state: "{{ (states('sensor.powerwall_solar_power')|float(0)*1000)|int(0) }}"
- name: APF Battery Entity
device_class: power
state_class: measurement
unit_of_measurement: W
state: "{{ (0 - states('sensor.powerwall_battery_power')|float(0)*1000)|int(0) }}"
- name: APF Grid Import
device_class: power
state_class: measurement
unit_of_measurement: W
state: >
{% if states('sensor.apf_grid_entity')|int(default=0) < 0 %}
{{ states('sensor.apf_grid_entity')|int(default=0)|abs }}
{% else %}
0
{% endif %}
#Use this sensor instead of `sensor.powerwall_charge` to get a more accurate value (closer to Tesla app battery charge value)
- name: Powerwall Charge Actual
unique_id: powerwall_charge_actual
state_class: measurement
unit_of_measurement: '%'
device_class: battery
state: "{{ '%.0f' | format(((states('sensor.powerwall_charge') | float(0) / 100.0) - 0.05) / 0.95 * 100) }}"
- name: "Daily Solar Energy Consumed Percentage"
unit_of_measurement: '%'
state: >
{% set solar = states('sensor.daily_solar_energy_consumed')|float %}
{% set battery = states('sensor.daily_battery_energy_consumed')|float %}
{% set grid = states('sensor.daily_grid_energy_consumed')|float %}
{% set total = solar + battery + grid %}
{{ ((solar / total) * 100) | round(1) if total > 0 else 0 }}
- name: "Daily Battery Energy Consumed Percentage"
unit_of_measurement: '%'
state: >
{% set solar = states('sensor.daily_solar_energy_consumed')|float %}
{% set battery = states('sensor.daily_battery_energy_consumed')|float %}
{% set grid = states('sensor.daily_grid_energy_consumed')|float %}
{% set total = solar + battery + grid %}
{{ ((battery / total) * 100) | round(1) if total > 0 else 0 }}
- name: "Daily Grid Energy Consumed Percentage"
unit_of_measurement: '%'
state: >
{% set solar = states('sensor.daily_solar_energy_consumed')|float %}
{% set battery = states('sensor.daily_battery_energy_consumed')|float %}
{% set grid = states('sensor.daily_grid_energy_consumed')|float %}
{% set total = solar + battery + grid %}
{{ ((grid / total) * 100) | round(1) if total > 0 else 0 }}
- name: "Daily Total Energy Consumed"
unit_of_measurement: 'kWh'
state: >
{% set daily_solar = states('sensor.daily_solar_energy_consumed')|float %}
{% set daily_battery = states('sensor.daily_battery_energy_consumed')|float %}
{% set daily_grid = states('sensor.daily_grid_energy_consumed')|float %}
{{ (daily_solar + daily_battery + daily_grid) | round(1) }}
- name: "Daily Self Sufficiency Percentage"
unit_of_measurement: '%'
state: >
{% set daily_solar = states('sensor.daily_solar_energy_consumed')|float %}
{% set daily_battery = states('sensor.daily_battery_energy_consumed')|float %}
{% set daily_grid = states('sensor.daily_grid_energy_consumed')|float %}
{% set total_consumed = daily_solar + daily_battery + daily_grid %}
{% set self_sufficient_energy = daily_solar + daily_battery %}
{% if total_consumed > 0 %}
{{ ((self_sufficient_energy / total_consumed) * 100) | round(1) }}
{% else %}
0
{% endif %}
sensor:
- platform: integration
source: sensor.apf_solar2house
name: Cumulative Solar Energy Consumed
unit_prefix: k
round: 1
- platform: integration
source: sensor.apf_batt2house
name: Cumulative Battery Energy Consumed
unit_prefix: k
round: 1
- platform: integration
source: sensor.apf_grid2house
name: Cumulative Grid Energy Consumed
unit_prefix: k
round: 1
- platform: integration
source: sensor.apf_generation_entity
name: Cumulative Solar Energy Produced
unit_prefix: k
unit_time: h
round: 1
utility_meter:
daily_solar_energy_consumed:
source: sensor.cumulative_solar_energy_consumed
cycle: daily
daily_battery_energy_consumed:
source: sensor.cumulative_battery_energy_consumed
cycle: daily
daily_grid_energy_consumed:
source: sensor.cumulative_grid_energy_consumed
cycle: daily
daily_solar_energy_produced:
source: sensor.cumulative_solar_energy_produced
cycle: daily |
Thanks. I previously tried the APF sensors instead of the native Powerwall sensors, but kept finding them not matching the values in the Tesla app. I've reconfigured the APF sensors and I've created a view side-by-side with the native ones to quickly compare them. Over the last few days, it seems like the native Powerwall sensors still better match the values in the Tesla app and the APF sensors are lower than the Tesla app values. For both sets of sensors, my peak/offpeak sensors are still not matching what is reported/shown in the Tesla app. Specifically peak importing seems to be the most off because it's consistently reporting a little grid usage during peak times when my system is using solar energy and/or pulling from the powerall since it's during peak time. Maybe the native powerwall site import sensor is incorrectly reporting a small value when it shouold be zero? And this would explain why it impacts the APF sensors since they're also based on the native powerall sensors. |
After several days of recording daily data from my system, I can confirm that the native Tesla Powerwall sensors better align to the values reported in the Tesla App for my system. However, I'm still seeing this incorrect reporting issue specifically with Interestingly, the total for the day is close to the Tesla app Why would this sensor continue to increase during times that my Powerwall System is showing zero consumption? I could understand that it's never actually zero due to inefficiencies of design or something, but to report 1.5 kWh of usage when the source shows 0 kWh during those times just does not make sense. Any ideas? |
I currently use Power Flow Plus card to monitor real-time values. At any time of the day, these values match; in fact, they are even more precise than the app since the app appears to round its real-time sensors to the nearest 100W. I noticed that the import/export API sensors update less frequently than the total values we add up (based on the real-time sensor values). However, the totals should match up pretty closely when the export/import sensor updates again. Below is my explanation for what's going on: I'm not sure but I think the Export/Import sensors might be adding up only rounded values instead of the precise values we see in the API. Whereas the real-time API sensors are much more precise; even detecting +/- 0.02kW (20 Watts) fluctuations (explanation below). The If you notice I do something similar in the Power Flow Plus card. I don't round the values to keep them as precise as possible; instead, I hide the real-time values (and respective flows) that are below 38Watts via this card's In a nutshell, the API exposes small fluctuations in power needed that's not displayed in the Tesla app. I will even dare say that there's a possibility the values we have in the Home Assistant utility_meter (based on real-time values) might be even more accurate at the end of the day. 2.mp4 |
I have had a problem with the cumulative integration sensors since my second pw2, was installed.. Somehow I now have several MWhr more having gone to the battery/ies than tesla app or data download reports, and about 2x what has come back out. Is there some way to adjust or reset the integration accumulators? I assume the integration is doing the accumulating, rather than the api or batteries reporting it.? |
@GSV3MiaC I also have two PW2s. The sensors I posted above based on real-time sensors should match up pretty closely to the Tesla app. Also, the I did try to create the same percentage sensors as above based off of the Powerwall Integration "Import/Export" commutative sensors.. however, no matter what I did, the calculations wouldn't match the Tesla app, not even close. |
It's really interesting that we're getting such different results between the native sensors and the APF versions with our setups. I also have 2 Powerwall 2s, but as I've shared in the HA forums, I'm finding the native ones to be more accurate than the APF versions as I tested over the last two weeks. Then again, I'm focused on raw data matching the values in the Tesla app rather than the percentages. With that said, I'm still seeing Daily Peak Export to Grid (Export to Grid between 11A-7P M-F) higher than what's shown in the Tesla app, which is usually zero. The total Daily Export to Grid matches, but the breakdown between Peak and Offpeak does not (NOTE that the Tesla app doesn't actually report the number for peak export, but you can see the daily visual and see zero export during those hours). After this second trial with the APF sensors, I've come to the conclusion that I'm just going to have to live with the HA sensors being slightly off for this peak/offpeak split. |
It is the accumulated 'sent to battery' number which is wrong for me. Went wrong by 7000 kwhr or something when second pw2 was installed and is off by same amount ever since. The other sensors, are a close match with true readings (from utility meters, solar edge inverter etc), but 'imported to battery' is just garbage. Nothing I can get from any tesla app or api is even close, so i just wonder where it comes from. Using windows powerwall app, and download, just confirms this one number is junk. |
Can you provide the full code youre using to be able to replicate your setup? I think the reason why we are getting different results is because we're not using the same code (only similar) and focusing on different sensors. For example, I don't have any peak/off peak sensors to compare to. Also you didn't mention anything about the precision of |
I was having issues with github's formatting, so I ended up providing a response back in this HA community thread with more details about my specific configuration. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
The sensors are still reporting incorrect accumulation for me. |
@ziptbm I haven't forgotten about you. I haven't had time to try to reproduce your template peak/non-peak sensors. All I know is the sensors I posted works pretty good. I think the main difference between the API and the Tesla app's values is the polling interval. It looks like the Tesla app updates its values slower. So when Home Assistant produces a value, by the time the Telsa app updates, the value is already a bit different. I think it should be very similar for you if you have both apps side-by-side; at least for my template sensors. However, even with the polling intervals being at different times, it shouldn't that much different, no matter what time of the day... usually just a few percent different at most any any given time. Once in a while it is off by 6% or so when there is a sudden change in value; and, the telsa app still hasn't updated. |
I'm affected by this issue as well. Main issue is around site_export and site_import - apparently there's a flow of 0,1 - 0,2 kWh during daytime, even though there's no power produced from PV (due to snow). This issue accumulated in HA Energy Dashboard since Oct 23 |
This issue is being caused by at least 1 bug in the Tesla Powerwall API. However, it isn't clear which person from the Home Assistant Core developers needs to report this issue to the Powerwall API developers. Also, it isn't clear how to even report this issue to the Powerwall API developers. Until that happens, we will run into a brick wall. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
issue is still present |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
@mkanet If by "Powerwall API developers" you are talking to firmware developers of the powerwall, then I believe you are out of luck as there is no official communication channel to tesla. If you however suspect an issue in the tesla powerwall API library (the software interfacing between home-assistant and the powerwall) you can do so here. If I understand your issue correctly regarding the import and export sensor, then I do not think this issue can be solved by us. From my understanding, the import and export data is accumulated by the powerwall itself and then queried via the API and displayed in the home-assistant UI, with the only transformation happening being the unit conversion. Therefore, any wrong accumulation happening is part of the powerwall. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
Issue is still present, people are developing their own sensors, utility meters and other mechanisms to record instead of using the official integration's entities. We are waiting on someone who understands the interplay between the official integration and the energy dashboard functionality, as someone pointed out above discrepancies can be as large as 1kWh per hour. |
@Avatar1976 I think @jrester explained it pretty well. It looks like the ultimate issue is caused by the Powerwall firmware itself. The workarounds we do via our own template sensors still doesnt fix it perfectly, or we could have at least asked the Home Assistant Powerwall Integration developers to patch these workarounds in the Powerwall Integration (or they could have submited a similar workaround for the Powerwall API developers). The problem is that nobody here knows how to report these issues to the Powerwall firmware developers to fix the issues at its core. This is at least how I understand what's going on. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
this is still an issue. |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
Issue is still present |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
This is still and issue
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: issue-triage-workflows[bot] ***@***.***>
Sent: Thursday, May 2, 2024 9:06:53 AM
To: home-assistant/core ***@***.***>
Cc: Avatar1976 ***@***.***>; Mention ***@***.***>
Subject: Re: [home-assistant/core] Powerwall integration accumulation wrong for site counters (Issue #102042)
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
—
Reply to this email directly, view it on GitHub<#102042 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALMDW5UX7HHJBL3HY4EJZH3ZAFYQ3AVCNFSM6AAAAAA6A6J7I6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBZGI3DOOBRGQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. |
The problem
Observed since daylight savings (or an update, unsure). The counters accumulate but are innacurate within HA energy dashboard.
What version of Home Assistant Core has the issue?
core-2023.10.3
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
Tesla Powerwall
Link to integration documentation on our website
https://www.home-assistant.io/integrations/powerwall
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: