andrea-mattioli / bticino_x8000_component

Additional component for home assistant for managing the bticino x8000 smart thermostat without the netatmo firmware.
9 stars 1 forks source link

Integration finding only one Thermostat #5

Closed johngianni closed 9 months ago

johngianni commented 9 months ago

Checks

The problem

Thank you for the nice integration. I removed the old add on and migrated to this new component without problems in the setup process. Unfortunately, the integration finds only "Piano Terra" thermostat, but I have also "Primo Piano" and "Secondo Piano" devices in my house. Primo Piano works perfectly, but I would like to know if there are additional configuration steps I'm missing. Thank you

On which thermostat you have the issue?

X8000

Which version of the Bticino X8000 component are you using?

O.1.0

Which version of Home Assistant are you using?

2024.1.6

What type of installation are you running?

Home Assistant OS

Anything in the logs that might be useful for me?

No response

Additional information

No response

andrea-mattioli commented 9 months ago

I tried with multiple thermostats and it works, once you have pasted the URL, on the next tab of the multiple choice of thermostats do you see only one? Can you tell me if the 2 thermistats are on the same plant ID or on separate plant IDs?

DjMayone commented 9 months ago

I confirm that also for me only one thermostat is listed. Both of them are under the same Legrand account/APP.

johngianni commented 9 months ago

I tried with multiple thermostats and it works, once you have pasted the URL, on the next tab of the multiple choice of thermostats do you see only one? Can you tell me if the 2 thermistats are on the same plant ID or on separate plant IDs?

I confirm that only one thermostat is shown after the paste link page. Same stands for the ID. In the app , they are all in the same house. Any log I could send you?

ivanlouis87 commented 9 months ago

Hi Andrea, Same with me (4 thermostats under same plant id and finding only one). I'm available for some debugging if needed.

Thanks, Ivano

johngianni commented 9 months ago

Hi, I think I've found the problem.

In file config_flow.py line 164 you try to update a dictionary with same key: plant_id remains the same, thus the dictionary item is updated not added. I suggest to modify with a i counter in the for loop to create a unique dictionary key for each thermostat. maybe?: thermostat_options.update( { thermo["id"]: {

andrea-mattioli commented 9 months ago

Yes, that's the problem, I'm reevaluating the code, because that change causes repercussions on other parts of the code. The problem is that I have no way to test the code, so I'll release a new version with some debugs, and we'll have to work with those to make a complete and clean run.

johngianni commented 9 months ago

here's the reply from the gettopology API (single plant with multiple thermostats):

{ "plant": { "modules": [ { "device": "chronothermostat", "id": "xxxxxxxxxxxxxxxe053-1e182d0adc81", "name": "Primo Piano", "capabilities": [ { "capability": "function", "canDo": { "command": { "do": true }, "request": { "do": true }, "notification": { "do": true } } }, { "capability": "mode", "canDo": { "command": { "do": true }, "request": { "do": true }, "notification": { "do": true } } }, { "capability": "setPoint", "canDo": { "command": { "do": true }, "request": { "do": true }, "notification": { "do": true } } }, { "capability": "programlist", "canDo": { "command": { "do": false }, "request": { "do": true }, "notification": { "do": false } } }, { "capability": "measures", "canDo": { "command": { "do": false }, "request": { "do": true }, "notification": { "do": true } } }, { "capability": "time", "canDo": { "command": { "do": false }, "request": { "do": true }, "notification": { "do": false } } } ] }, { "device": "chronothermostat", "id": "xxxxxxxxxxxx-f17a-xxxxxxxxxxxxxxxxx0db", "name": "Secondo Piano", "capabilities": [ { "capability": "function", "canDo": { "command": { "do": true }, "request": { "do": true }, "notification": { "do": true } } }, { "capability": "mode", "canDo": { "command": { "do": true }, "request": { "do": true }, "notification": { "do": true } } }, { "capability": "setPoint", "canDo": { "command": { "do": true }, "request": { "do": true }, "notification": { "do": true } } }, { "capability": "programlist", "canDo": { "command": { "do": false }, "request": { "do": true }, "notification": { "do": false } } }, { "capability": "measures", "canDo": { "command": { "do": false }, "request": { "do": true }, "notification": { "do": true } } }, { "capability": "time", "canDo": { "command": { "do": false }, "request": { "do": true }, "notification": { "do": false } } } ] }, { "device": "chronothermostat", "id": "xxxxxxxxxxxxx-4b42-xxxxxxxxxxxxxxxxxxx2f", "name": "Piano Terra", "capabilities": [ { "capability": "function", "canDo": { "command": { "do": true }, "request": { "do": true }, "notification": { "do": true } } }, { "capability": "mode", "canDo": { "command": { "do": true }, "request": { "do": true }, "notification": { "do": true } } }, { "capability": "setPoint", "canDo": { "command": { "do": true }, "request": { "do": true }, "notification": { "do": true } } }, { "capability": "programlist", "canDo": { "command": { "do": false }, "request": { "do": true }, "notification": { "do": false } } }, { "capability": "measures", "canDo": { "command": { "do": false }, "request": { "do": true }, "notification": { "do": true } } }, { "capability": "time", "canDo": { "command": { "do": false }, "request": { "do": true }, "notification": { "do": false } } } ] } ], "id": "xxxxxxxxxxx-30ec-0624-xxxxxxxxxxxxxxxx9", "name": "xxxxxxxxx" } }

andrea-mattioli commented 9 months ago

Let me know if it works, surely by now the saved database is compromised, you will have to uninstall and install again following the procedure.

johngianni commented 9 months ago

Confirmed working. Thank you very much