Commands
aioguardian
supports all of the commands provided by the official Guardian API.
Supported Commands
client.iot.publish_state()
: publish the device state to the Guardian cloudclient.sensor.pair_dump()
: dump the UIDs of all paired sensorsclient.sensor.pair_sensor()
: pair a new sensor to the deviceclient.sensor.paired_sensor_status()
: get information from a paired sensorclient.sensor.unpair_sensor()
: unpair a sensor from the deviceclient.system.diagnostics()
: return diagnostics info from the deviceclient.system.factory_reset()
: perform a factory reset of the deviceclient.system.onboard_sensor_status()
: get information from the device’s onboard sensorsclient.system.ping()
: ping the device to determine whether it can be reachedclient.system.reboot()
: reboot the deviceclient.system.upgrade_firmware()
: initiate a firmware upgrade on the deviceclient.valve.close()
: close the valveclient.valve.halt()
: halt the valve mid-open or mid-close (be careful!)client.valve.open()
: open the valveclient.valve.reset()
: reset all valve diagnosticsclient.valve.status()
: get information about the device’s valveclient.wifi.configure()
: connect the device to an SSIDclient.wifi.disable_ap()
: disable the device’s onboard WiFi access pointclient.wifi.enable_ap()
: enable the device’s onboard WiFi access pointclient.wifi.list()
: list nearby WiFi SSIDsclient.wifi.reset()
: reset all WiFi infoclient.wifi.scan()
: scan for nearby WiFi SSIDsclient.wifi.status()
: get information related to the device’s WiFi connections
Note: Not all commands are supported on all firmwares. If a particular command is not working on your valve controller, please ensure you have the latest device firmware before filing an aioguardian
bug.
You can learn more about the response payloads of these commands by looking at the fixtures folder in the GitHub repo.
Executing Raw Commands
If you should ever need to quickly test commands via their integer command code, the
Client
object’s
execute_raw_command()
can be
used:
import asyncio
from aioguardian import Client
async def main():
async with Client("<IP ADDRESS>") as client:
# Get sensor status, which is command 80:
status = await client.execute_raw_command(80)
asyncio.run(main())
You can see the command-code-to-command mapping by examining the
Command
helper.
Dealing with “Beeps”
Under normal operation, the device will emit a series of “beep” tones alongside certain
actions. As this can be a bit much, by default, aioguardian
suppresses these tones
for commands that don’t affect the valve’s status. Should this behavior not be
desirable, many command methods accept a silent
argument.
For example, to execute
client.system.ping()
and allow these
tones to play:
import asyncio
from aioguardian import Client
async def main():
async with Client("<IP ADDRESS>") as client:
await client.system.ping(silent=False)
asyncio.run(main())