DigitalShoestringSolutions / PowerMonitoring

GNU General Public License v3.0
0 stars 1 forks source link

Documentation for Analysis Module API #37

Open tobyaharris opened 4 months ago

tobyaharris commented 4 months ago

Most solutions have ALL data stored in InfluxDB, so getting at it is only a question of https://github.com/DigitalShoestringSolutions/sm_timeseries_db/issues/4 .

However this one has an interesting Analysis Module, but do have have any documentation for it?

A customer wants to do some of their own data aggregation. They may benefit from having derived data from the analysis module. How can they access it? Currently all I can think of is to copy the queries in the Grafana panels.

tobyaharris commented 3 months ago

Greg will create some form of documentation

tobyaharris commented 3 days ago

Progress so far =

GET [http://<url:port>/power/real](http://%3curl:port%3e/power/real)     ?from=<iso timestamp>&to=<iso_timestamp>&machine=<name>&bucket=<name>&window=<window in ms as string e.g. 2000ms>

[
            {
                "timestamp":"<ISO8601 string>",
                "power_real":<value>,
                "machine":"<machine>"
            },
]

GET [http://<url:port>/power/apparent](http://%3curl:port%3e/power/apparent)   ?from=<iso timestamp>&to=<iso_timestamp>&machine=<name>&bucket=<name>&window=<window in ms as string e.g. 2000ms>

[
            {
                "timestamp":"<ISO8601 string>",
                "power_apparent":<value>,
                "machine":"<machine>"
            },
]

GET [http://<url:port>/energy/bucket](http://%3curl:port%3e/energy/bucket) ?from=<iso timestamp>&to=<iso_timestamp>&machine=<name>&bucket=<name>&window=<window in ms as string e.g. 2000ms>&total=<"true" or "false">

[
            {
                "timestamp":"<ISO8601 string>",
                "energy":<value>,
                "machine":"<machine>"
            },
]

GET [http://<url:port>/energy/total](http://%3curl:port%3e/energy/total) ?from=<iso timestamp>&to=<iso_timestamp>&machine=<name>&bucket=<name>&window=<window in ms as string e.g. 2000ms>

[
            {
                "timestamp":"<ISO8601 string>",
                "energy":<value>,
                "machine":"<machine>"
            },
]

GET [http://<url:port>/period](http://%3curl:port%3e/period) ?from=<iso timestamp>&to=<iso_timestamp>&machine=<name>&bucket=<name>&window=<window in ms as string e.g. 2000ms>&total=<"true" or "false">

{
            "buckets":[<bucket_labels>],
            "series:{
                <series_label>:[<bucket_values>]
            }
}

GET [http://<url:port>/period/top10](http://%3curl:port%3e/period/top10) ?from=<iso timestamp>&to=<iso_timestamp>&machine=<name>&bucket=<name>&window=<window in ms as string e.g. 2000ms>&total=<"true" or "false">

{
                "timestamp":"<ISO8601 string>",
                "energy":<value>,
                "machine":"<machine>"
},