biker91620 / ha-cozytouch

Cozytouch support for Home Assistant
GNU General Public License v2.0
16 stars 22 forks source link

TypeError: 'NoneType' object is not iterable #13

Open thundergreen opened 5 years ago

thundergreen commented 5 years ago

Hi Fellllaaa :)

Thanks again to keep this component up to date. I now get this error message in my logs

I cannot control the heater anymore. I am running latest homeassistant dev version 0.1.02.3 with cozytouch gateway

2019-11-20 21:32:52 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.downstairs_radiateur fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 270, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 450, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/cozytouch/climate.py", line 197, in update
    self.heater.update()
  File "/usr/local/lib/python3.7/site-packages/cozypy/objects.py", line 391, in update
    sensor.update()
  File "/usr/local/lib/python3.7/site-packages/cozypy/objects.py", line 390, in update
    for sensor in self.sensors:
TypeError: 'NoneType' object is not iterable
biker91620 commented 5 years ago

Can you update cozypy library. It should be fixed :)

thundergreen commented 5 years ago

Hey mate.. unfortunately this issue / error persists . I just tried to increase the temperature. Another thing: I get a fan mode which is obsolete for the heater. Is it somehow possible to "remove" unneeded options for the climate component?

I installed version 1.1.1 cozypy .

thundergreen commented 5 years ago

@biker91620 Sorry to bother but the component is still not working. Are you still on it?

Oniric75 commented 4 years ago

HEllo, i upgrade ha to the lastest upgrade yesterday, got issues with multiple plugin but managed to repair most of them expect for cozytouch (that i like a lot for my radiator!)

i have the exact same issue: first cozypi was missing, i upgrade ha-cozytouch plugin manually then added cozypi into the container. it repaired part of the issue : it start now but this morning i notice the error 2019-11-29 08:04:53 INFO (SyncWorker_3) [custom_components.cozytouch.climate] Update thermostat Chambre Ami Radiateur 2019-11-29 08:04:53 INFO (SyncWorker_4) [custom_components.cozytouch.switch] Update switch Chambre Gabrielle Radiateur 2019-11-29 08:04:53 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.chambre_ami_radiateur fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 270, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 450, in async_device_update await self.hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/cozytouch/climate.py", line 201, in update self.heater.update() File "/usr/local/lib/python3.7/site-packages/cozypy/objects.py", line 391, in update sensor.update() File "/usr/local/lib/python3.7/site-packages/cozypy/objects.py", line 390, in update for sensor in self.sensors: TypeError: 'NoneType' object is not iterable but it seems that the presence detector inside the radiator are still ok, only the climate seems to fail.

thanks for your great jobs ! are you thinking of pushing your addon to hacs one day ? would be great to not have to make upgrade manually anymore !

Oniric75 commented 4 years ago

btw if I can help to test, just ask for it :)

i tried to make cozypy work on standalone with your examples files and it works the issue seems to be somewhere else, but no clue how to find it. it seems to be through hass update calls ...

to make the examples works i had to change the example a little bite:

clientId = os.environ['COZYTOUCH_CLIENT_ID']
clientPassword = os.environ['COZYTOUCH_CLIENT_PASSWORD']

by

clientId = 'COZYTOUCH_CLIENT_ID'
clientPassword = 'COZYTOUCH_CLIENT_PASSWORD'
Oniric75 commented 4 years ago

@biker91620 @thundergreen i don't know if you received it too but apparently there will be a major update of the cozytouch... let's hope it wont break the api. @thundergreen do you still have the issue too ? or did you find a fix ? i'm kinda stuck, i will try this weekend to set HA in debug mode and attach visual code to the cozytouch plugin and hope i will have a lead. if by any chance i found out something i will of course keep you inform

thundergreen commented 4 years ago

@Oniric75 unfortunately I did not find a fix yet. It just is broke. maybe @biker91620 could give a statement? And yessss there will be a major update.. got the email today. We hope the best. The only chance is to shutdown the cozytouch for the time the update is programmed :) But i will risk the update as this component is not a MUST HAVE but a nice gimick :)

Oniric75 commented 4 years ago

issue seems to have fixed itself ! or @biker91620 made a update i didnt see, i upgrade to 0.103.2 and re install cozytouch plugin and i got values again !

Oniric75 commented 4 years ago

and ... it came back ... that's so weird ... i will try to find some time to set hass in debug mode to understand what is happening. @biker91620 some help would be so much appreciate ! if you have a tipee or something like that i would be happy to participate to it

Oniric75 commented 4 years ago

this patch fix the issue: https://github.com/biker91620/cozypy/pull/4 @biker91620 could you merge this pull request on cozypy ?

Oniric75 commented 4 years ago

@thundergreen patch this above request into your local repo and everything work find again :)