Git Product home page Git Product logo

pyalarmdotcom's Introduction

Alarm.com Python Library

version number: 0.3.2 author: Daren Lord

Overview

A simple library to interface with Alarm.com.

Mainly built for use with Home-Assistant

Installation / Usage

To install use pip:

$ pip install pyalarmdotcom

Or clone the repo:

$ git clone https://github.com/Xorso/pyalarmdotcom.git
$ python setup.py install

Contributing

TBD

Example

TBD

Changelog

0.3.1

  • Updated login response check to not look at the redirect page.

0.3.2

  • Merge 0.3.1 from pypi with repo on GitHub

pyalarmdotcom's People

Contributors

jnewland avatar lorddaren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyalarmdotcom's Issues

question about alarm.com and polling

My understanding is that Home Assistant when using pyalarmdotcom is issuing a query to alarm.com every 30 seconds. My question is: how does alarm.com feel about this usage; might they consider it to be abusive?

Thanks,
-Steve

Possible to get thermostat temperature?

Hello! Alarm.com has a z-wave thermostat. Would it be possible to modify the script to pull the temperature from it?

I will modify it if need be. I just need to know how you were able to find the event validation keys that are shown in your script. I figure if I can pull this, I'll be able to implement the thermostat.

Triggered State?

Hi! First thanks for this, I use it all the time in Home Assistant.

Is there a way to get a "triggered" state to go along with the armed-home, armed-away, and disarmed?

Alarm.com integration not loading

Alarm.com is not loading, and generating this error. This has been happening all day, even after a restart.


Error while setting up alarmdotcom platform for alarm_control_panel
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pyalarmdotcom/pyalarmdotcom.py", line 188, 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 "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/src/homeassistant/homeassistant/components/alarmdotcom/alarm_control_panel.py", line 48, in async_setup_platform
    await alarmdotcom.async_login()
  File "/usr/src/homeassistant/homeassistant/components/alarmdotcom/alarm_control_panel.py", line 70, in async_login
    await self._alarm.async_login()
  File "/usr/local/lib/python3.7/site-packages/pyalarmdotcom/pyalarmdotcom.py", line 197, in async_login
    '#{}'.format(self.ERROR_CONTROL))[0].attrs.get('value')
IndexError: list index out of range

ghostdriver.log causing fail to load

Been hitting this issue, very new to python and hass. I think it might be due to selenium setting the log_path if none is specified to a file vs. a dir path, thus the Permission Denied error code. Tried to edit selenium's service.py to test this, but the changes revert on a restart. Maybe you can help?

16-07-01 05:32:56 homeassistant.components.alarm_control_panel: Error while setting up platform alarmdotcom Traceback (most recent call last): File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 98, in _setup_platform discovery_info) File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/alarm_control_panel/alarmdotcom.py", line 36, in setup_platform password)]) File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/alarm_control_panel/alarmdotcom.py", line 47, in __init__ self._alarm = Alarmdotcom(username, password, timeout=10) File "/home/hass/.homeassistant/deps/pyalarmdotcom/pyalarmdotcom.py", line 82, in __init__ if not self._login(): File "/home/hass/.homeassistant/deps/pyalarmdotcom/pyalarmdotcom.py", line 95, in _login self._driver = webdriver.PhantomJS() File "/home/hass/.homeassistant/deps/selenium/webdriver/phantomjs/webdriver.py", line 51, in __init__ log_path=service_log_path) File "/home/hass/.homeassistant/deps/selenium/webdriver/phantomjs/service.py", line 50, in __init__ service.Service.__init__(self, executable_path, port=port, log_file=open(log_path, 'w')) PermissionError: [Errno 13] Permission denied: 'ghostdriver.log'

Suspect line from selenium's service.py (/home/hass/.homeassistant/deps/selenium/webdriver/phantomjs/service.py)

if not log_path: log_path = "ghostdriver.log"

Request for Frontpoint support

I would like to request support for FrontPoint, which uses Alarm.com to power their system behind the scenes.

In looking through the code in this repo, it looks like you are logging in and then scraping the html from the landing page. It works great on the surface, however, FrontPoint's interface appears to not have the CSS selectors like this library expects, so it appears to be fairly limited in terms of what kind of data it returns to Home Assistant.

I am not super clear on how to run this library standalone without Home Assistant, but if you give me a sample code snippet I can debug the selectors and hopefully get it working. Right now, my HA setup can only see the alarm state, but not the sensor state like I desire.

Consistent Errors on Home Assistant Startup

Just wondering if some tweaks can be made to stop these errors on startup:

  1. Can not get login page from Alarm.com

  2. Error doing job: Task exception was never retrieved
    Traceback (most recent call last):
    File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
    result = coro.send(None)
    File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 365, in _async_add_entity
    await entity.async_update_ha_state()
    File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 225, in async_update_ha_state
    self._async_write_ha_state()
    File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py", line 248, in _async_write_ha_state
    state = self.state
    File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/alarmdotcom/alarm_control_panel.py", line 83, in state
    if self._alarm.state.lower() == 'disarmed':
    AttributeError: 'NoneType' object has no attribute 'lower'

  3. Update of alarm_control_panel.alarm_com is taking over 10 seconds

  4. Can not load login page from Alarm.com

self.ALARM_STATE list index out of range

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

UI change

It seems their UI changed and I am getting this error now

Unable to find element with name 'ctl00$ContentPlaceHolder1$txtLogin

any help would be appreciated :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.