Skip to content

Jaqueeee/ajax-systems-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AjaxSystemsApi

Latest Version on Packagist Software License Quality Score

API client for ajax.systems security system

Warning Library in unstable state now and will be changed during development

Cases current library covers

(Sublists contain cases when library potentially can be used)

  • Turn on/off WallSwitches
    • Turn on/off lights/boiler/irrigation connected to WallSwitch with CRON
    • Ignite a TNT connected to WallSwitch on some external event
  • Arm/disarm/partially arm (night mode)
    • Arm/disarm your Hub with CRON
  • Send panic
    • Send panic to Hub on some external event
  • Get Hub's raw data
    • Get battery charge of all sensors daily and send notification to user's email with CRON
    • Get temperature of some room's sensor to turn on room's heater
    • Get power consumption of WallSwitch connected device to store statistics
    • Self-test script to check important sensors settings and send notification to user's email if some important settings was changed since last time
  • Read raw log
    • Track HUB events for home automation
    • Backup events to external source
  • Get Hub's SIM card balance
    • Track and warn user if balance is low
    • Track and automatically add money to balance (pay via some service) if balance is low
  • Get logged in user data

Installation

composer require igormukhingmailcom/ajax-systems-api

Usage

<?php

require('vendor/autoload.php');

use Mukhin\AjaxSystemsApi\AjaxSystemsApiClient;
use Mukhin\AjaxSystemsApi\Exception\Exception;

$ajaxSystemsClient = new AjaxSystemsApiClient();

try {
    $ajaxSystemsClient->login('login', 'password');
    $ajaxSystemsClient->getCsaConnection();
    $ajaxSystemsClient->setArm(AjaxSystemsApiClient::ARM_STATE_PARTIAL, 'hub id');
    echo "Partially armed";
} catch (Exception $e) {
    echo $e->getMessage();
}

Contribution

Testing / running examples

composer install

# Put your credentials to credentials.php
cp examples/credentials.php.dist examples/credentials.php
nano examples/credentials.php

# Go to any example an run it
cd examples/arm
php index.php

TODO

  • Turn on/off Ajax Relay if this supported by app.ajax.systems (haven't this device to play with)
  • Turn on/off Ajax Socket if this supported by app.ajax.systems (haven't this device to play with)
  • Convert RAW data to objects
  • Save objects
  • SSE (server-sent events)
  • Symfony bundle

About

Library to work with ajax.systems API

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%