davesmeghead / visonic

Visonic Custom Component for integration with Home Assistant
Apache License 2.0
92 stars 20 forks source link

Visonic component + HA 2021.7.1 - disconnects #41

Closed pbathuk closed 3 years ago

pbathuk commented 3 years ago

Hi, I use HA which I have just updated to 2021.7.1 and the latest master version of the custom component and am getting a constant restart loop of the component:

ERROR Connection Lost : disconnected due to exception Same Packet for 20 times in a row

I have a powermaster 30 and use a ethernet chip (USR iot device). I run HA via docker, but don't see that being an issue. It has been working perfectly for at least a year, as remember asking loads of questions and getting it all setup.

I will post my logs shortly to enable investigation.. however wondering if anything has changed in the past week or so that might cause some issues - either HA side or the integration side.

I will test using the current version of the integration with HA 2021.6 tonight as well.

pbathuk commented 3 years ago

The ethernet to serial I have is USR-TCP232-E2

davesmeghead commented 3 years ago

Nothing in that area has changed recently although I noticed in your error that it says 20 times in a row. This was updated to 40 times, are you using HACS to install the integration or using an old version of the integration? What version of the integration are you using? Can you please try 2 things:

  1. Disable the integration, wait at least 2 hours and then create/restart the integration
  2. Edit pyvisonic.py and change SAME_PACKET_ERROR on or around line 72 to 40000 and tell me what happens
pbathuk commented 3 years ago

logs (from the logs page):

2021-07-14 20:40:25 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration visonic which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-07-14 20:40:27 ERROR (SyncWorker_4) [homeassistant.components.octoprint] Endpoint: printer Failed to update OctoPrint status. Error: 403 Client Error: FORBIDDEN for url: http://192.168.87.33:80/api/printer
2021-07-14 20:40:27 ERROR (SyncWorker_4) [homeassistant.components.octoprint] Endpoint: job Failed to update OctoPrint status. Error: 403 Client Error: FORBIDDEN for url: http://192.168.87.33:80/api/job
2021-07-14 20:40:44 ERROR (SyncWorker_6) [homeassistant.components.influxdb] InfluxDB database is not accessible due to '401: {"code":"unauthorized","message":"Unauthorized"}'. Please check that the database, username and password are correct and that the specified user has the correct permissions set. Retrying in 60 seconds.
2021-07-14 20:41:11 ERROR (MainThread) [custom_components.visonic.pyvisonic] ERROR Connection Lost : disconnected due to exception Same Packet for 40 times in a row
2021-07-14 20:41:16 ERROR (MainThread) [custom_components.visonic.pyvisonic] Calling Exception handler.
2021-07-14 20:41:16 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating ping binary_sensor took longer than the scheduled update interval 0:00:05
2021-07-14 20:41:17 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Alarm Panel for switch
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 432, in async_unload
result = await component.async_unload_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 84, in async_unload_entry
return await component.async_unload_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry
raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!
2021-07-14 20:41:44 ERROR (SyncWorker_1) [homeassistant.components.influxdb] InfluxDB database is not accessible due to '401: {"code":"unauthorized","message":"Unauthorized"}'. Please check that the database, username and password are correct and that the specified user has the correct permissions set. Retrying in 60 seconds.
2021-07-14 20:41:50 ERROR (MainThread) [custom_components.visonic.pyvisonic] ERROR Connection Lost : disconnected due to exception Same Packet for 40 times in a row
2021-07-14 20:41:55 ERROR (MainThread) [custom_components.visonic.pyvisonic] Calling Exception handler.
2021-07-14 20:41:55 WARNING (MainThread) [homeassistant.components.binary_sensor] Updating ping binary_sensor took longer than the scheduled update interval 0:00:05
2021-07-14 20:41:57 ERROR (MainThread) [homeassistant.config_entries] Error unloading entry Alarm Panel for switch
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 432, in async_unload
result = await component.async_unload_entry(hass, self) # type: ignore
File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 84, in async_unload_entry
return await component.async_unload_entry(entry)
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 181, in async_unload_entry
raise ValueError("Config entry was never loaded!")
ValueError: Config entry was never loaded!

I found out I had incorrectly updated it (I use manual git clone). I am now on the latest version.

pbathuk commented 3 years ago

ok, so with the 40000 change (not the 2 hour wait thing i'm afraid - as the kids are asleep and if I turned off the integration the alarm bleeps like mad)

I get it all working now :) thank you

