volkszaehler / vzlogger

Logging utility for various meters & sensors
http://wiki.volkszaehler.org/software/controller/vzlogger
GNU General Public License v3.0
143 stars 124 forks source link

Feature request: config-file editor "make menuconfig" like #130

Closed mbehr1 closed 9 years ago

mbehr1 commented 9 years ago

As more and more people struggle with the complexity of the configuration file I suggest to add a config-file editor like linux kernel "make menuconfig", raspi-config, opensips/makemenuconfig,...

The editor should support:

Using this approach we could make the etc/vzlogger.conf much more complex/unreadable by adding more detailed comments, descriptions,... (instead of trying to keep the documentation in sync in the wiki or source or conf file...) and generate a specific config file easy to read, maintain and understand.

What do you think about it? suggestions/comments welcome/requested.

Is anybody aware of such an editor or some other tool/source to start with? (opensips/makemenuconfig might be a starting point providing a simple ncurses based implementation, json parsing/stuff to be added,...)

andig commented 9 years ago

Excellent idea but imho not entirely necessary right now. Might even- bonus- start from type of meter to connect instead of from asking the parameters (Elster xyz...).

Is anybody aware of such an editor or some other tool/source to start with?

Nope...

json parsing/stuff to be added

I guess that's the tricky part that gets complex. Maybe just have it as one-way or "initial" config tool? If json doesn't comply with/ or has tool-generated MD5 signature you'd get a warning of "overwriting" the config.

Also: as rules may be volatile such a tool should have more than 1 c-aware developer and should imho rather be based on a scripting language than c?

skre commented 9 years ago

I like the idea. Perhaps we could collect some typical configuration for meters out of the wiki. After an "auto-config" everybody would be free to adjust his/her config-file - what would be much easier.

dave-watts commented 9 years ago

I also like the idea, but as a start, can the config file not just be better documented with a repository for typical example applications with different meters (SML, IEC etc) different connection types (IR, TCP etc)?

mbehr1 commented 9 years ago

How about generating a json-schema for our json-conf-file? There are many editors and validators for json-schema. And references to other schemas (e.g. for meterOCR conf file) would be feasible as well. I'll provide an example the next days.

mbehr1 commented 9 years ago

