25 lines
650 B
YAML
25 lines
650 B
YAML
template: volkszaehler-http
|
|
products:
|
|
- brand: Volkszähler
|
|
description:
|
|
generic: HTTP API
|
|
group: generic
|
|
params:
|
|
- name: usage
|
|
choice: ["grid"]
|
|
- name: url
|
|
description:
|
|
generic: Middleware URL
|
|
example: http://zaehler.network.local:8080/api/data
|
|
- name: uuid
|
|
required: true
|
|
render: |
|
|
type: custom
|
|
power: # power reading
|
|
source: http # use http plugin
|
|
{{- if .host }}
|
|
uri: http://{{ .host }}:{{ .port }}/api/data/{{ unquote .uuid }}.json?from=now
|
|
{{ else }}
|
|
uri: {{ trimSuffix "/" .url }}/{{ unquote .uuid }}.json?from=now
|
|
{{- end }}
|
|
jq: .data.tuples[0][1] # parse response json
|