Ciao, grazie mille per questo add-on fantastico. Dopo un po' di tentativi da niubbo sono riuscito a farlo funzionare.
Ho solo un problema sull'aggiornamento automatico dei dati rilevati dal termostato.
Mi spiego meglio: se la temperatura cambia non viene aggiornata automaticamente su HA, stessa cosa per gli altri dati compresi eventuali settaggi del termostato.
Ho notato che se apro l'interfaccia web dall'add-on e clicco su thermostats info tutto viene aggiornato invece.
Nel registro dell'addon ho trovato questi errori:
2023-01-26 16:38:24,389] ERROR in app: Exception on /info [GET]
Traceback (most recent call last):
File "/hassio_bticino_smarter/bticino.py", line 389, in get_status
chronothermostats = json.loads(response.text)['chronothermostats']
KeyError: 'chronothermostats'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/flask/app.py", line 2525, in wsgi_app
response = self.full_dispatch_request()
File "/usr/lib/python3.10/site-packages/flask/app.py", line 1822, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/lib/python3.10/site-packages/flask/app.py", line 1820, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/lib/python3.10/site-packages/flask/app.py", line 1796, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/hassio_bticino_smarter/bticino.py", line 165, in info
my_value_tamplate=rest()
File "/hassio_bticino_smarter/bticino.py", line 251, in rest
mode,function,state,setpoint,temperature,temp_unit,humidity,my_program_name,remaining_time,remaining_time_minutes = get_status(access_token,plantid,topologyid)
File "/hassio_bticino_smarter/bticino.py", line 419, in get_status
print("[Errno {0}] {1}".format(e.errno, e.strerror))
AttributeError: 'KeyError' object has no attribute 'errno'
172.30.32.1 - - [26/Jan/2023 16:38:24] "GET /info HTTP/1.1" 500 -
172.30.32.1 - - [26/Jan/2023 16:38:58] "GET /info HTTP/1.1" 200 -
172.30.32.1 - - [26/Jan/2023 16:42:09] "GET / HTTP/1.1" 200 -
172.30.32.1 - - [26/Jan/2023 16:42:13] "GET /info HTTP/1.1" 200 -
192.168.1.115 - - [26/Jan/2023 16:46:22] "GET / HTTP/1.1" 200 -
172.30.32.1 - - [26/Jan/2023 16:49:51] "GET /info HTTP/1.1" 200 -
172.30.32.1 - - [26/Jan/2023 16:58:24] "GET / HTTP/1.1" 200 -
Come vedete sono seguiti da letture corrette "forzate" da me cliccando su thermostats info.
Qualche idea?