Giter Club home page Giter Club logo

Comments (9)

safepay avatar safepay commented on August 21, 2024

I've tried fixing this but have not been able to do so without breaking the overall usability.

I'm looking for someone else to code that for me and submit a pull request.

from sensor.fronius.

nilrog avatar nilrog commented on August 21, 2024

I have noticed the same thing...and also that the powerflow sensors are unavailable which makes the power-wheel-card show red errors about them. I have a Fronius inverter that is not yet online so i'm just preparing things in HA for when i'm allowed to power it on.

When you say that overall usability is broken when you try to fix the error in this issue. What is it that gets broken? Isn't it enough to just skip trying to round/convert the state if there is no data to work with? Or if that is not enough set up "empty" data if no data could be fetched (with empty I mean indicating that all the sensors are zero).

I'm trying to see if I can fix these issues...but right now I have a problem where the "powerflow" data isn't polled at all...only the "inverterdata" is polled, as it should. Coding HA integrations is not my dayjob so i'm still struggling to understand their async core. But I cannot understand why only one of the data objects are polling :/

from sensor.fronius.

safepay avatar safepay commented on August 21, 2024

I have a problem where the "powerflow" data isn't polled at all...only the "inverterdata" is polled, as it should

First thing is to test whether the direct URL gets any data from the Powerflow:
http://{}/solar_api/v1/GetPowerFlowRealtimeData.fcgi

Just put your IP address in the right place and try in your browser. Eg:
http://192.168.0.1/solar_api/v1/GetPowerFlowRealtimeData.fcgi

As for nighttime errors, I 100% agree that it should just skip over if it can't connect.
I just updated the code as I think I had a wrong ConnectionError handling section which I've just tweaked.

from sensor.fronius.

nilrog avatar nilrog commented on August 21, 2024

I know it is not getting anything...the inverter is offline :)
Which is the same as what will happen during night, afaik. Unless you configure your inverter to be always online. I expect that HA will continue to poll following the throttle settings, but it only polls one of them.

Right now I reverted back to your code without any of my changes and then I see none of them polling...which looks weird. Both calls the inverter once, at setup, but after all those exceptions due to no state, there is no more polling.

Guess it's time to sleep and continue on this tomorrow :P

from sensor.fronius.

nilrog avatar nilrog commented on August 21, 2024

Ok, I think I got my head wrapped around this now and it looks ok when the inverter is offline. But I would like to try it when it's online to see if something is broken then also :P
But that won't happen until earliest on Wednesday this week if the power company does what they are supposed to.

Anyway, I created a fork and uploaded my changes there if you want to look at it and maybe try it.
https://github.com/nilrog/sensor.fronius

There were two issues...

  • The exception handling around the requests was not ok. Even with your latest change it threw lots of errors.
  • In the sensor class the local variable 'state' could be undefined before it was used.

With these changes there is not much in the logs when the inverter is offline. It only logs that it was unable to fetch the data, everytime it tries to contact the inverter. And it tries to fetch from both urls now when all exceptions are gone.
The power-wheel-card is also happy because the sensors it needs exists...with state 'unknown' so the card shows 'NaN' in the wheel.

But, as I said, I do NOT know how it behaves if the inverter is online...yet. So I might have broken something :| Which is why I haven't sent you a pull-request yet.

from sensor.fronius.

safepay avatar safepay commented on August 21, 2024

Looks good to me and still retrieves data. I think that's where I was going with the error handling, but the state changes look good.

I'll upload it to the main branch as I've tested it and it seems Ok.

No need to submit a pull request at this point.

from sensor.fronius.

nilrog avatar nilrog commented on August 21, 2024

Good, thanks for the testing :)
I usually don't like to push things that I haven't been able to test myself.

Looking forward to tomorrow when I am hopefully allowed to turn on my inverter...and use your sensor for real.

from sensor.fronius.

jaganath-b avatar jaganath-b commented on August 21, 2024

Great, thanks a lot. No more recurring errors in the log :-)

from sensor.fronius.

safepay avatar safepay commented on August 21, 2024

Changes have been merged in to current master version. Thanks all for helping.

from sensor.fronius.

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.