home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.38k stars 29.9k forks source link

Powerwall integration accumulation wrong for site counters #102042

Closed Avatar1976 closed 3 months ago

Avatar1976 commented 11 months ago

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

home-assistant[bot] commented 11 months ago

Hey there @bdraco, @jrester, @daniel-simpson, mind taking a look at this issue as it has been labeled with an integration (powerwall) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `powerwall` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign powerwall` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


powerwall documentation powerwall source (message by IssueLinks)

ziptbm commented 11 months ago

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.

issue-triage-workflows[bot] commented 10 months ago

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.

ziptbm commented 10 months ago

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.

jrester commented 10 months ago

@ziptbm thanks for your extensive writeup. Something that would be interesting to know is the software version of your powerwall. Regarding your issue, I am quite unsure where this could come from, we are basically just forwarding the values from the powerwall. AFIK the only post-processing to this value is done here. It might be due to the conversion from wh to kwh.

ziptbm commented 10 months ago

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!

shanelord01 commented 10 months ago

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

mkanet commented 9 months ago

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.

ziptbm commented 9 months ago

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?

mkanet commented 9 months ago

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: sensor.powerwall_XXXXXXX_power you can just copy and paste all these sensors in your configuration.yaml and restart Home Assistant.

Ultimately, you will be able to use the utility_meter sensors at the bottom of the yaml code below (they will reset every 24 hours at midnight)
sensor.daily_solar_energy_consumed sensor.daily_battery_energy_consumed sensor.daily_grid_energy_consumed sensor.daily_solar_energy_produced

The above utility_meter sensors rely on the below respective Cumulative integration sensors.
NOTE: The below sensors replace the broken/inaccurate import/export sensors included with the Tesla Powerwall Integration: sensor.cumulative_solar_energy_consumed sensor.cumulative_battery_energy_consumed sensor.cumulative_grid_energy_consumed sensor.cumulative_solar_energy_produced

I have also included some other sensors below that take advantage the sensors above. sensor.daily_solar_energy_consumed_percentage sensor.daily_battery_energy_consumed_percentage sensor.daily_grid_energy_consumed_percentage sensor.daily_total_energy_consumed sensor.daily_self_sufficiency_percentage

You can then finally have accurate daily real-time graphs/charts like below.
image

NOTE: I also included one 1 bonus sensor called: sensor.powerwall_charge_actual to replace the broken/inaccurate Powerwall Integration sensor.powerwall_charge sensor. There is a known bug with this sensor too.

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
ziptbm commented 9 months ago

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: sensor.powerwall_XXXXXXX_power you can just copy and paste all these sensors in your configuration.yaml and restart Home Assistant.

Ultimately, you will be able to use the utility_meter sensors at the bottom of the yaml code below (they will reset every 24 hours at midnight) sensor.daily_solar_energy_consumed sensor.daily_battery_energy_consumed sensor.daily_grid_energy_consumed sensor.daily_solar_energy_produced

The above utility_meter sensors rely on the below respective Cumulative integration sensors. NOTE: The below sensors replace the broken/inaccurate import/export sensors included with the Tesla Powerwall Integration: sensor.cumulative_solar_energy_consumed sensor.cumulative_battery_energy_consumed sensor.cumulative_grid_energy_consumed sensor.cumulative_solar_energy_produced

I have also included some other sensors below that take advantage the sensors above. sensor.daily_solar_energy_consumed_percentage sensor.daily_battery_energy_consumed_percentage sensor.daily_grid_energy_consumed_percentage sensor.daily_total_energy_consumed sensor.daily_self_sufficiency_percentage

You can then finally have accurate daily real-time graphs/charts like below. image

NOTE: I also included one 1 bonus sensor called: sensor.powerwall_charge_actual to replace the broken/inaccurate Powerwall Integration sensor.powerwall_charge sensor. There is a known bug with this sensor too.

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.

ziptbm commented 9 months ago

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 sensor.powerwall_site_import. The values recorded in Home Assistant on this sensor are reporting a slow increase in consumption during PEAK hours, whereas the Tesla app (and the CSV export data) does not.

Interestingly, the total for the day is close to the Tesla app (I'm seeing +/- 0.1 kWh over the last few days in both directions).

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?

mkanet commented 9 months ago

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 sensor.powerwall_site_power will even capture tiny bits of power +/- 0.02kW (<20 Watts) that are adjustments used to maintain the Tesla battery charge levels and home power consumption levels; and also to keep the Solar Inverter electronics powered ON. Whereas, the Tesla App doesn't show these small real-time values. I think it just rounds these real-time values to the nearest 100W (showing 0 value in those cases) when displayed in the Tesla app. I think they did this intentionally to not confuse the customer.

If you notice sensor.powerwall_solar_power does something even weirder than sensor.powerwall_site_power, it also captures tiny bits of power +/- 0.02kW (<20 Watts) EVEN overnight! 😕. I think a tiny bit of current (in both directions) may be necessary to keep the Solar panel electronics (Solar Inverter) to stay powered ON. Again, the Tesla app hides these tiny fluctuations by rounding its values to the nearest 100W in order not to confuse us.

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 display_zero_tolerance setting. That way all real-time values match up to the Tesla app; and even display more precisely. I think this card is the best Home Assistant card out right now for Tesla Powerwall since it doesn't have the limitations the other custom Tesla cards have.

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.

HA-Energy-Dashboard

https://github.com/home-assistant/core/assets/811008/6d5a73aa-8373-4fce-9ad0-f9bc8c17c36a

GSV3MiaC commented 9 months ago

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

mkanet commented 9 months ago

@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. Powerwall Charge Actual battery sensor should be less than 1% difference at any time for the Battery charge value, at least for me.

Also, the Daily Solar Energy Consumed Percentage , Daily Battery Energy Consumed Percentage, Daily Grid Energy Consumed Percentage and Daily Total Energy Consumed above should match pretty closely to the Tesla app for Home consumption too. I actually think these percentage sensors are more accurate than the Tesla app's equivalent since they poll the hardware more frequently.

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.

ziptbm commented 9 months ago

@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. Powerwall Charge Actual battery sensor should be less than 1% difference at any time for the Battery charge value, at least for me.

Also, the Daily Solar Energy Consumed Percentage , Daily Battery Energy Consumed Percentage, Daily Grid Energy Consumed Percentage and Daily Total Energy Consumed above should match pretty closely to the Tesla app for Home consumption too. I actually think these percentage sensors are more accurate than the Tesla app's equivalent since they poll the hardware more frequently.

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.

GSV3MiaC commented 9 months ago

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.

mkanet commented 9 months ago

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 Powerwall Charge Actual, Daily Solar Energy Consumed Percentage , Daily Battery Energy Consumed Percentage, Daily Grid Energy Consumed Percentage and Daily Total Energy Consumed after using them for a couple of days. Those I know for sure are pretty darn close; with only the polling times being different on my setup.

ziptbm commented 9 months ago

Can you provide the full code youre using to be able to replicate your setup?

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.

issue-triage-workflows[bot] commented 8 months ago

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.

ziptbm commented 8 months ago

The sensors are still reporting incorrect accumulation for me.

mkanet commented 8 months ago

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

MvQuast commented 8 months ago

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

issue-triage-workflows[bot] commented 7 months ago

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.

MvQuast commented 7 months ago

issue is still present

mkanet commented 7 months ago

issue is still present

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.

issue-triage-workflows[bot] commented 7 months ago

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.

lucamargoni commented 7 months ago

issue is still present

issue-triage-workflows[bot] commented 6 months ago

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.

jrester commented 6 months ago

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

issue-triage-workflows[bot] commented 6 months ago

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.

Avatar1976 commented 6 months ago

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.

mkanet commented 6 months ago

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

issue-triage-workflows[bot] commented 5 months ago

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.

ziptbm commented 5 months ago

this is still an issue.

issue-triage-workflows[bot] commented 5 months ago

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.

Avatar1976 commented 5 months ago

Issue is still present

issue-triage-workflows[bot] commented 4 months ago

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.

Avatar1976 commented 4 months ago

This is still and issue

Get Outlook for Androidhttps://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 GitHubhttps://github.com/home-assistant/core/issues/102042#issuecomment-2089267814, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALMDW5UX7HHJBL3HY4EJZH3ZAFYQ3AVCNFSM6AAAAAA6A6J7I6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBZGI3DOOBRGQ. You are receiving this because you were mentioned.Message ID: @.***>

issue-triage-workflows[bot] commented 4 months ago

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.