Skip to content

vzlogger mini webserver #9

Description

@PHPGangsta

vzlogger has a "mini webserver" which outputs the basic data as JSON. See documentation:
https://wiki.volkszaehler.org/software/controller/vzlogger/vzlogger_conf_parameter#local

The config in /etc/vzlogger.json looks like this:

    // Build-in HTTP server
    "local": {
        "enabled": true,   // enable local HTTPd for serving live readings
        "port": 8088,       // TCP port for local HTTPd
        "index": true,      // provide index listing of available channels if no UUID was requested
        "timeout": 0,      // timeout for long polling comet requests in seconds (0 disables comet)
        "buffer": 0        // HTTPd buffer configuration for serving readings, default -1
                            //   >0: number of seconds of readings to serve
                            //   <0: number of tuples to server per channel (e.g. -3 will serve 3 tuples)
    },

The output looks like this:

image

{ "version": "0.8.0", "generator": "vzlogger", "data": [ { "uuid": "6836dd20-00d5-11e0-bab1-856ed5f959ae", "last": 1674163666444, "interval": -1, "protocol": "sml", "tuples": [ [ 1674163654443, 14219936.660600001 ] ] }, { "uuid": "6836dd20-00d5-11e0-bab1-856ed5f959af", "last": 1674163666444, "interval": -1, "protocol": "sml", "tuples": [ [ 1674163654443, 15875850.842700001 ] ] }, { "uuid": "6836dd20-00d5-11e0-bab1-856ed5f959ad", "last": 1674163666444, "interval": -1, "protocol": "sml", "tuples": [ [ 1674163654443, 474.74000000000001 ] ] }, { "uuid": "6836dd20-00d5-11e0-bab1-856ed5f959be", "last": 1674163666271, "interval": -1, "protocol": "sml", "tuples": [ [ 1674163654270, 22365376.540800001 ] ] }, { "uuid": "6836dd20-00d5-11e0-bab1-856ed5f959bf", "last": 0, "interval": -1, "protocol": "sml" }, { "uuid": "6836dd20-00d5-11e0-bab1-856ed5f959bd", "last": 1674163666271, "interval": -1, "protocol": "sml", "tuples": [ [ 1674163654270, 2.2250738585072014e-308 ] ] } ] }

In this case I have 6 UUIDs with values. Values starting with 1674 are unix timestamps in milliseconds.

It would be awesome to also have this JSON output in pymeterreader, then I could replace the existing vzlogger, and additionally have data for Prometheus/Grafana (which I currently don't have, because vzlogger does not output data in OpenMetrics format 😄).

For vzlogger integration in EVCC it would be nice if the JSON is outputted when calling the URL "/", and the OpenMetrics data should be outputted when calling "/metrics", which is the de-facto standard for OpenMetrics, see:
https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md

This endpoint SHOULD be called "/metrics"

It would be really great to see the JSON output, then it's a true replacement for vzlogger! 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions