Crash HA. WARNING (MainThread) [asyncio] socket.send() raised exception

Since version 0.116x I encounter frequent crashes, before that no stability issue at all.

Hopefully someone can point me in the right direction to troubleshoot this, because the log is not that helpful. I did enable debug logging for the Visonic Alarm system, but I have the impression that the stability issue is not related to the Visonic integration.

Currently running 0.117.x

Below a selection of the log;

2020-10-29 23:26:38 INFO (MainThread) [custom_components.visonic.pyvisonic] [data receiver] *** Received validated message 0XAB ***
2020-10-29 23:26:38 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [Sending ack] PowerlinkMode=True    Is PM Ack Reqd=True    This is an Ack for message=0XAB
2020-10-29 23:26:38 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [handle_msgtypeAB]  data 03 00 1e 00 34 36 30 36 00 00 43 
2020-10-29 23:26:38 INFO (MainThread) [custom_components.visonic.pyvisonic] [handle_msgtypeAB] ***************************** Got PowerLink Keep-Alive ****************************
2020-10-29 23:26:38 INFO (MainThread) [custom_components.visonic.pyvisonic] =============================================== Display Status ===============================================
2020-10-29 23:26:38 INFO (MainThread) [custom_components.visonic.pyvisonic]      key 0  Sensor id=1  dname=Z01  stype=Magnet   zname=Front door     ztypeName=Delay 1    ztamper=0  ztrip=0  bypass=0  lowbatt=0  status=0  tamper=0  enrolled=1  triggered=0 
2020-10-29 23:26:38 INFO (MainThread) [custom_components.visonic.pyvisonic]      key 1  Sensor id=2  dname=Z02  stype=Motion   zname=Hall           ztypeName=Delay 1    ztamper=0  ztrip=0  bypass=0  lowbatt=0  status=0  tamper=0  enrolled=1  triggered=0 
2020-10-29 23:26:38 INFO (MainThread) [custom_components.visonic.pyvisonic]      key 2  Sensor id=3  dname=Z03  stype=Motion   zname=Dining room    ztypeName=Perimeter  ztamper=0  ztrip=0  bypass=0  lowbatt=0  status=0  tamper=0  enrolled=1  triggered=0 
2020-10-29 23:26:38 INFO (MainThread) [custom_components.visonic.pyvisonic]      key 3  Sensor id=4  dname=Z04  stype=Motion   zname=Living room    ztypeName=Perimeter  ztamper=0  ztrip=0  bypass=0  lowbatt=0  status=0  tamper=0  enrolled=1  triggered=0 
2020-10-29 23:26:38 INFO (MainThread) [custom_components.visonic.pyvisonic]    Model PowerMax Pro           PowerMaster No                     LastEvent None                   Ready   Yes          
2020-10-29 23:26:38 INFO (MainThread) [custom_components.visonic.pyvisonic]    Mode  Powerlink              Status      Disarmed               Armed     No                     Trouble None              AlarmStatus None        
2020-10-29 23:26:38 INFO (MainThread) [custom_components.visonic.pyvisonic] ==============================================================================================================
2020-10-29 23:26:38 WARNING (MainThread) [asyncio] socket.send() raised exception.
2020-10-29 23:26:38 WARNING (MainThread) [asyncio] socket.send() raised exception.
2020-10-29 23:26:38 WARNING (MainThread) [asyncio] socket.send() raised exception.
2020-10-29 23:26:38 WARNING (MainThread) [asyncio] socket.send() raised exception.
2020-10-29 23:26:38 WARNING (MainThread) [asyncio] socket.send() raised exception.
2020-10-29 23:26:38 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [pmSendPdu] Sending Command (Ack Long)    raw data 0d 02 43 ba 0a    waiting for message response []
2020-10-29 23:26:38 WARNING (MainThread) [asyncio] socket.send() raised exception.
2020-10-29 23:26:38 WARNING (MainThread) [asyncio] socket.send() raised exception.
2020-10-29 23:26:38 WARNING (MainThread) [asyncio] socket.send() raised exception.
2020-10-29 23:26:38 WARNING (MainThread) [asyncio] socket.send() raised exception.
2020-10-29 23:26:38 WARNING (MainThread) [asyncio] socket.send() raised exception.
2020-10-29 23:26:38 WARNING (MainThread) [asyncio] socket.send() raised exception.
2020-10-29 23:26:38 WARNING (MainThread) [asyncio] socket.send() raised exception.
2020-10-29 23:26:38 WARNING (MainThread) [asyncio] socket.send() raised exception.
2020-10-29 23:26:39 INFO (MainThread) [homeassistant.components.websocket_api.http.connection.1689958840] Connection closed by client
2020-10-29 23:26:39 WARNING (MainThread) [asyncio] socket.send() raised exception.
2020-10-29 23:26:39 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [pmSendPdu] Sending Command (Ack Long)    raw data 0d 02 43 ba 0a    waiting for message response []
2020-10-29 23:26:40 DEBUG (MainThread) [custom_components.visonic.pyvisonic] [pmSendPdu] Sending Command (Ack Long)    raw data 0d 02 43 ba 0a    waiting for message response []
2020-10-29 23:26:40 INFO (MainThread) [homeassistant.components.automation.4_1_0_sync_state_switch_tv_front_end_with_reality] 4.1.0 Sync state switch tv front-end with reality: Running automation actions
2020-10-29 23:26:40 INFO (MainThread) [homeassistant.components.automation.4_1_0_sync_state_switch_tv_front_end_with_reality] 4.1.0 Sync state switch tv front-end with reality: Executing step call service
2020-10-29 23:26:40 INFO (MainThread) [homeassistant.components.system_log.external] 4.1.0 The state of Ping 10.58.60.16 binary_sensor.ping_10_58_60_16 changed from on to on
2020-10-29 23:26:40 INFO (MainThread) [homeassistant.components.automation.4_1_0_sync_state_switch_tv_front_end_with_reality] 4.1.0 Sync state switch tv front-end with reality: Executing step call service
2020-10-29 23:26:40 INFO (SyncWorker_30) [homeassistant.components.python_script] Executing set_state.py: {'entity_id': 'switch.tv_toggle', 'state': 'on'}
2020-10-29 23:26:40 INFO (SyncWorker_30) [homeassistant.components.python_script.set_state.py] switch.tv_toggle: state> on

Have you removed the custom component ?

Good point :slight_smile:

Will remove it now, and let it run for a while and report back

Did you ever found out where it was coming from?

looking at the time of your post you’re running localtuya 5.2.0 update to 5.2.1 or later.

Any solution on that please ?