PowerMax+ connection issues
Almewty opened this issue · 14 comments
Hey, since the upgrade to the 0.9.6 versions I've been having some issues.
There are two distinct issues:
- It will not automatically engage PowerLink Mode. On 0.9.5 I had to enroll it once manually for PowerLink and afterwards it always worked. Since upgrading it needs to be manually enrolled after every reload (this will cause a fault in the visonic panel as the PowerLink connection can't be established, until I manually enroll). I rolled back to the 0.9.5 versions and establishing PowerLink mode works without problems.
- The Integration gives up connecting to the ESP when the connection between HomeAssistant and the ESP I've got connected to the Panel is interrupted. It won't work again until reloading the integration which in turn forces me to manually enroll it again. Even if the connection is available again after a few minutes.
I currently don't have any logs for these isses as I downgraded to 0.9.5, I can try to gather some logs for 0.9.6 if needed but the constant faulting + need to manually re-enroll is preventing me from staying on 0.9.6.
Edit: I did try the dev_b0 branch, just to check if it might fix my problem. But on that branch I can't establish any connection, not even Standard Plus
Hi,
- I assume you mean 0.8.5 and not 0.9.5. I have tweaked the sequence to be similar (but not the same) as 0.8.5.
- It doesn't automatically restart the integration on disconnection but you could easily create an automation in HA to achieve this. Use the disconnection HA Event as the trigger.
I've just releases "0.9.7.9 - English Translation File, Logic Updates and Bug Fixes" to dev_B0, if you get the chance please give it a try.
If you do have problems with either 1 or 2 above then I'm going to need a debug HA log file. Especially if you can't get the Standard Plus then a log file is the only way I can possibly help.
Thanks for the quick reply,
Yes I did mean 0.8.5, i mixed up the numbers. And thanks for the tip with the disconnect event, It won't be of any help to me unless the automatic PowerLink mode works (because the panel will still show a fault and beep without PowerLink connection) but that is good to know, I am kinda new to Homeassistant.
I tested a few different versions and collected logs (I hope these are the correct logs):
- 0.8.5.2:
setup.txt PowerLink was already enrolled, I did not enroll it again (Success) - 0.9.6.21:
setup_with_manual_enroll.txt I manually enrolled the panel after the setup (Success)
reload_after_successful.txt This was a reload after it hat a successful connection from the setup (Success)
reload_after_panel_timeout.txt I shut down Homeassistant, waited for the panel to fault because of the missing PowerLink connection and restarted Homeassistant (No PowerLink) - 0.9.7.9:
reload.txt It was already enrolled. (No connection at all)
reload_with_manual_enroll.txt I deleted the enrollment beforehand and manually enrolled it during the connecting process, the log messages continued endlessly (No connection at all)
For me a Failure means that it didn't properly connect and clear the fault on the panel, thus the panel continues to beep every minute. (I assume this means it did not get into PowerLink mode and stayed in standard/standard plus mode)
So it looks like the Powermax+ does not respond to a specific message type that I use.
I'll need to look at this in more detail, let me have a think 😃
I've created a pyvisonic.py file for you to try as a test, I assume that because you can use the dev_B0 then you can replace a single file from the zip below
pyvisonic.zip
I've tested it with my own PowerMax Pro panel and my test PowerMaster panel and they both work. However, I don't want to put it in a proper github release yet, this is just for you to try please. Please create a log file for me and put it in this thread,
Thanks
Dave
I've tried it, I can now connect to the Panel but I can't get a PowerLink connection
When I try to enroll the Panel it just times out
Logs:
inital_manual_enroll.txt
Hi,
I've gone through your log file so thanks for that as it helped a lot. I've just released dev_B0 0.9.8.0 as per the main forum
https://community.home-assistant.io/t/visonic-powermax-and-powermaster-integration/316702/538
Please give the 0.9.8.0 release a try
Dave
Hey,
I've been using the 0.9.8.0 version for a day now. It seems like it's working now.
I've got Powerlink connection and can arm and disarm from Homeassistant. Powerlink also persists across Homeassistant restarts/Integration reloads/network connection resets.
But I still can't get the reconnect functionality to work. I tried making an automation that listens to the visonic_alarm_panel_state
disconnected
event but I never seem to get a disconnected
event. Just connected
and panelupdate
events
I also tried to simply listen to the change of the panel to Unavailable
, but restarting there seems to be flaky at best
Any advice for that? I'm still learning how to handle Homeassistant
I tried making an automation that listens to the visonic_alarm_panel_state disconnected event but I never seem to get a disconnected event
I have to have a little chuckle when I read this because most people have this as a problem and can't resolve why it keeps disconnecting so I know it works. Set the log file settings to debug for this integration and let me see a log file of when you think you're getting a disconnection. Try disconnecting your ethernet / usb cable or if wifi turn off the router for 5 minutes, that should do it.
Dave,
after a fresh installation from the intergration and updating it to version 0.9.8.3, Powerlink is working again with my Powermax+. And it is reconnecting to Powerlink after each restart from H.A.
Hey, sorry it took me so long, I was on a trip.
I've updated to 0.9.9.3, everything seems good so far, the Problem with the disconnect event remains though.
wifi_restart.txt
I've attached a log where I simulated the problem I'm having. My ISP enrolls some configuration changes on my router during nights, during this time the router will briefly restart, I manually restarted my router to simulate it.
I observed the visonic_alarm_panel_state event via the developer tools but did not see anything
EDIT:
right after posting this I saw that it did send the disconnect event after a few minutes. See
wifi_restart_with_disconnect.txt
It works a workaround for now but I would prefer it if the disconnect event would fire sooner because the panel will start beeping at night for a while because of a lost Powerlink connection is lost (the ISP updates usually happen at night) and to me it seems like the integration knows that it disconnected earlier (in fact, by the time the integration reported the disconnect the wifi and connection was already working again)
Yes, the timeout is currently 4 minutes from when it last expects data from the panel
It creates a visonic_alarm_panel_state
event:
'panel': 0
'panel_id': 'alarm_control_panel.visonic_alarm'
'action': 'nopaneldata'
'state': 'disconnected'
As you can see in your 2nd log file. Telling the user that it has disconnected as it has not received panel data. This is defined on the wiki here in the last row of the table.
I used to have config settings for restarts and timeouts etc etc but I think that it's up to the user to create an automation in HA to determine what to do, with the likelihood of a reload
action and maybe an email or notification.
The I'm alive
messages are sent by the panel in Powerlink Mode at an interval of 30 to 40 seconds. In addition, after a few minutes of an interruption, some systems recover automatically and re-establish a connection, that is what the repeated attempts do in the log file (approx every 3 to 4 seconds) without restarting the whole integration. So I think that 4 minutes is a good compromise, and none of my panels start the annoying beeping noise within the 4 minutes, does your panel?
(in fact, by the time the integration reported the disconnect the wifi and connection was already working again)
That is 1 of the reasons for the 4 minutes, the Event in HA to Reload can be acted on straight and has a good chance of working.
I'm not sure what else you are suggesting to do? Options include:
- leave it as is
- leave it as is but in addition create another HA Event sooner (maybe 1 or 2 minutes) that says "The connection may have broken but I'm not sure" as that's what it would mean. Your wifi would probably not have restarted and so any action in HA would need to be timed anyway. I guess that some people may have their router connected to their HA as I have and can probably act straight away.
- change the 4 minutes to be earlier and have the same problem as the above bullet.
- I also used to indicate "PROBLEM" as the
state
attribute of the Alarm Entity for timeouts and the like but changed that as it wasn't consistent enough.
So I figured that 4 minutes is a good compromise, and I don't get the annoying beeping from the panels I have in this time.
I'm not sure if I'm understanding it correctly. I interpreted the [asyncio] socket.send() raised exception.
as trying to access a disconnected connection.
The device is available and can be reached though when the integration is re-trying the Powerlink enroll so to me it seemed like it tried the reconnect with the broken connection instead of establishing a new connection. So the reconnect seemed unnecessary to me.
I am no expert in python nor in homeassistant so it's entirely possible I'm misinterpreting this.
So I think that 4 minutes is a good compromise, and none of my panels start the annoying beeping noise within the 4 minutes, does your panel?
Yes, my Panel starts the beeping after 1 or 2 minutes at most once the integration lost connection. It continues to beep every minute or so until I get the disconnected event and reload the integration (which works with an automation listening to the event, thanks for that!)
I honestly don't know what the proper approach would be, of course sending an earlier event wouldn't help if the WIFI connection isn't restored in time, the restarts my router is experiencing are rather quick though most of the time so an event after 1 or 2 minutes would probably help me.
Can the connection recover after this error ERROR Connection Lost : disconnected because the Ethernet/USB connection was externally terminated. None
?
I interpreted that as the connection is broken and can't be restored.
I'm not sure if I'm understanding it correctly. I interpreted the [asyncio] socket.send() raised exception. as trying to access a disconnected connection.
You'd be correct but that exception is not propagated in to my integration so I do not know anything about it. The Integration still believes that it has a valid connection. Hence the attempts at reconnection. For cases where there is a disconnection then the integration stops and reports that it is disconnected.
Yes, my Panel starts the beeping after 1 or 2 minutes at most once the integration lost connection.
I honestly don't know what the proper approach would be, of course sending an earlier event wouldn't help if the WIFI connection isn't restored in time, the restarts my router is experiencing are rather quick though most of the time so an event after 1 or 2 minutes would probably help me.
Ah OK, I can look in to this further, I'll add it to my todo list. I could send 3 HA Events, one every minute and then users can create automations to count them and decide what to do. Until the 4 minute point where it disconnects.
Can the connection recover after this error ERROR Connection Lost : disconnected because the Ethernet/USB connection was externally terminated.
No. That is when I know that the connection has been broken i.e. the exception is propagated in to the integration.
Closing this issue, any further problems then create a new issue please