code_format: null
changed_by: None
code_arm_required: true
Panel Mode: Powerlink
Protocol Version: 1.0.10.2
Watchdog Timeout (Total): 0
Watchdog Timeout (Past 24 Hours): 0
Download Timeout: 0
Download Retries: 0
Panel Last Event: None
Panel Last Event Data: 
Zone: 0
Entity: null
Tamper: false
Siren: false
Reset: false
Time: '2020-01-01T00:00:00.0'
Count: 0
Type: []
Event: []
Mode: []
Name: []

Panel Alarm Status: None
Panel Trouble Status: None
Panel Siren Active: false
Panel Status: Disarmed
Panel Status Code: Disarmed
Panel Ready: Yes
Panel Alert In Memory: No
Panel Trouble: No
Panel Bypass: No
Panel Status Changed: No
Panel Alarm Event: No
Panel Armed: No
Power Master: Yes
Panel Model: PowerMaster30
Panel Type: 8
Model Type: 53
Panel Name: Unknown
Set Voice Option: Disable Voice
Auto Arm Option: Disable
Auto Arm Time: 12:00
Squawk Option: Disable
Time Format: Europe - 24H
Date Format: Europe DD/MM/YYYY
Entry Delay 1: 30 Seconds
Entry Delay 2: 1 Minute
Exit Delay: 30 Seconds
Bell Time: 10 Minutes
Abort Time: None
Alarm Cancel Time: 5 Minutes
Quick Arm: On
Bypass: No Bypass
Exit Mode: Normal
Piezo Beeps: Off when Home
Trouble Beeps: Off at Night
Panic Alarm: Audible Panic
Swinger Stop: After 2 Times
Cross Zoning: Off
Supevision Interval: 1 Hour
Not Ready: Normal
Auxiliary Keyfob Button function 1: Instant Arm
Auxiliary Keyfob Button function 2: Instant Arm
Jamming Detection: EN 30/60
Latchkey Arming: On
No Activity Time: Disable
Back Light Time: Off After 10 Seconds
Duress: 0000
Piezo Siren: On
Reset Option: User Reset
Tamper Option: Off
Siren On Line: Disable on Fail
Memory Prompt: Enable
Disarm Option: Any Time
Bell Report Option: EN Standard
Low Battery Acknowledge: On
Screen Saver: Reset By Code
Confirm Alarm Timer: 30 Minutes
AC Failure Report: 180 Minutes
User Permit: Enable
Autotest Time: 03:44
Autotest Cycle: Disable
1st Account No: XXXXXX
2nd Account No: XXXXXX
Report Format: Contact ID
4/2 Pulse Rate: 20 pps
Report to Central Station: Disable
Report Confirmed Alarm: Disable Report
Send 2wv Code: Don't Send
Two-Way Voice To Central Stations: Disable
Ringback Time: 1 Minute
Central Station Dialing Attempts: 8
Two-Way Voice - Private Phones: Enable
Reporting To Private Tel: Disable Report
Report To Pager: Disable Report
Recent Close Report: Off
Remote Access: On
Zone Restore: Don't Report
Upload Option: Any Time
Dialing Method: Tone (DTMF)
Line Failure Report: Immediately
System Inactive Report: Disable
Ambient Level: Low Level
GSM Install: Not Installed
GSM Report to SMS: Disable Report
GSM Line Failure: 5 Minutes
GSM Line Purpose: SMS Only
GSM Select Antenna: Internal antenna
PowerLink Failure: Disable Report
PGM Pulse Time: 2 Seconds
PGM By Arm Away: Disable
PGM By Arm Home: Disable
PGM By Disarm: Disable
PGM By Memory: Disable
PGM By Delay: Disable
PGM By Keyfob: Disable
PGM By Line Fail: No
PGM Act Zone A: Disable
PGM Act Zone B: Disable
PGM Act Zone C: Disable
Internal/Strobe Siren: Internal Siren
X10 House Code: B
X10 Flash On Alarm: No Flash
X10 Trouble Indication: Disable
X10 Report on Fail to Central Station 1: Disable
X10 Report on Fail to Central Station 2: Disable
X10 Report on Fail to Pager: Disable
X10 Report on Fail to Private: Disable
X10 Report on Fail to SMS: Disable
X10 Lockout Time (start HH:MM): 07:00
X10 3 Phase and frequency: Disable
Panel Serial: 0514373037.
Panel Eprom: J-701248 K17.131
Panel Software: JS702505 K17.131
Door Zones: Z01,Z04
Motion Zones: Z02,Z03,Z05,Z06
Smoke Zones: 
Other Zones: 
Devices: S00
Client Version: 0.6.10.2
Exception Count: 0
friendly_name: Visonic Alarm
supported_features: 7