see here an example: http://jeremydorn.com/json-editor/?schema=N4IgJAzgxgFgpgWwIYgFwhgF0wB1QenwCsIB7AOwFpp5kA6UgJwHN8ATRpAM00oAYALPhqIkAYhAAaEAEs2aEFJCYAnjjgLSAIyJwomJTkal1jTDLgQ0oRnEyMV12fPT5b9x9NXqFM8pjhmOEYlNksoRhkccwoFAAlSAHcAAgAbCmZkzFJkiFS4OBxkrTtEgvJkriQZfLZk2wBHAFdLTAhJZL9cvQo2KwBfaTYkRFjUUDkFdhGEWK81DXQtUlJ8pHJQuCqm1IN0exbN6EjomTGQAFFyJC185OHRitmwkEGQADdg5YgZVSdJ1yfRjfX6eZQLXz+QLBJRwchNBBoADafEkAFZJABGVGYtEAXSG4ROMQ26D4yQAvGlSMwAPrBYyMZJManMSiJJCMch+ZgdNGU1m0vxcUgdbEC9JssJaJq85K4iU02lcPytTbbXZoPhvSX/FwgfC6+Y+dAQew8o4RKIkhQ4JCYGBZHKSyo1DQ60hQJCpPVTdJen3GxYgbS6fSGYymcyWJxwm61X2uf3e/Bx25weRBhTLVZwdaW4lnUkgCAwUg7OplXKYTmYLLwakB5JxAAqLYACnURUyIMF3jy0jJPvU82weRAAPyvaQ4Jh7Cb6w2elOzsxKbzBvwBIIhQkavYADj4R8Jx2tRYUDrgyRbAGF28lV3Xu/Xr8nUs2253p7JyGEAB6Jga774H4AHrhCSwrGsGynlapznKW5apJW15GKQ/ZhMkSCdH+cD/oOZoDqQXDYe81SpPG16wOs5BwKkECdKR5A5AAqqxACSAAiyQcoxjQtGaGZTm85gIHA5bzs4frLqk+BiRJTQGFm6BbtCIRvDKXBcDC4zSUmsn4FpOm7uCJq/tuMJ7kgOx7JQmJwYW5xlik6TkJk2TFE02nBCOSBju5jEvlejberhASMFUUBwB0XS9lAvSMQAFDIpHMLY9q+XwACUzJMi5yTIOQKhZE0OD5IxnnuE0XKPr5NHkHRH6pckAA85JJZQADMArVbVPWYGVFXZa8bwCTItguEiIBpgmeL9GNcDNBNGbIiADyzLBIC6vNQAA==&value=N4IgTgpgLmCeIC4AMAaEATAhhAtgewDtEYBXCNANwjACM8BnASyngQFY0AbPAc0RBBc8AY0ydEoCAUw1OEdIgBmY+hAC+aoA&theme=bootstrap2&iconlib=fontawesome4&object_layout=normal&show_errors=interaction&disable_edit_json "JSON Output" should be a valid conf file. Hint: the properties button can enable/hide optional settings. Schema definitions can be put in multiple files or areas within one file to make it more readable. The schema used looks like that:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "",
  "type": "object",
  "properties": {
    "retry": {
      "id": "/retry",
      "type": "integer",
      "description": "How long to sleep between failed requests, in seconds"
    },
    "daemon": {
      "id": "/daemon",
      "type": "boolean",
      "default": "true",
      "description": "Enable daemon mode"
    },
    "verbosity": {
      "id": "/verbosity",
      "type": "integer",
      "enum":[0, 5, 10, 15], "description":"log_error or log_warning",
      "default": 0,
      "description": "0 = log_error or log-warning, 5 = log_info, 10 = log-debug, 15 = log_finest"
    },
    "log": {
      "id": "/log",
      "type": "string",
      "description": "path to log file"
    },
    "local": {
      "id": "/local",
      "type": "object",
      "properties": {
        "enabled": {
          "id": "/local/enabled",
          "type": "boolean",
          "description": "should we start the local HTTPd for serving live readings?"
        },
        "port": {
          "id": "/local/port",
          "type": "integer",
          "default": 8080,
          "description": "the TCP port for the local HTTPd"
        },
        "index": {
          "id": "/local/index",
          "type": "boolean",
          "description": "should we provide a index listing of available channels if no UUID was requested?"
        },
        "timeout": {
          "id": "/local/timeout",
          "type": "integer"
        },
        "buffer": {
          "id": "/local/buffer",
          "type": "integer",
          "default": -1,
          "description": "how long to buffer readings for the local interface, in seconds (if greater 0) or how many tuples to return per channel if <0 (-3 = return 3 tuples)"
        }
      },
"required": [ "enabled" ]
    }
  },
  "required": [
    "daemon",
    "log"
  ]
}
mbehr1 commented 9 years ago

See here an example with the possibility to add meters (till now just with enabled? option): http://jeremydorn.com/json-editor/?schema=N4IgJAzgxgFgpgWwIYgFwhgF0wB1QenwCsIB7AOwFpp5kA6UgJwHN8ATRpAM00oAYALPhqIkAYhAAaEGzhcAluXmZ5FCGlAAbUlCSaNITAE8ccNCFIAjInCiYpIHI1KnGKuOtSg45JJc1wbAbyQej42rqa+D5+AUHSxqbmlqSkAUjkDrLQjPI4KhTmEDCkAK6abAAEAO5wlRCYS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Rq9RAG0tOvQeOmLAXXNA&theme=bootstrap2&iconlib=fontawesome4&object_layout=normal&show_errors=interaction&ajax

andig commented 9 years ago

Fancy. Can we integrate this an an online helper instead as separate binary?

Am 23.03.2015 um 22:01 schrieb Matthias Behr notifications@github.com:

