Coder Social home page Coder Social logo

Comments (10)

dennistd4 avatar dennistd4 commented on June 10, 2024 1

In my installation total_yield will not go to unknown (and thus 0 now), but I can imagine this could cause incorrect behavior in if it does happen.

It does happen when you restart your Home Assistant while the inverter is at sleep (during the night).

from pysma.

flopp999 avatar flopp999 commented on June 10, 2024

Hi

The value is coming from the inverter so this is nothing done by the code.
One way could be to store the value and done change it if new value is lower or not collect any data if the value is 0

from pysma.

somm15 avatar somm15 commented on June 10, 2024

Are you sure it comes from the inverter?
I'm running this for more than a year and I never received a 0 value for the total_yield.
It only happened with the last home assistant release.
I thought it could be due to the new "if" returning 0 instead of None.

from pysma.

flopp999 avatar flopp999 commented on June 10, 2024

Ok then it must be Home Assistant that makes the error.
At least I don't get that error.
I do not use Home Assistant I only use this package in a Python code

from pysma.

somm15 avatar somm15 commented on June 10, 2024

Well, I'm not sure you won't get it

# SMA will return None instead of 0 if if no power is generated
# If we have extracted a path, we know the value was previously
# present and res can be set to 0
if res is None:
res = 0

Not sure if this applies to total_yield but I think so.

from pysma.

rklomp avatar rklomp commented on June 10, 2024

I think this could be caused by this change. In my installation total_yield will not go to unknown (and thus 0 now), but I can imagine this could cause incorrect behavior in if it does happen.

I will have a look if I can find a better solution for this.

from pysma.

somm15 avatar somm15 commented on June 10, 2024

I can wait and check if it happens again if needed but the timing (update this week) is quite suspicious.
Last week, around the exact same time, I have no value in the graph. This week, same time, zero.

By the way, it's a very useful change. I had nasty templates in Home Assistant to avoid "Unknown" during the night for Power.
Thanks a lot !

(but I don't have any template for total_yield)

from pysma.

rklomp avatar rklomp commented on June 10, 2024

I think setting to 0 is only useful for the sensors with unit "W". Other sensors don't really benefit of this feature, so I proposed #94.

Let me know what you think.

from pysma.

dennistd4 avatar dennistd4 commented on June 10, 2024

I think it's a good solution. Hopefully it's implemented in Home Assistant as soon as possible, because tonight it went to 0 again...

from pysma.

dennistd4 avatar dennistd4 commented on June 10, 2024

I still have this problem, even though Home Assistant is updated to 2021.12.9. Is this fix still not implemented?

from pysma.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.