Device module

Device module handling /device/ API calls.

class rachiopy.device.Device(authtoken: str, http_session=None, timeout=25)

Device class with /device/ API calls.

current_schedule(dev_id: str)

Retrieve current schedule running, if any.

For more info of the content in the response see: https://rachio.readme.io/docs/publicdeviceidcurrent_schedule

Parameters:

dev_id (str) – Device’s unique id

Returns:

The return value is a tuple of (response, content), the first being and instance of the httplib2.Response class, the second being a string that contains the response entity body (Python object if it contains JSON).

Return type:

tuple

event(dev_id: str, starttime: int, endtime: int)

Retrieve events for a device entity.

For more info of the content in the response see: https://rachio.readme.io/docs/publicdeviceideventstarttimestarttimeendtimeendtim

Parameters:
  • dev_id (str) – Device’s unique id

  • starttime (int) – Query start time milliseconds unix epoch

  • endtime (int) – Query end time milliseconds unix epoch

Returns:

The return value is a tuple of (response, content), the first being and instance of the httplib2.Response class, the second being a string that contains the response entity body (Python object if it contains JSON).

Return type:

tuple

forecast(dev_id: str, units='US')

Retrieve current and predicted forecast.

For more info of the content in the response see: https://rachio.readme.io/docs/publicdeviceidforecastunitsunits

Parameters:
  • dev_id (str) – Device’s unique id

  • units (str) – Forecast data units, one of US or METRIC, defaults to US

Returns:

The return value is a tuple of (response, content), the first being and instance of the httplib2.Response class, the second being a string that contains the response entity body (Python object if it contains JSON).

Return type:

tuple

get(dev_id: str)

Retrieve the information for a device entity.

For more info of the content in the response see: https://rachio.readme.io/docs/publicdeviceid

Parameters:

dev_id (str) – Device’s unique id

Returns:

The return value is a tuple of (response, content), the first being and instance of the httplib2.Response class, the second being a string that contains the response entity body (Python object if it contains JSON).

Return type:

tuple

pause_zone_run(dev_id: str, duration: int)

Pause a zone run for device.

For more info of the content in the response see: https://rachio.readme.io/docs/publicdevicepause_zone_run

Parameters:
  • dev_id (str) – Device’s unique id

  • duration (int) – Duration in seconds (Range is 0 - 3600 (1 hour) )

Returns:

The return value is a tuple of (response, content), the first being and instance of the httplib2.Response class, the second being a string that contains the response entity body (Python object if it contains JSON).

Return type:

tuple

rain_delay(dev_id: str, duration: int)

Rain delay device.

For more info of the content in the response see: https://rachio.readme.io/docs/devicestop_water

Parameters:
  • dev_id (str) – Device’s unique id

  • duration (int) – Duration in seconds (Range is 0 - 604800 (7 days) )

Returns:

The return value is a tuple of (response, content), the first being and instance of the httplib2.Response class, the second being a string that contains the response entity body (Python object if it contains JSON).

Return type:

tuple

resume_zone_run(dev_id: str)

Resume a zone run for device.

For more info of the content in the response see: https://rachio.readme.io/docs/publicdeviceresume_zone_run

Parameters:

dev_id (str) – Device’s unique id

Returns:

The return value is a tuple of (response, content), the first being and instance of the httplib2.Response class, the second being a string that contains the response entity body (Python object if it contains JSON).

Return type:

tuple

stop_water(dev_id: str)

Stop all watering on device.

For more info of the content in the response see: https://rachio.readme.io/docs/devicestop_water

Parameters:

dev_id (str) – Device’s unique id

Returns:

The return value is a tuple of (response, content), the first being and instance of the httplib2.Response class, the second being a string that contains the response entity body (Python object if it contains JSON).

Return type:

tuple

turn_off(dev_id: str)

Turn OFF all features of the device.

schedules, weather intelligence, water budget, etc.

For more info of the content in the response see: https://rachio.readme.io/docs/publicdeviceoff-1

Parameters:

dev_id (str) – Device’s unique id

Returns:

The return value is a tuple of (response, content), the first being and instance of the httplib2.Response class, the second being a string that contains the response entity body (Python object if it contains JSON).

Return type:

tuple

turn_on(dev_id: str)

Turn ON all features of the device.

schedules, weather intelligence, water budget, etc.

For more info of the content in the response see: https://rachio.readme.io/docs/publicdeviceon-1

Parameters:

dev_id (str) – Device’s unique id

Returns:

The return value is a tuple of (response, content), the first being and instance of the httplib2.Response class, the second being a string that contains the response entity body (Python object if it contains JSON).

Return type:

tuple