See here an example with the possibility to add meters (till now just with enabled? option): http://jeremydorn.com/json-editor/?schema=N4IgJAzgxgFgpgWwIYgFwhgF0wB1QenwCsIB7AOwFpp5kA6UgJwHN8ATRpAM00oAYALPhqIkAYhAAaEGzhcAluXmZ5FCGlAAbUlCSaNITAE8ccNCFIAjInCiYpIHI1KnGKuOtSg45JJc1wbAbyQej42rqa+D5+AUHSxqbmlqSkAUjkDrLQjPI4KhTmEDCkAK6abAAEAO5wlRCYSG6VmPCVEXqVABIAKj0AClVcTPVwjABuiszt8uN1jHBIbFMQAPwgAL7SOEz2XiAh5uE6evg7bg6JZuiKmHDMY1lySOV7ABx8H9LZULn5qpl0K06j0AML9SrnTCVYaMFptDqabp9QabaSKWQAD2CoRAx0i+AxcGxCRM1xAKTSi0y3w8vzyBUBIGKZQqNTqTlIk1klSQlSJmJmDSmlVIXF54yQ8k0sTqsAy5Dgmgg/PF5FIlQAqpqAJIAERqSBVCwAjqUPHc2OstoZ5Ag 4GU9qBDmFEfgVPbHZcyeZbvdHjbLKUuFxHvsXXi3UGQ49SUkbuQ7g9GJsbabSvIFqEANogGL+QIgAC6NvtdxT+yu5isNjsDk5rncnm8vgLoVAVfQlPSNJkdL+jPM+YCorhywgsvh8hVZbGdEqeunsqqs7h1WlSMsdXkzHVWboTy4L00eyPyrgGzTcDNmcLqFzw8LJekq+bhh96CanCMDgQih1dwIJ4ACM6KAZ42agGACxcOYYjsHIijKACED4KumxFtISzLIyegAYgb7QXIcEIQoSiMqh6GXjanYWNYtj2NsziNvIHgGAsmCMD+4a4vgHFcd68YHIm/oprSOQMgC5hdKQ1TtBQ0yYBqEABHAOCVFumC1D4MJSnElTphaECSPy5CjFAFBsOoNpsEgiCFDxRy2fZva0d21KHseeyGIw5pPBJ/wOSAACirYjs5CAUJUkWyGiIBzIwKQQMo3HOrxCVJSlgnkn6yYOD4pQIGg2Z8JIACskjAaVwFlZhfYBYO6B8JUAC88nMAA+mMzhwiM2jMJQ1RNEo5DMCZZWte1HWKMMJlVZN/WULIQZjZUNULaQnVkRanmvGgfA2v1OJHEdcbkg0uSjf59KBUyOBIK0LQav1MLSmYh0nPo+xEbB6DwbIZHIWo+J6HFr4GD9JEA0hFFoXA5bWVeN5ZsVMh2ZFvZHSWQAAA&value=N4IgTgpgLmCeIC4AMAaEATAhhAtgewDtEYBXCNANwjACM8BnASyngQFY0AbPAc0RAD0FTGAHceQgF7ie1AHTiQXPAGNMnRKAgFMNThHSIAZuvoQAvmhzRq9RAG0tOvQeOmLAXXNA&theme=bootstrap2&iconlib=fontawesome4&object_layout=normal&show_errors=interaction&ajax

— Reply to this email directly or view it on GitHub.

mbehr1 commented 9 years ago

Yes. That's the idea. We could either host it somewhere on volkszaehler.org or provide the html-pages/-scripts for installation on the local webserver.

andig commented 9 years ago

Excellent. Depending on what it takes it might even be hostable in the github pages.

On Tue, Mar 24, 2015 at 8:39 AM, Matthias Behr notifications@github.com wrote:

Yes. That's the idea. We could either host it somewhere on volkszaehler.org or provide the html-pages/-scripts for installation on the local webserver.

— Reply to this email directly or view it on GitHub https://github.com/volkszaehler/vzlogger/issues/130#issuecomment-85378443 .

mbehr1 commented 9 years ago

@andig : the code for the editor is here: https://github.com/jdorn/json-editor (MIT license). Can you (or some other volunteer ;-) check whats needed for an installation and where it would fit best? A nice solution would be:

I'd work on the schema files.

andig commented 9 years ago

We could do this on github.io. See http://andig.github.io/vzlogger/ for an example. This page lives in the gh-pages branch.

We'll need the schema as separate file (preferably as part of the gh-pages branch to not clutter the master) and add some logic to load schema and default vzlogger.conf. If you have a working schema please let me know for an initial commit to vzlogger.

