tadasdanielius / pyaltherma

Python library to control Daikin Altherma heat pump
MIT License
8 stars 0 forks source link

Does not update water tank temperature #11

Open T0FFF opened 2 months ago

T0FFF commented 2 months ago

There is a problem with the update of the hot water temperature.

Daikin Altherma version in HA: v1.5.2

If I used the example.py script, an error occurred :

DEBUG:pyaltherma.comm:[OUT]: /[0]/MNAE/2/Operation/DomesticHotWaterTemperatureHeating/la {"m2m:rqp": {"fr": "pyaltherma", "rqi": "600fb", "op": 2, "to": "/[0]/MNAE/2/Operation/DomesticHotWaterTemperatureHeating/la"}} DEBUG:pyaltherma.comm:[IN]: {"m2m:rsp":{"rsc":2000,"rqi":"600fb","to":"pyaltherma","fr":"/[0]/MNAE/2/Operation/DomesticHotWaterTemperatureHeating/la","pc":{"m2m:cin":{"rn":"00000024","ri":"0049_00000024","pi":"0049","ty":4,"ct":"20240905T174745Z","lt":"20240905T174745Z","st":36,"con":45.0000000000000000}}}} domestic_hot_water_temperature_heating: 45.0 Traceback (most recent call last): File "example.py", line 101, in [asyncio.run(main](http://asyncio.run(main/)()) File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run return loop.run_untilcomplete(main) File "/usr/lib/python3.8/asyncio/baseevents.py", line 616, in run_until_complete return future.result() File "example.py", line 95, in main await water_tank_test(device.hot_water_tank) File "example.py", line 81, in water_tank_test await cc.set_target_temperature(42) File ".../daikin/pyaltherma/pyaltherma/controllers.py](.../daikin/pyaltherma/pyaltherma/controllers.py)", line 225, in set_target_temperature await self.call_operation('TargetTemperature', value) File ".../daikin/pyaltherma/pyaltherma/controllers.py](.../daikin/pyaltherma/pyaltherma/controllers.py)", line 114, in call_operation valid = conf['settable'] and conf['minValue'] <= value <= conf['maxValue'] KeyError: 'minValue'

Indeed, if I print the value of conf, only conf['settable'] exists. If I remove this condition conf['minValue'] <= value <= conf['maxValue'] in controllers.py, it works. Yet if I look, minValue & maxValue exists in the trace for DomesticHotWaterTemperatureHeating :

DEBUG:pyaltherma.comm:[IN]: {"m2m:rsp":{"rsc":2000,"rqi":"b2bce","to":"pyaltherma","fr":"[0]/MNAE/2/UnitProfile/la","pc":{"m2m:cin":{"rn":"00000004","ri":"0042_00000004","pi":"0042","ty":4,"ct":"20240901T010454Z","lt":"20240901T010454Z","st":4,"con":"{\"SyncStatus\":\"update\",\"Sensor\":[\"TankTemperature\"],\"UnitStatus\":[\"ErrorState\",\"InstallerState\",\"WeatherDependentState\",\"WarningState\",\"EmergencyState\",\"TargetTemperatureOverruledState\"],\"Operation\":{\"Power\":[\"on\",\"standby\"],\"OperationMode\":[\"heating\"],\"TargetTemperature\":{\"heating\":{}},\"DomesticHotWaterTemperatureHeating\":{\"maxValue\":57.0000000000000000,\"minValue\":30.0000000000000000,\"stepValue\":1.0000000000000000,\"settable\":false},\"powerful\":[\"0\",\"1\"]},\"Schedule\":{\"Base\":\"action\",\"defaultScheduleAvailable\":\"false\",\"NameAdjustable\":\"false\",\"List\":{\"heating\":[{\"StartTime\":{\"stepValue\":10.0000000000000000,\"unit\":\"minute\"},\"TargetTemperature\":{\"heating\":{\"maxValue\":57.0000000000000000,\"minValue\":30.0000000000000000,\"stepValue\":1.0000000000000000}},\"Actions\":[\"StartTime\",\"TargetTemperature\"],\"maxActionsAllowed\":4},[\"monday\",\"tuesday\",\"wednesday\",\"thursday\",\"friday\",\"saturday\",\"sunday\"]]}},\"Consumption\":{\"Electrical\":{\"unit\":\"kWh\",\"Heating\":{\"Daily\":{\"contentCount\":24,\"resolution\":2},\"Weekly\":{\"contentCount\":14,\"resolution\":1},\"Monthly\":{\"contentCount\":24,\"resolution\":1}}}}}"}}}} DEBUG:pyaltherma.comm:[OUT]: /[0]/MNAE/2/Operation/DomesticHotWaterTemperatureHeating/la {"m2m:rqp": {"fr": "pyaltherma", "rqi": "406a2", "op": 2, "to": "/[0]/MNAE/2/Operation/DomesticHotWaterTemperatureHeating/la"}} DEBUG:pyaltherma.comm:[IN]: {"m2m:rsp":{"rsc":2000,"rqi":"406a2","to":"pyaltherma","fr":"/[0]/MNAE/2/Operation/DomesticHotWaterTemperatureHeating/la","pc":{"m2m:cin":{"rn":"0000001e","ri":"0049_0000001e","pi":"0049","ty":4,"ct":"20240905T140005Z","lt":"20240905T140005Z","st":30,"con":43.0000000000000000}}}}

Could you check this issue please ?

T0FFF commented 2 months ago

I tried directly from HA, the daikin_altherma integration gives the right key (DomesticHotWaterTemperatureHeating instead of TargetTemperature) in call_operation. Now I have {'maxValue': 57.0, 'minValue': 30.0, 'stepValue': 1.0, 'settable': False}. So It should work but I have a last problem, my operation is not settable and I don't know how to change this configuration on the device.

For now I have to remove the if self._is_settable_target_temp(): condition in water_heater.py in the HA integration and it works, I just have a warning "Invalid argument XX for operation DomesticHotWaterTemperatureHeating or operation is not settable." from pyaltherma but the temperature changes.

So, the pyaltherma works in the HA environment but not directly called by example.py. And last point, I don't see how to set the settable: false to True.