gduteil / cozytouch

Atlantic Cozytouch integration for Home Assistant
12 stars 0 forks source link

Adding support for SAUTER Phazy hot water tank #10

Open hidrissi-hass opened 1 month ago

hidrissi-hass commented 1 month ago

Hi,

I have a hot water tank : SAUTER Phazy. It is connected using Cozytouch. I can help adding support for it.

Here is the json file [Cozytouch.json](https://github.com/gduteil/cozytouch/files/15500214/Cozytouch.json) ```json [ { "id": 834019, "name": "setup1", "address": { "addressLine": "", "city": "Clamart", "country": "FR", "latitude": 48.xxx, "longitude": 2.xxxx, "postalCode": "92140" }, "numberOfRooms": 4, "numberOfPersons": 4, "area": 90, "type": 2, "mainHeatingEnergy": 1, "mainDHWEnergy": 1, "setupBuildingDate": 4, "timeZone": "Europe/Paris", "absence": { "endDate": null, "startDate": null }, "devices": [ { "customName": "Chauffe-eau", "deviceId": 3404348, "deviceUrl": "1716-1285-4106", "gatewayId": 580070, "masterDeviceId": null, "modelId": 236, "name": "Chauffe-eau", "productId": 7, "tags": [], "gatewaySerialNumber": "1716-1285-4106", "longName": "Chauffe-eau HDG2 Default", "productRange": null, "isAvailable": false, "isAvailableTimestamp": 1716880329, "isRemoteMaintainable": true, "zoneId": 410779, "capabilities": [ { "capabilityId": 15, "modificationDate": 1716576101, "value": "2" }, { "capabilityId": 22, "modificationDate": 1716642921, "value": "65.00000000000000000000" }, { "capabilityId": 59, "modificationDate": 1716868053, "value": "28217" }, { "capabilityId": 87, "modificationDate": 1716576101, "value": "0" }, { "capabilityId": 99, "modificationDate": 1716867793, "value": "0" }, { "capabilityId": 150, "modificationDate": 1716576103, "value": "[[0,255,0,4],[0,255,0,4],[0,255,0,4],[0,255,0,4],[0,255,0,4],[0,255,0,4],[0,255,0,4],[0,255,0,4],[0,255,0,4],[0,255,0,4]]" }, { "capabilityId": 164, "modificationDate": 1716576102, "value": "1040" }, { "capabilityId": 165, "modificationDate": 1716642855, "value": "0" }, { "capabilityId": 168, "modificationDate": 1716576101, "value": "16141" }, { "capabilityId": 179, "modificationDate": 1716883273, "value": "-74" }, { "capabilityId": 188, "modificationDate": 1716576101, "value": "2" }, { "capabilityId": 218, "modificationDate": 1716887529, "value": "4" }, { "capabilityId": 222, "modificationDate": 1716576128, "value": "[0,0]" }, { "capabilityId": 223, "modificationDate": 1716576101, "value": "3" }, { "capabilityId": 224, "modificationDate": 1716576101, "value": "125" }, { "capabilityId": 225, "modificationDate": 1716576101, "value": "1" }, { "capabilityId": 226, "modificationDate": 1716576128, "value": "[0,0]" }, { "capabilityId": 227, "modificationDate": 1716576101, "value": "0" }, { "capabilityId": 228, "modificationDate": 1716576101, "value": "7.0000000000000000000" }, { "capabilityId": 230, "modificationDate": 1716666044, "value": "1" }, { "capabilityId": 231, "modificationDate": 1716642916, "value": "65.00000000000000000000" }, { "capabilityId": 232, "modificationDate": 1716576102, "value": "0" }, { "capabilityId": 234, "modificationDate": 1716576101, "value": "65.0000000000000000000" }, { "capabilityId": 235, "modificationDate": 1716576101, "value": "7" }, { "capabilityId": 236, "modificationDate": 1716576101, "value": "1" }, { "capabilityId": 237, "modificationDate": 1716576102, "value": "[[0,60],[0,0],[0,0],[0,0]]" }, { "capabilityId": 238, "modificationDate": 1716576103, "value": "[[0,60],[0,0],[0,0],[0,0]]" }, { "capabilityId": 239, "modificationDate": 1716576103, "value": "[[0,60],[0,0],[0,0],[0,0]]" }, { "capabilityId": 240, "modificationDate": 1716576102, "value": "[[0,60],[0,0],[0,0],[0,0]]" }, { "capabilityId": 241, "modificationDate": 1716576102, "value": "[[0,60],[0,0],[0,0],[0,0]]" }, { "capabilityId": 242, "modificationDate": 1716576102, "value": "[[0,60],[0,0],[0,0],[0,0]]" }, { "capabilityId": 243, "modificationDate": 1716576104, "value": "[[0,60],[0,0],[0,0],[0,0]]" }, { "capabilityId": 244, "modificationDate": 1716576101, "value": "3" }, { "capabilityId": 245, "modificationDate": 1716576102, "value": "[[0,360],[1320,1440],[0,0]]" }, { "capabilityId": 246, "modificationDate": 1716576102, "value": "[[0,360],[1320,1440],[0,0]]" }, { "capabilityId": 247, "modificationDate": 1716576102, "value": "[[0,360],[1320,1440],[0,0]]" }, { "capabilityId": 248, "modificationDate": 1716576102, "value": "[[0,360],[1320,1440],[0,0]]" }, { "capabilityId": 249, "modificationDate": 1716576104, "value": "[[0,360],[1320,1440],[0,0]]" }, { "capabilityId": 250, "modificationDate": 1716576104, "value": "[[0,360],[1320,1440],[0,0]]" }, { "capabilityId": 251, "modificationDate": 1716576104, "value": "[[0,360],[1320,1440],[0,0]]" }, { "capabilityId": 252, "modificationDate": 1716576101, "value": "65.0000000000000000000" }, { "capabilityId": 253, "modificationDate": 1716576102, "value": "50.0000000000000000000" }, { "capabilityId": 257, "modificationDate": 1716576102, "value": "7" }, { "capabilityId": 258, "modificationDate": 1716576102, "value": "200" }, { "capabilityId": 259, "modificationDate": 1716576102, "value": "2100" }, { "capabilityId": 260, "modificationDate": 1716576102, "value": "2100" }, { "capabilityId": 261, "modificationDate": 1716576102, "value": "700" }, { "capabilityId": 262, "modificationDate": 1716576102, "value": "3" }, { "capabilityId": 263, "modificationDate": 1716576102, "value": "[700,1400,2100,0,0,0,0,0,0,0]" }, { "capabilityId": 264, "modificationDate": 1716885823, "value": "60.89000000000000000000" }, { "capabilityId": 265, "modificationDate": 1716882813, "value": "63.71000000000000000000" }, { "capabilityId": 266, "modificationDate": 1716884926, "value": "59.90000000000000000000" }, { "capabilityId": 267, "modificationDate": 1716882853, "value": "61.62000000000000000000" }, { "capabilityId": 268, "modificationDate": 1716884353, "value": "387" }, { "capabilityId": 269, "modificationDate": 1716867533, "value": "833" }, { "capabilityId": 270, "modificationDate": 1716576102, "value": "421" }, { "capabilityId": 271, "modificationDate": 1716887319, "value": "90" }, { "capabilityId": 272, "modificationDate": 1716576102, "value": "0" }, { "capabilityId": 273, "modificationDate": 1716886973, "value": "928" }, { "capabilityId": 274, "modificationDate": 1716576102, "value": "10914" }, { "capabilityId": 275, "modificationDate": 1716884844, "value": "9985" }, { "capabilityId": 276, "modificationDate": 1716576102, "value": "0" }, { "capabilityId": 277, "modificationDate": 1716884361, "value": "91" }, { "capabilityId": 278, "modificationDate": 1716867793, "value": "0" }, { "capabilityId": 279, "modificationDate": 1716867793, "value": "0" }, { "capabilityId": 280, "modificationDate": 1716576100, "value": "10" }, { "capabilityId": 281, "modificationDate": 1716867793, "value": "0" }, { "capabilityId": 282, "modificationDate": 1716867793, "value": "0" }, { "capabilityId": 283, "modificationDate": 1716576102, "value": "0" }, { "capabilityId": 284, "modificationDate": 1716576102, "value": "0" }, { "capabilityId": 285, "modificationDate": 1716576102, "value": "0" }, { "capabilityId": 286, "modificationDate": 1716576102, "value": "0" }, { "capabilityId": 288, "modificationDate": 1716576102, "value": "2" }, { "capabilityId": 290, "modificationDate": 1716576105, "value": "[[0,255,0,4],[0,255,0,4],[0,255,0,4],[0,255,0,4],[0,255,0,4],[0,255,0,4],[0,255,0,4],[0,255,0,4],[0,255,0,4],[0,255,0,4]]" }, { "capabilityId": 291, "modificationDate": 1716576102, "value": "5" }, { "capabilityId": 292, "modificationDate": 1716642920, "value": "5" }, { "capabilityId": 293, "modificationDate": 1716887201, "value": "4" }, { "capabilityId": 305, "modificationDate": 1716884355, "value": "0" }, { "capabilityId": 307, "modificationDate": 1716576101, "value": "480" }, { "capabilityId": 308, "modificationDate": 1716576101, "value": "0" }, { "capabilityId": 309, "modificationDate": 1716576101, "value": "0" }, { "capabilityId": 310, "modificationDate": 1716576101, "value": "1" }, { "capabilityId": 311, "modificationDate": 1716576101, "value": "30" }, { "capabilityId": 312, "modificationDate": 1716642920, "value": "65.00000000000000000000" }, { "capabilityId": 313, "modificationDate": 1716576102, "value": "0" }, { "capabilityId": 314, "modificationDate": 1716576102, "value": "0" }, { "capabilityId": 315, "modificationDate": 1716576127, "value": "7200" }, { "capabilityId": 329, "modificationDate": 1716576099, "value": "1" }, { "capabilityId": 330, "modificationDate": 1716576100, "value": "15" }, { "capabilityId": 331, "modificationDate": 1716576101, "value": "1440" }, { "capabilityId": 332, "modificationDate": 1716576101, "value": "15" }, { "capabilityId": 333, "modificationDate": 1716576099, "value": "1440" }, { "capabilityId": 336, "modificationDate": 1716576100, "value": "15" }, { "capabilityId": 337, "modificationDate": 1716642856, "value": "6" }, { "capabilityId": 338, "modificationDate": 1716642856, "value": "0" }, { "capabilityId": 339, "modificationDate": 1716867817, "value": "1" }, { "capabilityId": 340, "modificationDate": 1716576100, "value": "1" }, { "capabilityId": 105011, "modificationDate": 1716576101, "value": "16141" }, { "capabilityId": 105012, "modificationDate": 1716576101, "value": "11" }, { "capabilityId": 105122, "modificationDate": 1716576101, "value": "0" }, { "capabilityId": 105300, "modificationDate": 1716576101, "value": "65.0000000000000000000" }, { "capabilityId": 105301, "modificationDate": 1716576101, "value": "50.0000000000000000000" }, { "capabilityId": 105304, "modificationDate": 1716576102, "value": "65.0000000000000000000" }, { "capabilityId": 105906, "modificationDate": 1716642922, "value": "100" }, { "capabilityId": 105907, "modificationDate": 1716642922, "value": "100" } ] } ], "gateways": [ { "id": "580070", "serialNumber": "1716-1285-4106", "isAlive": false, "setupId": 834019, "type": 1000 } ], "zones": [ { "id": 410779, "name": "zoneTechnique", "zoneType": 2, "numberOfDevices": 1 } ] } ] ```

Thx,

Hicham

hidrissi-hass commented 1 month ago

Hello,

In the Sauter Cozytouch application, I can change the target temperature. When I change it, only two sensors change : Capability_105906 and Capability_105907. They have the same value. Here are some corresponding values, but I couldn't get the rule.
The first value is the target temperature in celsius degre and the second is the sensor value.

Thx Hicham

gduteil commented 1 month ago

Hello, thank you for the JSON, I will check this week-end.

The 105906 an 105907 are probably a percentage between the min and max adjustment values (probably 15°->65°). I don't see why there are 2, maybe one is the target and the other one is the current value, if it's the case only one will be setable, we need to know which one.

If you are confortable modifying the scripts for testing I can tell you what to modify to add sliders for those 2 capabilities to see which one is accepted by the API.

hidrissi-hass commented 1 month ago

Hi,

I can do tests you ask for. Have you an idea about the conversion form the celsius degre to the sensor value (65°C --> 100) ? It's like conversion to fahrenheit minus 50.

gduteil commented 1 month ago

Ok I will send the details tomorrow.

Concerning the conversion, as I said I think it's a percentage between 15 and 65°C : 0=15°C, 100=65°C, each percent represents 0.5°C

hidrissi-hass commented 1 month ago

Thx,

some observations :

gduteil commented 1 month ago

Hi,

I just did some modifications in the main branch. To install it you need to select the integration in HACS, go to menu with the 3 dots in the top right corner and download it again, selecting the "main" version.

The Phazy should be identified and "Heating mode" should work. I also added some sensors for the weekdays progs.

Concerning the 105906 and 105907 I added 2 sliders ("Target 105906" and "Target 105907"), can you try to change then and see if one of them is accepted ?

About the Temp_22 and Temp_312, I think only one will be the current target temperature, can you check their history to see if and how they changed in the past days ?

hidrissi-hass commented 1 month ago
Hi, Thank you. It works fine. Concerning the 105906 and 105907 is not accepted. After some more tests : In Manual mode, when I change the target temperature in the app, the capability 231 change exactly the same way, in °C. In Prog mode, when I change the current temperature from the program is in the Cozytouch app, 22, 312, 105906 and 105907 change Cozytouch app % Cozytouch app °C 22, 312 105906, 105907
100% 65 60 65
90% 62 60 61.5
80% 58 58 57
70% 54 54 52.5
60% 50 50 48.5

An other comment concerns the Water Consumption, I have doubts. The value of that capability only change when the resistance is on (at night for me) and not when I use hot water. See the history Cauffe-eau_Screen_02062024

gduteil commented 1 month ago

Hi,

I think we need to set the device in "delegation" mode or similar to override the temperature when it's in "prog" mode. The target temperature seems to be the 231.

I think the first step will be to try to change the 231 in manual mode and see if it's accepted as the target temperature. Can you reinstall the main branch and see if it changes in manual mode ? there should be a new control called "Temp_231".

Concerning the water consumption, I think the Sauter Phazy is similar to the Atlantic Aqueo. We did some checks with another user recently and the conclusion was that there was no flowmeter on those devices, the water consumption reported by the API seems to be an estimation based on the internal temperature sensors, which is very approximative. The graph decreases on June 1st around 8pm, is it when you reinstalled the integration ?

The other user said the mobile app didn't report anymore the water consumption, with a message like "we are working on a fix", is it the case for you too ?

hidrissi-hass commented 1 month ago

Hi,

changing 231 in manual mode works fine.

The graph decreases on June 1st around 8pm, is it when you reinstalled the integration ?

Yes.

The other user said the mobile app didn't report anymore the water consumption, with a message like "we are working on a fix", is it the case for you too ?

Yes, I have the same message on the app.

I have noticed that : 105301 : the mini temperature for target 105304 : the max temperature for target 270 : the hot water V40 capacity in L 268 : the hot water V40 disponible in L

Thx,

gduteil commented 1 month ago

Hi,

I will add the mapping for 231, 268, 270 105301 and 105304.

Concerning the target temperature, there are probably some capabilities to set when you are not in "Manual" mode. When you try to change it with the app, does it ask you for an "Override" or "Délégation" time and temperature ?

About the water consumption, I'm afraid we won't be able to get a reliable value as there is no flowmeter. The only solution will be to use an external flowmeter or estimate the consumption using the main water counter a sensor to detect the hot water use and trigger the counting (hot water available ? other ?)

PS : I'm fine to continue in English, or we can switch to French if you want