We can further link the editor to a volkszaehler.org subdomain (e.g. conf.volkszaehler.org or better volkszaehler.org/vzloggerconf) if @justinotherguy wants to set one up.

mbehr1 commented 9 years ago

Perfect. I’ll prepare the schema file. (For testing a button/possibility to upload a schema file would be handy.)

Am 25.03.2015 um 10:57 schrieb andig notifications@github.com:

We could do this on github.io. See http://andig.github.io/vzlogger/ http://andig.github.io/vzlogger/ for an example. This page lives in the gh-pages branch.

We'll need the schema as separate file (preferably as part of the gh-pages branch to not clutter the master) and add some logic to load schema and default vzlogger.conf. If you have a working schema please let me know for an initial commit to vzlogger.

We can further link the editor to a volkszaehler.org subdomain (e.g. conf.volkszaehler.org or better volkszaehler.org/vzloggerconf) if @justinotherguy https://github.com/justinotherguy wants to set one up.

— Reply to this email directly or view it on GitHub https://github.com/volkszaehler/vzlogger/issues/130#issuecomment-85965525.

Gruß

Matthias

mbehr1 commented 9 years ago

See here an updated schema file with support for meter (s0 and d0) and channel config: http://jeremydorn.com/json-editor/?schema=N4IgJAzgxgFgpgWwIYgFwhgF0wB1QenwCsIB7AOwFpp5kA6UgJwHN8ATRpAM00oAYALPhqIkAYhAAaEGzhcAluXmZ5FCGlAAbUlCSaNITAE8ccNCFIAjInCiYpIHI1KnGKuOtSg45JJc1wbAbyQej42rqa+D5+AUHSxqbmlqSkAUjkDrLQjPI4KhTmEDCkAK6abAAEAO5wlRCYSG6VmPCVEXqVABIAKj0AClVcTPVwjABuiszt8uN1jHBIbFMQAPwgAL7SOEz2XiAh5uE6evg7bg6JZuiKmHDMY1lySOV7ABx8H9LZULn5qpl0K06j0AML9SrnTCVYaMFptDqabp9QabaSKWQAD2CoRAx0i+AxcGxCRM1xAKTSi0y3w8vzyBUBIGKZQqNTqTlIk1klSQlSJmJmDSmlVIXF54yQ8k0sTqsAy5Dgmgg/PF5FIlQAqpqAJIAERqSBVCwAjqUPHc2OstoZ5Ag4GU9qBDmFEfgVPbHZcyeZbvdHjbLKUuFxHvsXXi3UGQ49SUkbuQ7g9GJsbabSvIFqEANogGL+QIgAC6Nvl5EV+n2V3MVhsdkuygC5jLFYcnNc7k8oFKGdCoGr6AauXIzCeOQZAPMP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gvDMjALpodmB4UEJ4KSD0w2joEBSMgg3lAPSnFNdQLACqAMoAQsMqaypAAAA==&theme=bootstrap2&iconlib=fontawesome4&object_layout=normal&show_errors=interaction

andig commented 9 years ago

Updated gh-pages. If you switch to that branch you can:

This seems buggy:

unbenannt

Instead of being able to add a meter I need to make sure it's an array first. Problem with the schema or the editor?

andig commented 9 years ago

Looks like a bug: https://github.com/jdorn/json-editor/issues/371

mbehr1 commented 9 years ago

strange because I tested using a page that should (tm) use the same editor. I'll take a look.

Gruß Matthias

Sent from a mobile device.

Am 26.03.2015 um 10:25 schrieb andig notifications@github.com:

Updated gh-pages. If you switch to that branch you can:

edit the schema in the editor itself then update schema.json which is committed as well This seems buggy:

Instead of being able to add a meter I need to make sure it's an array first. Problem with the schema or the editor?

— Reply to this email directly or view it on GitHub.

mbehr1 commented 9 years ago

There seems to be a bug in the schema. If I use this one it works (didn’t check the difference.)

I’ll post a PR where the schema file is contained.

