Since I've just had a power outage it's a good time to document the endpoint. A prerequisite is to have
IntelliCenter Gateway running on either LAN or WAN. For demonstration purposes we'll say the endpoint address on the local network is
http://192.168.1.11:5000/shortcuts.
The endpoint will accept HTTP POST requests with form field values named "Object", "Param" & "Value" (the latter being optional).
Object is the internal name that IntelliCenter uses, sign in to Gateway website and use
http://192.168.1.11:5000/test.html to explore objects and view the name in the browser
developer console when selected. For example pool light on my system is C0004, but your system could have a different function so adjust accordingly.
Param is the parameter name associated with an object, the parameter "STATUS" will be used for circuits. Others are "PROBE" for sensors, "SALT" for IntelliChlor and "PHVAL" for IntelliChem.
Value is used when you need to set a value for a given parameter. For circuits this will either be "ON" or "OFF" which are self explanatory.
The endpoint is password protected using the basic authentication scheme which is explained further in
curl documentation. You will need to use the username and password defined in appsettings.json or from an environment variable if using Docker.
A call to the endpoint will return a
JSON response. The "status" field contains the HTTP status code which should be 200 (OK) for a successful call, or 401 (Unauthorized) if the user credentials are invalid. The "result" field contains the value returned from IntelliCenter for the object and parameter requested.
The endpoint basically provides a wrapper around the IntelliCenter commands GetParamList and SetParamList. The object and param fields are required for both commands, but SetParamList also requires the value field. For example to get the state of my pool light you would pass C0004 & STATUS which might return OFF. To turn on my pool light you would pass C0004, STATUS & ON which if successful would return ON.
Either Ryan or I can probably give further insight into the IntelliCenter objects and parameters if needed, but the information above should be enough to get you started with the endpoint. I'd also recommend using the
cURL tool as a way to quickly verify sending requests to the IntelliCenter via the gateway endpoint, a couple of examples are provided below.
curl --user user׃pa55word --data "object=SSW11¶m=PROBE" http://192.168.1.11:5000/shortcuts
curl --user user׃pa55word --data "object=C0004¶m=STATUS&value=ON" http://192.168.1.11:5000/shortcuts