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

Solar detection broken #71

Closed
rhammen opened this issue Jan 22, 2023 · 4 comments
Closed

Solar detection broken #71

rhammen opened this issue Jan 22, 2023 · 4 comments

Comments

@rhammen
Copy link
Contributor

rhammen commented Jan 22, 2023

HA now reports that I have

  • Solar Collector, Solar buffer, Solarpump
    while I do not have them.

I think this changed * Optimize solar detection caused this.
The values in my case (where there is no solar buffer):
Solar Collector = 5.0 C
Solar Buffer = 150.0 C

The OR function in line 159 then triggers the detection:
SolarPresent = (sensor_value > 0 or working_hours > 0.01 or solar_koll > 0 or solar_buffer > 0)
Can we change this to:
SolarPresent = (sensor_value > 0 or working_hours > 0.01)
or if that causes problem to something like:
SolarPresent = (sensor_value > 0 or working_hours > 0.01 or solar_koll !=5 or solar_buffer != 150)

@Kars-de-Jong
Copy link
Contributor

I can confirm this issue, I have the same temperature readings.

@rhammen
Copy link
Contributor Author

rhammen commented Jan 22, 2023

It appears that detect_solar_present() is not used (temporarily disabled) for the solar parameters in sensor.py
Instead a separate detection based on the visibilities is used... This made trying out things a bit confusing...
In my local setup I now re-enabled usage of detect_solar_present(), and used this:

 def detect_solar_present(self):
        sensor_value = self.get_value(LUX_DETECT_SOLAR_SENSOR)
        solar_koll = self.get_value("calculations.ID_WEB_Temperatur_TSK")
        solar_buffer = self.get_value("calculations.ID_WEB_Temperatur_TSS")
        working_hours = self.get_value("parameters.ID_BSTD_Solar")
        SolarPresent = (sensor_value > 0 or working_hours > 0.01 or solar_koll !=5 or solar_buffer != 150)
        LOGGER.info(f"{sensor_value}, WH={working_hours}, solar_koll={solar_koll}, solar_buffer={solar_buffer}")
        LOGGER.info(f"SolarPresent = {SolarPresent}") 
        return SolarPresent

This way the solar sensors are not not added to my local setup.

@Kars-de-Jong
Copy link
Contributor

It indeed looks like detecting options based on visibilities doesn't work reliably.

Maybe make the check based on default temperatures an and condition:

        SolarPresent = (sensor_value > 0 or working_hours > 0.01 or (solar_koll != 5 and solar_buffer != 150))

@BenPru
Copy link
Owner

BenPru commented Jan 25, 2023

I use more and more the original luxtronik visibilities. But it seems that many heatpumps has a wrong visibility config.
I have changed the behavior in the latest pre-release 2023.01.25.
Currently I'm focusing on the new code base, but I try to implement those "specials":
https://github.com/BenPru/luxtronik/blob/core-preview/custom_components/luxtronik/coordinator.py#L356

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

3 participants