OpenSprinkler Forums OpenSprinkler Unified Firmware Start a program via API Reply To: Start a program via API

#41035

DaveC
Participant

The API provides a way to run a program but not a pre-defined named program. See Section 16. Start Run-Once Program of the API manual. Essentially Run-Once Program allows you to specify a list of zones to run with their duration.

What I’ve done (and I think the UI and App do something similar for ‘Quick’ programs) is to maintain a list of all the programs and the zone defs for them. When a user wants to manually run the program called ‘Front Lawn Zones’, I take the program definition and turn it into the format required by the Run-Once Program command. In my home use I define a set of manual run programs for this purpose as they are often somewhat different from the programs I’ve defined for scheduled runs.

Suggestion to Ray: Allow a PID or a Program Name to be given to the run-once program command (in the API) as another way to specify a program to run. OS already has the info, why make the programmer make the translation. It would also be nice if Manual was a ‘Type’ of a program to distinguish it from Interval or Weekly when that is its sole purpose. More obvious from a User’s perspective. And one more thing, while I’m on a role, if you decide to allow run-once manual to accept a PID, then that PID show up as the active program, not 254.

HTH
Dave