As of GA4.11 there is a new REST Extractor plugin.
You probably WILL need a new license token / file to use it. Your should check your gateway-licenceUsage dataviews to see if it's listed.
As a simple real-world test of the new REST Extractor plugin I pointed it at my Tesla Powerwall Gateway. The PW Gateway (no relation to the Geneos Gateway!) has a number of community documented REST endpoints (see https://github.com/vloschiavo/powerwall2 for more) and these can be used to monitor your battery system.
Please note that as of Tesla's 20.49 update to their gateway software this example no longer works without additional authentication and the article has not (yet) been updated to demonstrate that.
I created three basic queries with some JQ filters (the first two could be Geneos Headlines as they are single value numbers, but the first iteration of the REST Extractor doesn't support this):
It is worth noting that the REST Extractor ignores SSL/TLS certificate errors, and this is intentional. Later release may make certificate chain checking an option. Currently it works just like curl -s -k URL
The data returned above are, simulated using curl:
$ curl -s -k [URL]/api/system_status/soe |jq
{
"percentage": 58.28107024900731
}
which results in (some time later, hence the different value!):
$ curl -s -k [URL]/api/status |jq
{
"start_time": "2019-05-03 03:56:26 +0800",
"up_time_seconds": "4h55m3.196047617s",
"is_new": false,
"version": "1.34.3",
"git_hash": "90b583f90cb815cec7678797ce7fcf4ac8065666"
}
and this, again some time later, results in:
$ curl -s -k [URL]/api/meters/aggregates |jq
{
"site": {
"last_communication_time": "2019-05-03T08:53:00.293620242+01:00",
"instant_power": 37.746665954589844,
"instant_reactive_power": -770.258544921875,
"instant_apparent_power": 771.1828815630255,
"frequency": 49.95012283325195,
"energy_exported": 57865.79811281392,
"energy_imported": 2506552.357557258,
"instant_average_voltage": 243.95315551757812,
"instant_total_current": 0,
"i_a_current": 0,
"i_b_current": 0,
"i_c_current": 0,
"timeout": 1500000000
},
"battery": {
"last_communication_time": "2019-05-03T08:53:00.293914573+01:00",
"instant_power": 3400,
"instant_reactive_power": -40,
"instant_apparent_power": 3400.2352859765456,
"frequency": 49.938,
"energy_exported": 1820190,
"energy_imported": 2126270,
"instant_average_voltage": 245.25,
"instant_total_current": -80.60000000000001,
"i_a_current": 0,
"i_b_current": 0,
"i_c_current": 0,
"timeout": 1500000000
},
...
}
This result in a dataview like this (come computed test columns hidden):
The sampler XML is:
<sampler name="Tesla PW Stats"> <sampleInterval> <data>10</data> </sampleInterval> <plugin> <rest-extractor> <dataviews> <dataview> <name>State of Charge</name> <url> <var ref="TESLA_GW_URL"/> <data>/api/system_status/soe</data> </url> <query> <data>to_entries</data> </query> <mode>complete</mode> </dataview> <dataview> <name>Status</name> <url> <var ref="TESLA_GW_URL"/> <data>/api/status</data> </url> <query> <data>to_entries</data> </query> <mode>complete</mode> </dataview> <dataview> <name>Meter Aggregates</name> <url> <var ref="TESLA_GW_URL"/> <data>/api/meters/aggregates</data> </url> <query> <data>[to_entries | .[] | { title: .key} + .value]</data> </query> <mode>complete</mode> </dataview> </dataviews> </rest-extractor> </plugin> <dataviews> <dataview name="Meter Aggregates"> <additions> <var-columns> <data> <column> <data>imported_today</data> </column> <column> <data>exported_today</data> </column> </data> </var-columns> </additions> </dataview> </dataviews> </sampler>
-
Tags:
- Geneos
- REST
- Plugin
Comments
0 comments
Please sign in to leave a comment.