Skip to main content

G90 Alarm system protocol

Project description

Github workflow status ReadTheDocs status Latest GitHub release 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.

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:

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.

  • 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 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.

Quick start

pip install pyg90alarm

Documentation

Please see online documentation for details on the protocol, its security, supported commands and the API package provides.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyg90alarm-1.16.0.tar.gz (55.4 kB view details)

Uploaded Source

Built Distribution

pyg90alarm-1.16.0-py3-none-any.whl (51.8 kB view details)

Uploaded Python 3

File details

Details for the file pyg90alarm-1.16.0.tar.gz.

File metadata

  • Download URL: pyg90alarm-1.16.0.tar.gz
  • Upload date:
  • Size: 55.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyg90alarm-1.16.0.tar.gz
Algorithm Hash digest
SHA256 ae7ed0f18f5cc2818590cb35aec2d28596e53617c7e83cf6ccfe298f9d8ccc35
MD5 cee80370cd162da9637c24532133b41e
BLAKE2b-256 98a51947915d083b2bbc0c8ecd24c4eee51da2a84c47aaaeec4a817131f6189d

See more details on using hashes here.

File details

Details for the file pyg90alarm-1.16.0-py3-none-any.whl.

File metadata

  • Download URL: pyg90alarm-1.16.0-py3-none-any.whl
  • Upload date:
  • Size: 51.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyg90alarm-1.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2325314f5b32d13603256b87c801a828478be949b3ec741c9810e3dafa0581b6
MD5 34960758d018d09dacbfb462e655a9a1
BLAKE2b-256 e1f93434d2137c9bde42d9822f70e29817736c53c6e839222f878268cd1d8952

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page