Aniston NexusDocs
Open Aniston Nexus

Scheduler

Send commands to groups of devices at set times, at sunrise or at sunset, and check the result of every run.

The scheduler sends one command to many devices at a time you choose: every weekday at 22:00, at sunset, or 15 minutes before sunrise. Typical uses are street lights on at dusk and off at dawn, air conditioners off at night and pumps on a timetable.

Tenant administrators open Automation > Scheduler. The menu item appears when the organization has at least one feature module that controls devices: HVAC, Energy, Fire and safety, Lifts and access, or Street lights.

Switch it on

The scheduler runs in the nexus-services companion service and is off by default. Set NEXUS_COMMANDS_ENABLED=true (local: docker-local/services/water.env; production: deploy/production/.env) and restart nexus-services. Until then the page says that the feature is switched off.

Sunrise and sunset are computed for the campus location (17.456737, 78.3263876) in the time zone Asia/Kolkata. Another site sets NEXUS_COMMANDS_LATITUDE, NEXUS_COMMANDS_LONGITUDE and NEXUS_COMMANDS_TIMEZONE. The page shows today's sunrise and sunset.

Add a schedule

Click Add schedule on the Schedules tab.

When

ChoiceMeaning
At a time, Time and weekdaysFor example 18:30 on Mon to Fri
At a time, Cron expressionSix fields (seconds minutes hours day month weekday), for example 0 0 22 * * MON-FRI; the five-field form also works
Sunrise / SunsetWith an offset in minutes, -720 to 720: negative is before, positive after. The dialog shows when the command would run today

Time zone is a name such as Asia/Kolkata; empty uses the service's time zone.

Which devices

ChoiceDevices
AssetEvery device related to the asset, for example a lighting zone or a building. With Include contained assets also the devices of its floors and zones
DevicesThe devices you pick, optionally only those of one profile or customer
CustomerEvery device of one customer, optionally only one profile
Device profileEvery device of one profile

Check devices shows how many devices would receive the command. One command reaches at most 200 devices. A schedule may target devices that are added later; a run that finds no devices is recorded as failed.

Command

CommandMethodParameters
Switch on or offsetState{"on": true}
Dimming levelsetDim{"level": 0..100}
Temperature setpointsetSetpoint{"celsius": 24}
Operating modesetModecool, heat, fan, auto or off
Fan speedsetFanSpeedlow, medium, high or auto
Other methodAny name of letters, digits, _ . : - (at most 64 characters)JSON object

Do not wait for an answer (one-way) is faster. A two-way command waits for each device's answer (up to the timeout) and records it. The devices must support the method: the Aniston Nexus BMS and Smart Campus devices and simulators do.

Manage schedules

The list shows each schedule's trigger, devices, command, next and last run. The row menu has:

  • Run now sends the command at once, as if the schedule had fired, and shows how many devices succeeded.
  • Show next runs lists the next fire times.
  • Enable / Disable, Duplicate, edit and delete. Deleting a schedule stops it at once; its run history is kept.

Changes take effect at the next run.

Run history

The Run history tab lists every command sent by a schedule or with Run now, newest first, with the trigger, status (success, partly failed, failed), the number of devices that succeeded and failed, and who started it. Open a run for the answer or error of each device. Filter by schedule to follow one timetable.

Access

Only tenant administrators can use the scheduler; nexus-services refuses everyone else, and refuses an organization whose feature modules do not include device control (HTTP 403 module_disabled).

REST API

Base path /api/water/v1/commands on nexus-services (the same address as the UI, /api/water/ is passed through):

CallWhat it does
GET /schedules, POST /schedulesList, create
GET, PUT, DELETE /schedules/{id}Read, replace, delete
GET /schedules/{id}/preview?count=5The next fire times
POST /schedules/{id}/runRun a schedule now
POST /runSend a command now without a schedule
POST /targets/resolveThe devices a target would reach; nothing is sent
GET /runs?scheduleId=&limit=, GET /runs/{id}Run history, one run with per-device results
GET /sun?date=Sunrise, solar noon and sunset at the site

Example schedule body:

{"name": "Street lights on", "enabled": true,
 "trigger": {"type": "sunset", "offsetMinutes": -15}, "timezone": "Asia/Kolkata",
 "targets": {"assetId": "<lighting zone asset id>", "includeRelated": true, "deviceProfile": "Street Light Pole"},
 "method": "setState", "params": {"on": true}}