LavermanJJ / pysolarfocus

Unofficial Python Client for Solarfocus eco manager-touch
https://pypi.org/project/pysolarfocus/
Apache License 2.0
7 stars 5 forks source link

Adding support for 23.110 #33

Open lein1013 opened 7 months ago

lein1013 commented 7 months ago

It seems that some modbus registers have moved Noticed it on the homeassistant-solafocus integration grafik grafik

running the example shows:

============
BiomassBoiler
============
---Input:
temperature| raw:538 scaled:53.800000000000004
status| raw:0 scaled:0
message_number| raw:0 scaled:0
door_contact| raw:-1 scaled:-1
cleaning| raw:3 scaled:3
ash_container| raw:129 scaled:129
outdoor_temperature| raw:520 scaled:52.0

I've modified now

class BiomassBoiler(Component):
    def __init__(self, input_address=2400, holding_address=-1, api_version: ApiVersions = ApiVersions.V_23_010, system=Systems.ECOTOP) -> None:

        if api_version.greater_or_equal(ApiVersions.V_22_090.value):
            holding_address = 33400

        super().__init__(input_address, holding_address)
        self.temperature = DataValue(address=0, multiplier=0.1)
        self.status = DataValue(address=1, data_type=DataTypes.UINT)
        self.message_number = DataValue(address=4)
        self.door_contact = DataValue(address=5)
        if api_version.greater_or_equal(ApiVersions.V_23_110.value) and system is Systems.ECOTOP:
            self.cleaning = -1 #DataValue(address=6) # assuming cleaning was removed and hence index shifted
            self.ash_container = DataValue(address=6)
            self.outdoor_temperature = DataValue(address=7, multiplier=0.1)
            # no idea about address=8
            self.boiler_operating_mode = 4 # Pellets
            # self.boiler_operating_mode = DataValue(address=9) # readout for therminator only?
        else:
            self.cleaning = DataValue(address=6)
            self.ash_container = DataValue(address=7)
            self.outdoor_temperature = DataValue(address=8, multiplier=0.1)
            self.boiler_operating_mode = DataValue(address=9)

which leads to


BiomassBoiler
============
---Input:
temperature| raw:530 scaled:53.0
status| raw:0 scaled:0
message_number| raw:0 scaled:0
door_contact| raw:-1 scaled:-1
ash_container| raw:3 scaled:3
outdoor_temperature| raw:127 scaled:12.700000000000001
log_wood| raw:0 scaled:0
pellet_usage_last_fill| raw:0 scaled:0.0
...
lein1013 commented 7 months ago

my current quick hack (not ready for a pull request) add selector.SelectOptionDict(value="23.110", label="v23.110"), in /config/custom_components/solarfocus/config_flow.py change "requirements": ["git+https://github.com/lein1013/pysolarfocus.git@ecotop_23_110_fix"], in /config/custom_components/solarfocus/manifest.json

restart Home Assistant, reconfigure to 23.110, restart HA I've reached out to Solarfocus - we'll see if this register shift was intended... people having the same verion and issue - please let us know...