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

Add option to tune limits #27

Open
Sparhawk76 opened this issue Feb 9, 2023 · 1 comment
Open

Add option to tune limits #27

Sparhawk76 opened this issue Feb 9, 2023 · 1 comment

Comments

@Sparhawk76
Copy link

Had a couple bugs with max voltage on the input limits with my Rover 60, using a BT2 module. I changed the following in solardevice.py to get it to work for me with my higher panel voltage (Two 24V 320W panels in series, hits almost 70v), output voltage is 12V nominal.

In:
class PowerDevice():

I changed:

    self._input_mvoltage = {
        'val': 0,
        'min': 0,
        'max': 96000,
        'maxdiff': 48000
    }

Changing 'max' stopped one error that I first saw that the input voltage was too high.

Not sure if 'maxdiff' is at the right value (I guessed without looking too deeply in the code), but it stopped the second error I was seeing in the output when my panels voltage went up to almost 70V, and I saw it complain about maxdiff in the terminal output. Haven't seen it complain about maxdiff since.

@Olen
Copy link
Owner

Olen commented Feb 10, 2023

The reason I implemented these checks is that at least my devices pretty often report values that are way out of line.
To avoid spurious dips and errors in the graphs (and even triggering of false alerts if you run some kind of monitoring software), there are rules that will ignore values that are too high or too low, OR if the values change too much from one measurement to another. If the output of your panels jump from 0 to 70 volts in one go, then you will hit the maxdiff limitation. If they increase slowly, from 0 to 10 to 20 to 30 etc, you will not see that.

But currently, these limits are very general, so they might not fit all.

The best solution would be if the plugin had a way to set the right limits for that type of device.

It would be something like (not tested or anything, just taken from the top of my head)

class Util():

    def __init__(self, power_device):
        self.PowerDevice = power_device
        self.PowerDevice.entities._input_mvoltage = {
          'val': 0,
          'min': 0,
          'max': 96000,
          'maxdiff': 48000
      }

An even better way is to update the SolarDevice class or the PowerDevice class to have some functions to tune those limits.

@Olen Olen changed the title Rover 60 Support Add option to tune limits Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants