doudz / homeassistant-zigate

zigate component for Home Assistant
MIT License
48 stars 13 forks source link

After restarting HA zigate sensors do not appear #12

Closed jalme closed 5 years ago

jalme commented 5 years ago

It happens from time to time. On the log I see: " File "/config/deps/lib/python3.6/site-packages/zigate/core.py", line 244, in autoStart version = self.get_version() File "/config/deps/lib/python3.6/site-packages/zigate/core.py", line 622, in get_version self._version = self.send_data(0x0010, wait_response=0x8010).data AttributeError: 'NoneType' object has no attribute 'data'" After another restart it usually goes away.

doudz commented 5 years ago

Strange... seems that zigate don't answer , it's USB or wifi ? what platform ? (rpi, other)

jalme commented 5 years ago

wifi HA running on Ubuntu 18.04.1 LTS + Docker

pdecat commented 5 years ago

I believe I had a similar issue with the Zigate's Wifi module revision 1.3 that stops responding after some time. Unplugging it then re-plugging it resolved the issue. I'm back to using the USB-TTL module for now.

doudz commented 5 years ago

@jalme the first wifi module was buggy, many problem with it because of software UART, but I don't know if the firmware 1.3 solve the problem or just improve the module I supposed the problem is that we are connected to the wifi module but the wifi module isn't connected to zigate or in "bad" state.

doudz commented 5 years ago

Few months ago I made some tests using esp-link with good results https://github.com/jeelabs/esp-link

jalme commented 5 years ago

Thanks for looking into it. The wifi module for me is very stable. I'm using it 24x7 with no issues for two weeks. The only issue is when I restart HA I need to double check the logs to see if it rebooted correctly otherwise I need to restart again.

jalme commented 5 years ago

And I spoke to soon. Today huge amount of packet loos even with 1.3 wifi version of zigate.... Had to stop using wifi and go to USB-TTL. Now everything is ok but since my HA is on remote part of the house range is an issue....

jalme commented 5 years ago

btw feel free to close this issue. If this returns with USB-TTL I'll let you know and reopen it. Thanks for the insights.

doudz commented 5 years ago

@jalme if you want, could you enable debug log and post here the full log ?

logger:
  default: error
  logs:
    zigate: debug
jalme commented 5 years ago

Sure. btw I had to go to wifi again... Range is an issue since my HA is far away from some of the sensors and can't get all sensors to operate consistently. I'm enabling the log and will post the results as soon as the issue returns.

pdecat commented 5 years ago

I've just got the same error with:

2018-12-01 15:30:46 WARNING (SyncWorker_3) [zigate] No response after command 0x0010                                                                                                    
2018-12-01 15:30:46 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved                                                                       
Traceback (most recent call last):                                                                                                                                                      
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run                                                                                                         
    result = self.fn(*self.args, **self.kwargs)                                                                                                                                         
  File "/config/custom_components/zigate/__init__.py", line 200, in start_zigate                                                                                                        
    myzigate.autoStart()                                                                                                                                                                
  File "/config/deps/lib/python3.6/site-packages/zigate/core.py", line 260, in autoStart                                                                                                
    version = self.get_version()                                                                                                                                                        
  File "/config/deps/lib/python3.6/site-packages/zigate/core.py", line 642, in get_version                                                                                              
    self._version = self.send_data(0x0010, wait_response=0x8010).data                                                                                                                   
AttributeError: 'NoneType' object has no attribute 'data'                                                                                                                               

Restarting HA does not resolve the issue. Unplugging the zigate does not help either.

pdecat commented 5 years ago

Sorry for the noise, this happens when the port is incorrectly configured.

jalme commented 5 years ago

After switching to TTL no longer happening. Closing issue