Skip to content

Repository files navigation

SolarQuant Plugin

SolarNode plugin that buffers datums from the datum pipeline and forwards them to a SolarQuant HTTP service via POST /measure. Predictions returned by the service are posted back to SolarNetwork as new datums.

Implements the SolarQuant plugin schema. Any container exposing /measure and /health works.

Building

Requires Java 17, Apache Ant, and Git LFS. Clone solarnetwork-build as a sibling directory and run git lfs pull in it.

parent/
solarnetwork-build/
solarquant-solarnetwork-node/
net.solarnetwork.node.datum.solarquant/
cd solarquant-solarnetwork-node/net.solarnetwork.node.datum.solarquant
ant jar

Output: net.solarnetwork.node.datum.solarquant/target/net.solarnetwork.node.datum.solarquant-1.0.0.jar

Configuration

Add a SolarQuant Anomaly Detection component in the SolarNode Settings UI.

SettingDefaultDescription
Docker ImageImage to pull and run. Leave empty to use an existing service.
Service URLhttp://localhost:8000Base URL of the SolarQuant service. Auto-set when Docker Image is configured.
Source ID FilterRegex matching source IDs to forward.
Upload Source IDBase source ID for predictions. sourceIndex is appended (e.g. /solarquant/1).
Flush Interval60How often buffered datums are sent, in seconds.
Docker Commandbin/solarquantPath to the Docker management script.
HTTP CustomizerService Name of an HttpRequestCustomizerService to apply to outbound requests (e.g. to add authentication).
Manual Node IDThe node ID to use when forwarding datum to the service, instead of SolarNode's actual node ID.
Source ID MappingsAn optional list of search/replace mappings to apply to datum source IDs before forwarding to the service. See below for more detail.

Source ID Mappings

The Source ID Mappings list can be configured with any number of search regular expressions with associated replacement templates. Use the + and - buttons to add/remove mappings.

SettingDescription
Source MatchThe datum source ID pattern to replace. Capture groups can be referenced in Replacement.
ReplacementThe source ID replacement template to use when Source Match matches a datum source ID.

Use regular expression capture groups to extract parts of a matching datum source ID to use in the replacement source ID value. The replacement template can refer to the entire matched source ID with the {s} placeholder, or capture groups like {n} where n is the capture group index, starting from 1.

For example, a Source Match/x/(d+) with Replacement/y/{1} would map an input source ID /x/123 to /y/123.

Docker Command

The plugin calls an external command to manage containers. Install net.solarnetwork.node.datum.solarquant/def/solarquant.sh to the SolarNode bin directory -- see net.solarnetwork.node.datum.solarquant/def/README.md.

Protocol

See the SolarQuant plugin schema for the full OpenAPI spec.

POST /measure -- send datums, receive predictions. GET /health -- liveness check (shown in SolarNode dashboard).

Datum fields map to SolarNetwork sample types: i (instantaneous), a (accumulating), s (status).

Reference

License

Apache License 2.0

About

Forward datum to a SolarQuant AI model and generate prediction datum from the model response.

Topics

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Contributors

Languages