{ "$schema": "http://json-schema.org/draft-04/schema#",

"definitions" : {

    "local": {
        "type": "object",
        "properties": {
            "enabled": {
                "id": "/local/enabled",
                "type": "boolean",
                "description": "should we start the local HTTPd for serving live readings?"
            },
            "port": {
                "id": "/local/port",
                "type": "integer",
                "default": 8080,
                "description": "the TCP port for the local HTTPd"
            },
            "index": {
                "id": "/local/index",
                "type": "boolean",
                "description": "should we provide a index listing of available channels if no UUID was requested?"
            },
            "timeout": {
                "id": "/local/timeout",
                "type": "integer"
            },
            "buffer": {
                "id": "/local/buffer",
                "type": "integer"
            }
        },
        "required": [ "enabled" ]
    },

    "channel": {
        "type": "object",
        "title": "channel",
        "properties": {
            "uuid": { "type": "string", "description": "uuid of this channel towards the middleware" },
            "identifier": { "type": "string", "description": "identifier of this channel from the meter. E.g. 1-0:1.8.0" },
            "api": {
                "type": "string",
                "enum": ["volkszaehler", "mysmartgrid", "null"],
                "default": "volkszaehler",
                "description": "middleware api to be used. Defaults to volkszaehler.org"
            },
            "aggmode": {
                "type": "string",
                "enum": ["avg", "max", "sum", "none"],
                "description": "Mittelwert fuer Leistung, MAX fuer Zaehler, SUM fuer Counter",
                "default": "none"
            },
            "duplicates": {
                "type": "integer",
                "minimum": 0,
                "default": 0,
                "description": "default 0 (send duplicate values), >0 = send duplicate values only each <duplicates> seconds. Activate only for abs. counter values (Zaehlerstaende) and not for impulses!"
            }
        },
        "required": ["uuid", "identifier"]
    },

    "meter": {
        "type": "object",
        "title": "meter",
        "properties": {
            "enabled": {
                "type": "boolean",
                "description": "enable or disable this meter. Disabled meter will be ignored.",
                "default": false
            },
            "allowskip": {
                "type": "boolean",
                "description": "if enabled, errors when opening meter will lead to meter being ignored",
                "default": false
            },
            "interval": {
                "type": "integer",
                "description": "delay in secs between queries to the meter",
                "default": -1
            },
            "aggtime": {
                "type": "integer",
                "description": "aggregate all signals and give one update to middleware every <aggtime> seconds",
                "default": -1
            },
            "aggfixedinterval": {
                "type": "boolean",
                "description": "round all timestamps to middleware to nearest aggtime",
                "default": false
            },
            "channels": {"$ref": "#/definitions/channels"}
        },
        "required": [  ]
    },

    "meterS0": {
        "title": "S0 based meter",
      "allOf": [
        { "$ref": "#/definitions/meter" },
        { "properties": {
            "protocol": { "type": "string", "enum": ["s0"] },
            "device": { "type": "string", "description": "device the meter is connected to. E.g. /dev/ttyUSB0" }
        },
        "required": [ "protocol", "device" ]
        }
      ]
    },

    "meterD0": {
        "title": "D0 based meter",
        "allOf": [
            { "$ref": "#/definitions/meter" },
            { "properties": {
                    "protocol": { "type": "string", "enum": ["d0"] },
                    "device": { "type": "string", "description": "device the meter is connected to. E.g. /dev/ttyUSB0" },
                    "host": { "type": "string", "description": "ip addr of the meter (if not directly connected)" },
                    "dump_file": { "type": "string", "description": "path/filename of the file for the serial dump" },
                    "pullseq": { "type": "string", "description": "todo with default" },
                    "ackseq": { "type": "string", "description": "todo", "default": "auto" },
                    "baudrate": { "enum": [50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400], "default": 300, "description": "todo" },
                    "baudrate_read":  { "enum": [50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400], "default": 300, "description": "todo" },
                    "parity": { "enum": ["8n1", "7n1", "7e1", "7o1"], "default": "7e1", "description": "todo"},
                    "wait_sync": { "enum": ["end", "off"], "default": "off", "description": "todo"},
                    "read_timeout": { "type": "integer", "default": 10, "description": "todo"},
                    "baudrate_change_delay": {"type": "integer", "default": 0, "description": "todo"}
                }
            }
        ]
    },

    "channels": {
        "type": "array",
        "items": { "oneOf": [
                {"$ref": "#/definitions/channel"}
            ]}
    },

    "meters": {
        "type": "array",
        "minItems": 1,
        "items": { "oneOf": [
                {"$ref": "#/definitions/meterS0"},
                {"$ref": "#/definitions/meterD0"}
            ]}
    }

},

"type": "object", "properties": { "retry": { "id": "/retry", "type": "integer", "description": "How long to sleep between failed requests, in seconds" }, "daemon": { "id": "/daemon", "type": "boolean", "default": "true", "description": "Enable daemon mode" }, "verbosity": { "id": "/verbosity", "type": "integer", "enum":[0, 5, 10, 15], "description":"log_error or log_warning", "default": 0, "description": "0 = log_error or log-warning, 5 = log_info, 10 = log-debug, 15 = log_finest" }, "log": { "id": "/log", "type": "string", "description": "path to log file" }, "local": { "$ref": "#/definitions/local" }, "meters": { "$ref": "#/definitions/meters" } }, "required": [ "daemon", "log" ] }

Am 26.03.2015 um 10:25 schrieb andig notifications@github.com:

Updated gh-pages. If you switch to that branch you can:

edit the schema in the editor itself then update schema.json which is committed as well This seems buggy:

https://cloud.githubusercontent.com/assets/184815/6843359/4f7b8b84-d3a2-11e4-997c-6d7c85b64196.png Instead of being able to add a meter I need to make sure it's an array first. Problem with the schema or the editor?

— Reply to this email directly or view it on GitHub https://github.com/volkszaehler/vzlogger/issues/130#issuecomment-86419049.

Gruß

Matthias

andig commented 9 years ago

I think the bug is in the editor with use of definitions...

Am 26.03.2015 um 20:43 schrieb Matthias Behr notifications@github.com:

There seems to be a bug in the schema. If I use this one it works (didn’t check the difference.)

I’ll post a PR where the schema file is contained.

{ "$schema": "http://json-schema.org/draft-04/schema#",

"definitions" : {

"local": { "type": "object", "properties": { "enabled": { "id": "/local/enabled", "type": "boolean", "description": "should we start the local HTTPd for serving live readings?" }, "port": { "id": "/local/port", "type": "integer", "default": 8080, "description": "the TCP port for the local HTTPd" }, "index": { "id": "/local/index", "type": "boolean", "description": "should we provide a index listing of available channels if no UUID was requested?" }, "timeout": { "id": "/local/timeout", "type": "integer" }, "buffer": { "id": "/local/buffer", "type": "integer" } }, "required": [ "enabled" ] },

"channel": { "type": "object", "title": "channel", "properties": { "uuid": { "type": "string", "description": "uuid of this channel towards the middleware" }, "identifier": { "type": "string", "description": "identifier of this channel from the meter. E.g. 1-0:1.8.0" }, "api": { "type": "string", "enum": ["volkszaehler", "mysmartgrid", "null"], "default": "volkszaehler", "description": "middleware api to be used. Defaults to volkszaehler.org" }, "aggmode": { "type": "string", "enum": ["avg", "max", "sum", "none"], "description": "Mittelwert fuer Leistung, MAX fuer Zaehler, SUM fuer Counter", "default": "none" }, "duplicates": { "type": "integer", "minimum": 0, "default": 0, "description": "default 0 (send duplicate values), >0 = send duplicate values only each seconds. Activate only for abs. counter values (Zaehlerstaende) and not for impulses!" } }, "required": ["uuid", "identifier"] },

"meter": { "type": "object", "title": "meter", "properties": { "enabled": { "type": "boolean", "description": "enable or disable this meter. Disabled meter will be ignored.", "default": false }, "allowskip": { "type": "boolean", "description": "if enabled, errors when opening meter will lead to meter being ignored", "default": false }, "interval": { "type": "integer", "description": "delay in secs between queries to the meter", "default": -1 }, "aggtime": { "type": "integer", "description": "aggregate all signals and give one update to middleware every seconds", "default": -1 }, "aggfixedinterval": { "type": "boolean", "description": "round all timestamps to middleware to nearest aggtime", "default": false }, "channels": {"$ref": "#/definitions/channels"} }, "required": [ ] },

"meterS0": { "title": "S0 based meter", "allOf": [ { "$ref": "#/definitions/meter" }, { "properties": { "protocol": { "type": "string", "enum": ["s0"] }, "device": { "type": "string", "description": "device the meter is connected to. E.g. /dev/ttyUSB0" } }, "required": [ "protocol", "device" ] } ] },

"meterD0": { "title": "D0 based meter", "allOf": [ { "$ref": "#/definitions/meter" }, { "properties": { "protocol": { "type": "string", "enum": ["d0"] }, "device": { "type": "string", "description": "device the meter is connected to. E.g. /dev/ttyUSB0" }, "host": { "type": "string", "description": "ip addr of the meter (if not directly connected)" }, "dump_file": { "type": "string", "description": "path/filename of the file for the serial dump" }, "pullseq": { "type": "string", "description": "todo with default" }, "ackseq": { "type": "string", "description": "todo", "default": "auto" }, "baudrate": { "enum": [50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400], "default": 300, "description": "todo" }, "baudrate_read": { "enum": [50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400], "default": 300, "description": "todo" }, "parity": { "enum": ["8n1", "7n1", "7e1", "7o1"], "default": "7e1", "description": "todo"}, "wait_sync": { "enum": ["end", "off"], "default": "off", "description": "todo"}, "read_timeout": { "type": "integer", "default": 10, "description": "todo"}, "baudrate_change_delay": {"type": "integer", "default": 0, "description": "todo"} } } ] },

"channels": { "type": "array", "items": { "oneOf": [ {"$ref": "#/definitions/channel"} ]} },

"meters": { "type": "array", "minItems": 1, "items": { "oneOf": [ {"$ref": "#/definitions/meterS0"}, {"$ref": "#/definitions/meterD0"} ]} }

},

"type": "object", "properties": { "retry": { "id": "/retry", "type": "integer", "description": "How long to sleep between failed requests, in seconds" }, "daemon": { "id": "/daemon", "type": "boolean", "default": "true", "description": "Enable daemon mode" }, "verbosity": { "id": "/verbosity", "type": "integer", "enum":[0, 5, 10, 15], "description":"log_error or log_warning", "default": 0, "description": "0 = log_error or log-warning, 5 = log_info, 10 = log-debug, 15 = log_finest" }, "log": { "id": "/log", "type": "string", "description": "path to log file" }, "local": { "$ref": "#/definitions/local" }, "meters": { "$ref": "#/definitions/meters" } }, "required": [ "daemon", "log" ] }

Am 26.03.2015 um 10:25 schrieb andig notifications@github.com:

Updated gh-pages. If you switch to that branch you can:

edit the schema in the editor itself then update schema.json which is committed as well This seems buggy:

https://cloud.githubusercontent.com/assets/184815/6843359/4f7b8b84-d3a2-11e4-997c-6d7c85b64196.png Instead of being able to add a meter I need to make sure it's an array first. Problem with the schema or the editor?

— Reply to this email directly or view it on GitHub https://github.com/volkszaehler/vzlogger/issues/130#issuecomment-86419049.

Gruß

Matthias

— Reply to this email directly or view it on GitHub.

dave-watts commented 9 years ago

Nice idea to use the json-editor, If only the json-editor had the option to include help text in the schema for the html form elements that could help the user with configuration options

mbehr1 commented 9 years ago

I used the description field for help texts. But it would be really nice if some links or yaml code,… could be embedded in the description text.

Am 08.04.2015 um 15:45 schrieb Dave notifications@github.com:

Nice idea to use the json-editor, If only the json-editor had the option to include help text in the schema for the html form elements that could help the user with configuration options

— Reply to this email directly or view it on GitHub https://github.com/volkszaehler/vzlogger/issues/130#issuecomment-90921793.

Gruß

Matthias

skre commented 9 years ago

Looks nice. Could it be that setting "middleware" is missing?

mbehr1 commented 9 years ago

No, it’s there: add a Channel. The parameter is called „api“.

Am 11.04.2015 um 13:28 schrieb skre notifications@github.com:

Looks nice. Could it be that setting "middleware" is missing?

— Reply to this email directly or view it on GitHub https://github.com/volkszaehler/vzlogger/issues/130#issuecomment-91829166.

Gruß

Matthias

skre commented 9 years ago

Sorry, but I'm confused. In my old config I set middleware:

Now I can choose API between volkszaehler, mysmartgrid and none - without path..

