pyg90alarm


Namepyg90alarm JSON
Version 1.10.1 PyPI version JSON
download
home_pagehttps://github.com/hostcc/pyg90alarm
SummaryG90 Alarm system protocol
upload_time2023-02-08 22:11:58
maintainer
docs_urlNone
authorIlia Sotnikov
requires_python>=3.7, <4
license
keywords g90 alarm protocol
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image::  https://github.com/hostcc/pyg90alarm/actions/workflows/main.yml/badge.svg?branch=master
   :target: https://github.com/hostcc/pyg90alarm/tree/master
   :alt: Github workflow status
.. image:: https://readthedocs.org/projects/pyg90alarm/badge/?version=stable
   :target: https://pyg90alarm.readthedocs.io/en/stable
   :alt: ReadTheDocs status
.. image:: https://img.shields.io/github/v/release/hostcc/pyg90alarm
   :target: https://github.com/hostcc/pyg90alarm/releases/latest
   :alt: Latest GitHub release
.. image:: https://img.shields.io/pypi/v/pyg90alarm
   :target: https://pypi.org/project/pyg90alarm/
   :alt: Latest PyPI version

Description
===========

Python package to control G90-based alarm systems.

Many manufacturers sell such systems under different brands - Golden Security,
PST, Kerui and others. Those are cheap low-end systems, typically equipped with
WiFi and possible GSM interfaces for connectivity, and support different range
of peripherals:

* Wired and wireless sensors
* Relays (switches)

... and probably others

The package implements asynchronous I/O over most of code paths using
`asyncio <https://docs.python.org/3/library/asyncio.html>`_.

Disclaimer
==========

The author has no affiliation or any relationship to any of the hardware
vendors in question. The code has been created upon many trial and error
iterations.

Motivation
==========

The primary motivation creating the code is the comfort of using the security
system - the mobile applications provided by the vendor, called "Carener", is
slow and crashes sometimes. Instead, it would be awesome to have the system
integrated into larger ecosystems, like Home Assistant, HomeKit and such.
Hence, the code has been created to interact with the security system using
Python, and it opens up a way for further integrations.

Supported hardware
==================

It mightn't possible to list every system supported by the package due to
manufacturers name the products differently.  Here is the list of hardware
known to work with the package:

* `PST G90B Plus <http://www.cameralarms.com/products/auto_dial_alarm_system/185.html>`_

And the list of sensors, actual set of device should be notable larger as many
of other manufacturers produce similar items. The names in parenthesis are
taken from the alarm system documentation, for example, `Home Alarm GB90-Plus <https://archive.org/details/HomeAlarmGB90-Plus/G90B%20plus%20WIFIGSMGPRS%20alarm%20system%20user%20manual/page/n7/mode/2up>`_.

* Wired PIR sensors
* Wireless PIR sensors (WPD01, WMS08)
* Door/window sensors (WDS07, WRDS01)
* Water leak sensors (LSTC01)
* Smoke sensors (WSD02)
* Gas sensors (WGD01)
* Switches/relays (JDQ)

Basically, the alarm system uses 433 MHz communications for the wireless
devices using EV1527, PT2262 protocols. The mobile application also mentions
some devices using 2.4GHz, although details of the protocols haven't been
identified as no such hardware has been available for experimentation.

Known caveats
=============

* Wireless shutter sensor (WRDS01) doesn't send anything on sensor closed, only
  when opened. In contrast, WDS07 wireless door sensor does both.
* Wireless relays (at least JDQ) use same RF code for switching on and off,
  when configured in toggle mode. That means a RF signal repeater will make
  controlling such relays unpredictable, since the code will be sent more than
  once.
* Low battery notifications for wireless sensors (at least for WDS07 and WSD02)
  are often missing, either due to the sensors not sending them or the device
  doesn't receive those.
* Wired sensors toggle on line state change, i.e. those aren't limited to have
  normal closed (NC) or normal open (NO) contacts only. Best used with NC
  contact sensors though, since an intruder cutting the line will trigger the
  alarm.

Enabling device notifications
=============================

There is a hidden device capability to send protocol notifications over the
WiFi interface. The notifications are done using broadcast UDP packets with
source/destination ports being ``45000:12901`` (non-configurable), and sent when
the device has IP address of its WiFi interface set to ``10.10.10.250``. That is
the same IP the device will allocate to the WiFi interface when AP (access
point is enabled). Please note enabling the AP *is not* required for the
notifications to be sent, only the IP address matters. Likely the firmware does
a check internally and enables those when corresponding IP address is found on
the WiFi interface.

Please see
`protocol documentation <https://pyg90alarm.readthedocs.io/en/stable/protocol.html>`_
for further details on the device notifications.

