The zoneState for each zone includes a nextRun attribute with the time it’s next scheduled to run.
Here is a simple perl script that displays this info for the first controller in the first location on your account. Edit for your email and password before running.
I’m curious how you will use this data in your automation.
#!/usr/bin/perl
use LWP::UserAgent;
use JSON;
$user = 'me@mydomain.com'; # replace with the email address for your Rachio account
$pass = 'mysecret'; # replace with your Rachio account password
sub doreq { # print error and exit if request unsuccessful
my ($name, $resp) = @_;
return $resp->content if $resp->is_success;
my $err = $resp->content;
print "Request for $name failed: $err\n";
exit(1);
}
$ua = LWP::UserAgent->new();
#$ua->proxy(['http', 'https'], 'http://127.0.0.1:8888/');
# get config data
$cfg = decode_json(doreq('config', $ua->get('https://app.rach.io/env.json')));
# log in and get access token
$token = decode_json(doreq('login', $ua->post("$cfg->{AUTH_SERVICE_URL}/token",
[ 'grant_type' => 'password', 'username' => $user, 'password' => $pass,
'client_id' => $cfg->{CLIENT_ID}, 'client_secret' => $cfg->{CLIENT_SECRET} ])))->{access_token};
# get first device associated with this account
$devid = decode_json(doreq('device', $ua->get("$cfg->{API_URL}/location/listLocations/true", 'Authorization' => "Bearer $token")))
->{locationSummary}->[0]->{location}->{deviceId}->[0];
# get and display zone data
$listzones = doreq('get zone list', $ua->get("$cfg->{API_URL}/device/listZones/$devid", 'Authorization' => "Bearer $token"));
print $listzones;