Skip to content

etelford/rachio-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rachio PHP SDK

A simple client to interact with the Rachio irrigation control system. See http://rachio.readme.io/v1.0/docs/.

This package is compliant with PSR-2 and PSR-4.

System Requirements

This SDK requires PHP >= 5.5.0.

README Contents

The Rachio SDK may be installed through Composer.

composer require etelford/rachio

Make sure you're using Composer's autoload:

require_once('vendor/autoload.php');

First, import the class.

use ETelford\Rachio;

Next, create a new instance of Rachio and pass in your API key.

$rachio = new Rachio('your-api-key');

With a Rachio object created, you can do a number of things.

Get the id of the authorized user

$id = $rachio->personId();

This is merely a more friendly way of retrieving the authorized user from a Rachio instance. It is identical to doing:

$rachio = new Rachio('your-api-key');
$id = $rachio->personId;

Get the profile data for the authorized user

$person = $rachio->person();

Get all the devices associated with an account

$devices = $rachio->devices();

Get info for a specific device associated with an account

This method can accept a device id.

$devices = $rachio->devices();
$device = $rachio->device($devices[0]->id);

Since many people will have just a single Rachio system, the SDK will automatically use the first device in your account if you don't pass an id.

$device = $rachio->device();

Get the currently running schedule

$schedule = $rachio->currentSchedule($deviceId);

Or, use the default device.

$schedule = $rachio->currentSchedule();

Note: If the Rachio system isn't running, this will return null.

Get the upcoming schedules for the next two weeks

$schedule = $rachio->upcomingSchedule($deviceId);

Again, for the default device:

$schedule = $rachio->upcomingSchedule();

About

PHP Bindings for the Rachio API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages