Closed xkelement closed 12 months ago
Once https://github.com/mag1024/bosch-alarm-homeassistant/pull/17 is merged, you should get some better error messages. I myself have tested with a B5512, and had no issues.
How long is your automation passcode? I know there are issues if it is less than 10 characters long
I tried different lengths 8,9,10,15 characters also alphanumeric or numbers only but every time same result. My fried have B8512G with same settings as I have and for him it worked for a first time. I also compared RSC settings with him but I did not found anything different in terms of automation or etherent configuration. If nothing I will wait for more detailed log maybe I will see then whats causing the error.
Are there any updates for your panel? I know people have had that fix things for them with other panels.
I did the firmware update few months ago but I check it today and in the meantime there was a newer version available. So I did the update (now I running on 3.14.012). You also did a new commit I see now more in the log unfortunately I was expecting error like this. Because when I try to log in it takes a few seconds to show the Failed to connect error so I assumed it was timed out and now I can see directly in log:
Traceback (most recent call last): File "/usr/local/lib/python3.11/asyncio/tasks.py", line 500, in wait_for return fut.result() ^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1112, in create_connection transport, protocol = await self._create_connection_transport( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1145, in _create_connection_transport await waiter asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/config/custom_components/bosch_alarm/config_flow.py", line 76, in try_connect await panel.connect(load_selector) File "/usr/local/lib/python3.11/site-packages/bosch_alarm_mode2/panel.py", line 168, in connect await self._connect(load_selector) File "/usr/local/lib/python3.11/site-packages/bosch_alarm_mode2/panel.py", line 245, in connect , connection = await asyncio.wait_for( ^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/asyncio/tasks.py", line 502, in wait_for raise exceptions.TimeoutError() from exc TimeoutError
I will try to investigate further what can cause this.
To confirm, you don't have anything else connected to your panel when this happens right? And does it let you in if you reboot your panel?
Correct, every time when I trying to connect I hang-up connection in RPS and nothing else, as I aware, is connected to the panel (via mode2). RPS connection works every time do not need to do a restart before and connection from HA never worked even after dozen of restarts. Every time request was timed out.
I will try some network analysis what happening on the network during that time when HA is trying to connect to panel but I need some time for it. Maybe I will do it through weekend.
Problem solved.
I did the analysis of initial connection. For the connection TLS protocol is used so I tried to create connection with openssl from host terminal. TLS handshake was OK so this was not a issue but I realize that it took some time to finish. It seemed to me as it took more than 10 seconds which was value of timeout set as argument of asyncio.wait_for function on line 249 in panel.py. I changed it to 100, restarted HA then tried to connect and it worked for a first time.
In my case connection was simply timed out before it could even be established.
So timeout time needs to be increased or maybe let user to pick it during initial config on the first form as optional parameter.
Probably just reasonable to increase it to 100, I don't think it really needs to be configurable
@xkelement: How long does it actually take for your panel? 100 might be too much for a user to have to wait for the results during the setup flow...
Yeah i did wonder what a reasonable number would be
Yes you right, just increase would be fine to not confuse somebody with maybe not so obvious parameter.
It didn't take much longer than 10 seconds but I didn't measured it after it started working. I guess is not more than 15 seconds. I put 100 only because I add 0 on to the end of 10 like quick fix it was not based on any real analysis. If it will not cause some another problem I think 30 seconds will be enough.
Hello, I trying to connect to B5512 panel but unfortunately I constantly receiving only "Failed to connect" error. I checked everything what I was thinking it can cause it. Even in BVMS (Bosch Video Management Software) in Configuration client I can see the panel which uses same Mode2 automation device and passcode. In BVMS it worked for a first time.
Is there any way to see more in the log for this integration then these 2 messages: 2023-10-31 21:23:20.538 DEBUG (MainThread) [bosch_alarm_mode2.panel] Panel created 2023-10-31 21:23:20.538 INFO (MainThread) [bosch_alarm_mode2.panel] Connecting to 192.168.0.40:7700...
Or did you encountered any problem with B5512 or additional settings in RPS which needs to be done on top of those mentioned in the reed me. Thanks.