mbehr1 commented 9 years ago

You’re right! I forgot the „middleware“. Will provide a patch.

Am 11.04.2015 um 18:27 schrieb skre notifications@github.com:

Sorry, but I'm confused. In my old config I set middleware:

Now I can choose API between volkszaehler, mysmartgrid and none - without path..

— Reply to this email directly or view it on GitHub https://github.com/volkszaehler/vzlogger/issues/130#issuecomment-91875996.

Gruß

Matthias

mbehr1 commented 9 years ago

See PR #155. Let me know if you miss any other parameters.

A „success“ message to have your config generated with the editor would be good as well ;-)

Am 11.04.2015 um 18:33 schrieb Matthias Behr mbehr@mcbehr.de:

You’re right! I forgot the „middleware“. Will provide a patch.

Am 11.04.2015 um 18:27 schrieb skre <notifications@github.com mailto:notifications@github.com>:

Sorry, but I'm confused. In my old config I set middleware:

Now I can choose API between volkszaehler, mysmartgrid and none - without path..

— Reply to this email directly or view it on GitHub https://github.com/volkszaehler/vzlogger/issues/130#issuecomment-91875996.

Gruß

Matthias

skre commented 9 years ago

I think "resolution" (number of impulses per kWh, feature of the meter) is missing as well.

mbehr1 commented 9 years ago

Isn’t that „scaler“? Can you send me an example config?

Am 12.04.2015 um 12:57 schrieb skre notifications@github.com:

I think "resolution" (number of impulses per kWh, feature of the meter) is missing as well.

— Reply to this email directly or view it on GitHub https://github.com/volkszaehler/vzlogger/issues/130#issuecomment-92032638.

Gruß

Matthias

skre commented 9 years ago

Hi Matthias, I'm refering to the config file on this wiki page: http://wiki.volkszaehler.org/hardware/controllers/ferrariszaehler_lesekopf

Best regards Stefan

skre commented 9 years ago

Hi Matthias, is resolution the same as scale? I would like to update the wiki page - if so.

mbehr1 commented 9 years ago

Hi,

after greping the code I found „resolution“. It’s not an option for the api/middleware but for the MeterS0.

I’ll add it to the MeterS0 schema.. Thanks!

Am 14.04.2015 um 08:17 schrieb skre notifications@github.com:

Hi Matthias, is resolution the same as scale? I would like to update the wiki page - if so.

— Reply to this email directly or view it on GitHub https://github.com/volkszaehler/vzlogger/issues/130#issuecomment-92634543.

Gruß

Matthias

mbehr1 commented 9 years ago

I updated PR #155.

Am 14.04.2015 um 19:52 schrieb Matthias Behr mbehr@mcbehr.de:

Hi,

after greping the code I found „resolution“. It’s not an option for the api/middleware but for the MeterS0.

I’ll add it to the MeterS0 schema.. Thanks!

Am 14.04.2015 um 08:17 schrieb skre <notifications@github.com mailto:notifications@github.com>:

Hi Matthias, is resolution the same as scale? I would like to update the wiki page - if so.

— Reply to this email directly or view it on GitHub https://github.com/volkszaehler/vzlogger/issues/130#issuecomment-92634543.

Gruß

Matthias

Gruß

Matthias

andig commented 9 years ago

I'd suggest to commit the obvious schema fixes right on master or pull immediately.

Am 14.04.2015 um 20:02 schrieb Matthias Behr notifications@github.com:

I updated PR #155.

Am 14.04.2015 um 19:52 schrieb Matthias Behr mbehr@mcbehr.de:

Hi,

after greping the code I found „resolution“. It’s not an option for the api/middleware but for the MeterS0.

I’ll add it to the MeterS0 schema.. Thanks!

Am 14.04.2015 um 08:17 schrieb skre <notifications@github.com mailto:notifications@github.com>:

Hi Matthias, is resolution the same as scale? I would like to update the wiki page - if so.

— Reply to this email directly or view it on GitHub https://github.com/volkszaehler/vzlogger/issues/130#issuecomment-92634543.

Gruß

Matthias

Gruß

Matthias

— Reply to this email directly or view it on GitHub.

mbehr1 commented 9 years ago

issue can be closed, or?