pyalarmdotcom / alarmdotcom

Custom component to allow Home Assistant to interface with Alarm.com
MIT License
119 stars 36 forks source link

Unable to setup system ID error #34

Closed brushj closed 3 years ago

brushj commented 3 years ago
Logger: pyalarmdotcomajax.pyalarmdotcomajax
Source: /usr/local/lib/python3.8/site-packages/pyalarmdotcomajax/pyalarmdotcomajax.py:148
First occurred: 4:52:14 PM (1 occurrences)
Last logged: 4:52:14 PM

Unable to extract system id from Alarm.com

I am assuming that is also what is causing the error below. Issue popped up in the last 24 hours.


Source: custom_components/alarmdotcomajax/alarm_control_panel.py:133
Integration: Alarm control panel (documentation, issues)
First occurred: 4:52:14 PM (1 occurrences)
Last logged: 4:52:14 PM

Error while setting up alarmdotcomajax platform for alarm_control_panel
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 200, in _async_setup_platform
    await asyncio.shield(task)
  File "/config/custom_components/alarmdotcomajax/alarm_control_panel.py", line 85, in async_setup_platform
    await alarmdotcom.async_login()
  File "/config/custom_components/alarmdotcomajax/alarm_control_panel.py", line 133, in async_login
    await self._alarm.async_login()
  File "/usr/local/lib/python3.8/site-packages/pyalarmdotcomajax/pyalarmdotcomajax.py", line 143, in async_login
    self._systemid = json["data"][0]["id"]
KeyError: 'data'```
uvjustin commented 3 years ago

I haven't seen this on my portal. Which ADC provider are you using? Have you noticed any differences when logging in to their web portal?

brushj commented 3 years ago

Provider is Qolsys. I do get a prompt to enable 2FA but it lets me skip. Not sure if I should just enable it or what

uvjustin commented 3 years ago

Follow the instructions here: https://github.com/uvjustin/alarmdotcom#two-factor-authentication

icu814 commented 3 years ago

I am getting the same error regarding the system ID. I have followed the TFA instructions and added my cookie to the configuration. My instance of this custom component was just updated to the latest version and this error still persists.

Logger: pyalarmdotcomajax.pyalarmdotcomajax Source: /usr/local/lib/python3.8/site-packages/pyalarmdotcomajax/pyalarmdotcomajax.py:170 First occurred: 8:55:25 PM (1 occurrences) Last logged: 8:55:25 PM

Unable to extract system id from Alarm.com

I have no issues logging into the portal or using my mobile device with the ADC app.

brushj commented 3 years ago

I will try setting up 2FA just in case and report back

aechelon commented 3 years ago

Are you sure Qolsys is your provider?
What website do you log into to change your alarm settings? That's typically branded by your provider (e.g. Brinks, ADT, etc)

brushj commented 3 years ago

Yep, that is the name at the top of the app and on my system.

brushj commented 3 years ago

So I guess since I am being prompted for it in the app now it is required in order for me to use the add-on. I set it up and went through the steps and it is working again.

uvjustin commented 3 years ago

@brushj Glad you were able to get it working. @icu814 The 2FA setup has been working fine for other users for a while now and @brushj was able to get it working too. Maybe try setting it up again?

icu814 commented 3 years ago

Let me give it a try. Looks like the app is now asking me for 2FA. @brushj did you skip 2FA in the app also or actually set up a second factor?

brushj commented 3 years ago

@icu814 I got the prompt as I previously did not have it enabled. I had to enable it for it to work.

icu814 commented 3 years ago

@brushj So, enable 2FA in the app and skip it in the browser? I just want to make sure that I replicate your steps to get this working again.

icu814 commented 3 years ago

@uvjustin @brushj I enabled SMS-based 2FA in the ADC app, logged into my portal through the browser, entered the SMS code, trusted my browser, and reconfigured ADC in my configuration.yaml file. Seems to be working now.

brushj commented 3 years ago

I enabled it in the app and then signed into alarm.com through the web portal in Chrome with the two factor code.

After you auth with the 2FA on Chrome, go to View > Developer> and select Developer tools

In the box that pops up on the right click the >> and choose Application Under Storage expand Cookies and click on alarm.com and look for two_factor_cookie copy the result there. Put that into your config.

Also make sure you have no other older alarmdotcom custom components in your HA. Code should look similar to below and if you had any other custom components remove those and restart first.

  - platform: alarmdotcom
    username: YOUR_USERNAME
    password: YOUR_PASSWORD
    two_factor_cookie: "0000111122223333444455556666777788889999AAAABBBBCCCCDDDDEEEEFFFF0000"
brushj commented 3 years ago

I am going to close this since both of us were able to figure it out.

I will say that a note should probably be added to the documentation that says if your app is asking for 2FA it will be required to use the add-on at this point.