Skip to content
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

PR #59848 for SMA solar breaks energy dashboard #62723

Closed
tomlut opened this issue Dec 24, 2021 · 10 comments
Closed

PR #59848 for SMA solar breaks energy dashboard #62723

tomlut opened this issue Dec 24, 2021 · 10 comments
Assignees

Comments

@tomlut
Copy link

tomlut commented Dec 24, 2021

The problem

PR #59848 changes the states of SMA inverter sensors to 0 rather than unknown when the inverter is not supplying power. Which was an excellent change. However, it also changes energy meter totals to 0 when the state becomes unknown, or maybe unavailable, like during the weekly reboot my inverter likes to do. This causes massive spikes in the energy dashboard and utility meters.

Ideally the power sensors (W) should remain reporting 0 rather than unknown as introduced in the PR.

However the energy sensors (kWh) for the inverter and SMA meter should not be changed to 0 when unknown or unavailable. This would prevent the issues in the energy dashboard (and utility meters) and no longer require work around fixes like this for every SMA energy sensor used:

template:
  sensor:
    - name: "total_yield_filtered" # Used in utility meter only.
      icon: "mdi:counter"
      unit_of_measurement: "kWh"
      device_class: energy
      state_class: total_increasing
      state: "{{ states('sensor.total_yield')|float(0) }}"
      availability: "{{ states('sensor.total_yield')|float(0) > 4000 }}"

What version of Home Assistant Core has the issue?

core-2021.12.5

What was the last working version of Home Assistant Core?

core-2021.11.5

What type of installation are you running?

Home Assistant OS

Integration causing the issue

SMA Solar

Link to integration documentation on our website

https://www.home-assistant.io/integrations/sma/

Example YAML snippet

utility_meter:
  energy_to_grid_daily:
    source: sensor.metering_total_yield
    cycle: daily

  energy_from_grid_daily:
    source: sensor.metering_total_absorbed
    cycle: daily
    tariffs:
      - peak
      - offpeak

  energy_inverter_daily:
    source: sensor.total_yield_filtered
    cycle: daily

Anything in the logs that might be useful for us?

No response

Additional information

@probot-home-assistant
Copy link

sma documentation
sma source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @kellerza, @rklomp, mind taking a look at this issue as it has been labeled with an integration (sma) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@rklomp
Copy link
Contributor

rklomp commented Dec 24, 2021

Should be fixed by #62599

@frenck can you add this to 2012.12.6?

@tomlut
Copy link
Author

tomlut commented Dec 24, 2021

Wow. That was quick. Thanks René.

@smignon612
Copy link

i have the problem with saj inverter, can this be the solution to for this?

@tomlut
Copy link
Author

tomlut commented Dec 24, 2021

No. This is specific to the SMA integration.

Please open a separate issue.

@Roeland54
Copy link

@rklomp @frenck can we have this fix in the next bugfix release?

@Trubbens
Copy link

so, if i understand correctly this was an issue with home assistant core version. So if i update to the lastest HA core, it should be solved?

@Tommatheussen
Copy link
Contributor

so, if i understand correctly this was an issue with home assistant core version. So if i update to the lastest HA core, it should be solved?

It has been merged to Develop, which means it will be available in the next full release of core.

@jan-gerard
Copy link

I read it's fixed in 2022.2.0 (#62599)
And there is a report of a way to repair the database too: (https://github.com/home-assistant/core/issues/63776#issuecomment-1015489684)

@tomlut tomlut closed this as completed Apr 18, 2022
@github-actions github-actions bot locked and limited conversation to collaborators May 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants