mag1024 / bosch-alarm-homeassistant

Integration for Bosch Alarm panels that use the mode2 protocol: Solution, B/G series, AMAX
22 stars 4 forks source link

Bosch b4512 Authentication failed: Not Authorized #29

Open turnrye opened 8 months ago

turnrye commented 8 months ago

Hi! Very excited for this repo. Im having trouble setting up the integration for mine alarm.

When I try to setup the integration, I receive this error when setting the automation pass:

Logger: bosch_alarm_mode2.panel
Source: custom_components/bosch_alarm/config_flow.py:77
Integration: bosch_alarm
First occurred: 17:03:42 (1 occurrences)
Last logged: 17:03:42

busy flag: 1

Logger: custom_components.bosch_alarm.config_flow
Source: custom_components/bosch_alarm/config_flow.py:77
Integration: bosch_alarm
First occurred: 17:03:43 (1 occurrences)
Last logged: 17:03:43

Authentication failed: Not Authorized
Traceback (most recent call last):
  File "/config/custom_components/bosch_alarm/config_flow.py", line 77, in try_connect
    await panel.connect(load_selector)
  File "/usr/local/lib/python3.11/site-packages/bosch_alarm_mode2/panel.py", line 171, in connect
    await self._connect(load_selector)
  File "/usr/local/lib/python3.11/site-packages/bosch_alarm_mode2/panel.py", line 257, in _connect
    await self._authenticate()
  File "/usr/local/lib/python3.11/site-packages/bosch_alarm_mode2/panel.py", line 398, in _authenticate
    await self._authenticate_automation_user(user_type)
  File "/usr/local/lib/python3.11/site-packages/bosch_alarm_mode2/panel.py", line 359, in _authenticate_automation_user
    raise PermissionError("Authentication failed: " + error)
PermissionError: Authentication failed: Not Authorized

I tried multiple passwords and continued to receive this same error.

How can I troubleshoot this more?

sanjay900 commented 8 months ago

Check what your automation passcode is set to using A-Link, and make sure it's set to something that is at least 10 characters long

turnrye commented 8 months ago

Check what your automation passcode is set to using A-Link, and make sure it's set to something that is at least 10 characters long

Thanks -- I dont manage the panel, I was working with my local alarm company. I'll need to research whats needed to manage it myself via A-Link. If you have any references you'd suggest for getting started, they're more than welcome!

On the phone with the installer, he and I remotely tried two passphrases: one that was 24 chars with letters, numbers, and "=", and one that was 11 chars with numbers and "?". Is it worth trying again with just numbers? The installer confirmed that the automation mode was set to "Mode 2".

sanjay900 commented 8 months ago

Oh wait, the b4512 panels would be managed via RPS, not A-Link my mistake. I don't have much experience in that area - I mostly work with solution panels which use a different tool. The installer can probably get you everything necessary to connect to the panel over RPS.

turnrye commented 8 months ago

Oh wait, the b4512 panels would be managed via RPS, not A-Link my mistake. I don't have much experience in that area - I mostly work with solution panels which use a different tool. The installer can probably get you everything necessary to connect to the panel over RPS.

Thank you -- I'll give that a shot. Once I have access to control it via RPS, would you suggest that I just try different character combinations of automation passcodes? I'm still uncertain as to what the next step should be in troubleshooting this error state.

sanjay900 commented 8 months ago

Yeah, and maybe work out what firmware version your on as well.

As a test I've successfully used 1234567890 as an automation code, though I'm quite sure any code should work.

mag1024 commented 8 months ago

Also, please note that many of these panels only support a single connection at a time, so you need to stop any other Bosch apps, etc, for the integration to work. busy flag: 1 indicates that the connection is rejected because there is already an another connection active - so it may not really be an authentication issue at all.

sanjay900 commented 8 months ago

That is a very good point, didn't even cross my mind as the panels that do allow more than one connection still give that error

sanjay900 commented 8 months ago

I presume the company managing the alarm is remotely connected to it (or you have an app running), might want to get them to close the connection and disconnect from the mobile app and try again.

If they were configuring it live, it very well may have just been that their connection to the panel was using up the only authentication slot which would cause problems with logging in

ashtonaut commented 8 months ago

Does this integration support logging when a failure occurs due to the single authentication slot being used? I currently have this HA integration with a Solution 2000 panel, and I'm also using the Bosch RSC+ cloud platform and app, is this likely to cause issues?

sanjay900 commented 8 months ago

You would see errors when using the integration in the home assistant logs

However the solution series is a bit different, there's a new firmware that allows up to 4 concurrent connections that should be released soon