self.ALARM_STATE list index out of range
Closed this issue · 14 comments
For the past few days, I have been unable to load the Alarm.com component in Home Assistant. It appears to be getting an unexpected value from the ALARM_STATE. I don't know if the website was recently redesigned or not. I have confirmed via the Alarm.com website that the HA user is getting logged in ok. There are also no pop-ups that needed dismissing.
Please let me know if there is anything I can do to help troubleshoot.
Here is the full snippet from the log:
2017-08-04 12:12:01 ERROR (MainThread) [homeassistant.components.alarm_control_panel] Error while setting up platform alarmdotcom
Traceback (most recent call last):
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pyalarmdotcom/pyalarmdotcom.py", line 164, in async_login
self.state = tree.select(self.ALARM_STATE)[0].get_text()
IndexError: list index out of range
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
return fut.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
raise self._exception
File "/usr/lib/python3.4/asyncio/tasks.py", line 235, in _step
result = coro.send(value)
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/alarm_control_panel/alarmdotcom.py", line 42, in async_setup_platform
yield from alarmdotcom.async_login()
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/alarm_control_panel/alarmdotcom.py", line 68, in async_login
yield from self._alarm.async_login()
File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pyalarmdotcom/pyalarmdotcom.py", line 170, in async_login
'#{}'.format(self.ERROR_CONTROL))[0].attrs.get('value')
IndexError: list index out of range
What version fo HA are you running?
I faced a similar issue when running 0.49..I believe.
I may have to look at re-writing the plugin against the full site since it looks like they may be upgrading the PDA version of the site. This may take me awhile since I have to reverse engineer the site again.
its still been working for me so far, when did they change it? I had the api's working ok this weekend using the locks and stuff
Bad news about having to rewrite the plugin. If I can be of any help in testing, let me know.
I upgraded to HA 0.52.1 tonight, and the Alarm.com component loaded right up. I'll give it a few days, and see if it persists over a few restarts. But this is good news.
Unfortunately this hasn't survived a restart. It stopped working after the first restart, and hasn't come up again through several more restarts.
Looks like this is still an issue: home-assistant/core#12694
Logging in from the PDA site http://www.alarm.com/pda takes me to the rich mobile page after instead of the old rudimentary page.
Looping back in here too, it appears that they may have solved it in the HomeBridge-alarm.com project bryan-bartow/homebridge-alarm.com#67
I am buried at work right now and may not get a chance to fix it as quickly as we need too. I haven't had a chance to look over the changes made on the homebridge side either. If a PR is needed I will accept it and try to roll another release as quickly as I can.
I may have a bit of a solution that could help.
When you go to https://www.alarm.com/pda/ it redirects to https://www.alarm.com/pda/[SESSION_ID]/default.aspx
Once you log in it takes you to the
https://www.alarm.com/web/system/home
If you replace the url with the following
https://www.alarm.com/pda/[SESSION_ID]/main.aspx
Where the [SESSION_ID] is the one that was in the query on the original redirect.
You are taken to the old PDA screen where there is a state displayed and buttons to disarm and arm the alarm, without needing to scrape the new rich page...
The session was validated and authenticated when taken to web/system/home
Alright, I think I have it fixed. Thanks for the info @jpreiditsch. I have pushed a new release to pypi and it is now online. So if someone can quickly do a PR for home-assistant to bump the version number for the package we should be good to go.
Anyone else seeing a bunch of these in their logs?
Can not load login page from Alarm.com
1:08 PM core.py (ERROR)
Update of alarm_control_panel.alarmcom is taking over 10 seconds
1:08 PM core.py (WARNING)