Depending on your network setup, ensuring the `10.10.10.250` IP address is
allocated to the WiFi interface of the device might be as simple as DHCP
reservation. Please check the documentation of your networking gear on how to
set the IP address allocation up.

.. note:: Since the IP address trick above isn't something the device exposes
   to the user, the functionality might change or even cease functioning upon a
   firmware upgrade!

.. note:: The device notifications in question are fully local with no
   dependency on the cloud or Internet connection on the device.

.. note:: If IP address trick doesn't work for you by a reason, the package
   will still be able to perform the key functions - for example, arming or
   disarming the panel, or reading the list of sensors. However, the sensor
   status will not be reflected and those will always be reported as inactive,
   since there is no way to read their state in a polled manner.

Quick start
===========

.. code:: shell

   pip install pyg90alarm

Documentation
=============

Please see `online documentation <https://pyg90alarm.readthedocs.io>`_ for
details on the protocol, its security, supported commands and the API package
provides.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hostcc/pyg90alarm",
    "name": "pyg90alarm",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7, <4",
    "maintainer_email": "",
    "keywords": "g90,alarm,protocol",
    "author": "Ilia Sotnikov",
    "author_email": "hostcc@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/05/f4/db239de5a2689bc047ea39b4f0cb454f7ec4a0b5df5ae7f9a09cf69566eb/pyg90alarm-1.10.1.tar.gz",
    "platform": null,
    "description": ".. image::  https://github.com/hostcc/pyg90alarm/actions/workflows/main.yml/badge.svg?branch=master\n   :target: https://github.com/hostcc/pyg90alarm/tree/master\n   :alt: Github workflow status\n.. image:: https://readthedocs.org/projects/pyg90alarm/badge/?version=stable\n   :target: https://pyg90alarm.readthedocs.io/en/stable\n   :alt: ReadTheDocs status\n.. image:: https://img.shields.io/github/v/release/hostcc/pyg90alarm\n   :target: https://github.com/hostcc/pyg90alarm/releases/latest\n   :alt: Latest GitHub release\n.. image:: https://img.shields.io/pypi/v/pyg90alarm\n   :target: https://pypi.org/project/pyg90alarm/\n   :alt: Latest PyPI version\n\nDescription\n===========\n\nPython package to control G90-based alarm systems.\n\nMany manufacturers sell such systems under different brands - Golden Security,\nPST, Kerui and others. Those are cheap low-end systems, typically equipped with\nWiFi and possible GSM interfaces for connectivity, and support different range\nof peripherals:\n\n* Wired and wireless sensors\n* Relays (switches)\n\n... and probably others\n\nThe package implements asynchronous I/O over most of code paths using\n`asyncio <https://docs.python.org/3/library/asyncio.html>`_.\n\nDisclaimer\n==========\n\nThe author has no affiliation or any relationship to any of the hardware\nvendors in question. The code has been created upon many trial and error\niterations.\n\nMotivation\n==========\n\nThe primary motivation creating the code is the comfort of using the security\nsystem - the mobile applications provided by the vendor, called \"Carener\", is\nslow and crashes sometimes. Instead, it would be awesome to have the system\nintegrated into larger ecosystems, like Home Assistant, HomeKit and such.\nHence, the code has been created to interact with the security system using\nPython, and it opens up a way for further integrations.\n\nSupported hardware\n==================\n\nIt mightn't possible to list every system supported by the package due to\nmanufacturers name the products differently.  Here is the list of hardware\nknown to work with the package:\n\n* `PST G90B Plus <http://www.cameralarms.com/products/auto_dial_alarm_system/185.html>`_\n\nAnd the list of sensors, actual set of device should be notable larger as many\nof other manufacturers produce similar items. The names in parenthesis are\ntaken from the alarm system documentation, for example, `Home Alarm GB90-Plus <https://archive.org/details/HomeAlarmGB90-Plus/G90B%20plus%20WIFIGSMGPRS%20alarm%20system%20user%20manual/page/n7/mode/2up>`_.\n\n* Wired PIR sensors\n* Wireless PIR sensors (WPD01, WMS08)\n* Door/window sensors (WDS07, WRDS01)\n* Water leak sensors (LSTC01)\n* Smoke sensors (WSD02)\n* Gas sensors (WGD01)\n* Switches/relays (JDQ)\n\nBasically, the alarm system uses 433 MHz communications for the wireless\ndevices using EV1527, PT2262 protocols. The mobile application also mentions\nsome devices using 2.4GHz, although details of the protocols haven't been\nidentified as no such hardware has been available for experimentation.\n\nKnown caveats\n=============\n\n* Wireless shutter sensor (WRDS01) doesn't send anything on sensor closed, only\n  when opened. In contrast, WDS07 wireless door sensor does both.\n* Wireless relays (at least JDQ) use same RF code for switching on and off,\n  when configured in toggle mode. That means a RF signal repeater will make\n  controlling such relays unpredictable, since the code will be sent more than\n  once.\n* Low battery notifications for wireless sensors (at least for WDS07 and WSD02)\n  are often missing, either due to the sensors not sending them or the device\n  doesn't receive those.\n* Wired sensors toggle on line state change, i.e. those aren't limited to have\n  normal closed (NC) or normal open (NO) contacts only. Best used with NC\n  contact sensors though, since an intruder cutting the line will trigger the\n  alarm.\n\nEnabling device notifications\n=============================\n\nThere is a hidden device capability to send protocol notifications over the\nWiFi interface. The notifications are done using broadcast UDP packets with\nsource/destination ports being ``45000:12901`` (non-configurable), and sent when\nthe device has IP address of its WiFi interface set to ``10.10.10.250``. That is\nthe same IP the device will allocate to the WiFi interface when AP (access\npoint is enabled). Please note enabling the AP *is not* required for the\nnotifications to be sent, only the IP address matters. Likely the firmware does\na check internally and enables those when corresponding IP address is found on\nthe WiFi interface.\n\nPlease see\n`protocol documentation <https://pyg90alarm.readthedocs.io/en/stable/protocol.html>`_\nfor further details on the device notifications.\n\nDepending on your network setup, ensuring the `10.10.10.250` IP address is\nallocated to the WiFi interface of the device might be as simple as DHCP\nreservation. Please check the documentation of your networking gear on how to\nset the IP address allocation up.\n\n.. note:: Since the IP address trick above isn't something the device exposes\n   to the user, the functionality might change or even cease functioning upon a\n   firmware upgrade!\n\n.. note:: The device notifications in question are fully local with no\n   dependency on the cloud or Internet connection on the device.\n\n.. note:: If IP address trick doesn't work for you by a reason, the package\n   will still be able to perform the key functions - for example, arming or\n   disarming the panel, or reading the list of sensors. However, the sensor\n   status will not be reflected and those will always be reported as inactive,\n   since there is no way to read their state in a polled manner.\n\nQuick start\n===========\n\n.. code:: shell\n\n   pip install pyg90alarm\n\nDocumentation\n=============\n\nPlease see `online documentation <https://pyg90alarm.readthedocs.io>`_ for\ndetails on the protocol, its security, supported commands and the API package\nprovides.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "G90 Alarm system protocol",
    "version": "1.10.1",
    "split_keywords": [
        "g90",
        "alarm",
        "protocol"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1b2a4bf36d44bce446c4be0b82778e90c78e1046af3b8fa652179c035af96e07",
                "md5": "c65522ed130693de3b2c334039b09049",
                "sha256": "d97f98f778820175e2f0ce70b11fdd0b82afb442463ffe807dada255b8bcd4c6"
            },
            "downloads": -1,
            "filename": "pyg90alarm-1.10.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c65522ed130693de3b2c334039b09049",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7, <4",
            "size": 44187,
            "upload_time": "2023-02-08T22:11:56",
            "upload_time_iso_8601": "2023-02-08T22:11:56.443267Z",
            "url": "https://files.pythonhosted.org/packages/1b/2a/4bf36d44bce446c4be0b82778e90c78e1046af3b8fa652179c035af96e07/pyg90alarm-1.10.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "05f4db239de5a2689bc047ea39b4f0cb454f7ec4a0b5df5ae7f9a09cf69566eb",
                "md5": "5f375d44fd4398d03e764e483a80a85c",
                "sha256": "82ae64d6fdf84f8da4ef0d580f0e9cd572ce127c6e76d759aebc73e72d07cccf"
            },
            "downloads": -1,
            "filename": "pyg90alarm-1.10.1.tar.gz",
            "has_sig": false,
            "md5_digest": "5f375d44fd4398d03e764e483a80a85c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7, <4",
            "size": 45051,
            "upload_time": "2023-02-08T22:11:58",
            "upload_time_iso_8601": "2023-02-08T22:11:58.413093Z",
            "url": "https://files.pythonhosted.org/packages/05/f4/db239de5a2689bc047ea39b4f0cb454f7ec4a0b5df5ae7f9a09cf69566eb/pyg90alarm-1.10.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-08 22:11:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "hostcc",
    "github_project": "pyg90alarm",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "pyg90alarm"
}
        
Elapsed time: 0.04994s