Templates: support IPv6 (#28872)

This commit is contained in:
andig 2026-04-07 08:27:23 +02:00 • committed by GitHub
parent b51891b24b
commit cebe55dfdb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 167 additions and 159 deletions

View file

@ -13,5 +13,5 @@ params:
default: 502
render: |
type: daheimladen
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
phases1p3p: true

View file

@ -15,4 +15,4 @@ params:
default: 502
render: |
type: daheimladen
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}

View file

@ -47,7 +47,7 @@ params:
advanced: true
render: |
type: e3dc-rscp
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
user: {{ .user }}
password: {{ .password }}
key: {{ .key }}

View file

@ -17,4 +17,4 @@ params:
render: |
type: etrel
connector: {{ .connector }}
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}

View file

@ -18,4 +18,4 @@ params:
default: 502
render: |
type: etrel
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}

View file

@ -58,7 +58,7 @@ params:
- preset: switchsocket
render: |
type: homematic
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
device: {{ .device }}
user: {{ .user }}
password: {{ .password }}

View file

@ -25,7 +25,7 @@ render: |
timeout: {{ .watchdog }} # re-write at timeout/2
set:
source: modbus
uri: {{ .host }}:502
uri: {{ joinHostPort .host "502" }}
id: 40 # WP
register:
address: 301 # PV Überschussleistung
@ -34,7 +34,7 @@ render: |
scale: 10.0
power:
source: modbus
uri: {{ .host }}:502
uri: {{ joinHostPort .host "502" }}
id: 40
register:
address: 108
@ -44,7 +44,7 @@ render: |
{{- if eq .tempsource "warmwater" }}
temp:
source: modbus
uri: {{ .host }}:502
uri: {{ joinHostPort .host "502" }}
id: 51 # TWE
register:
address: 100
@ -53,7 +53,7 @@ render: |
scale: 0.1
limittemp:
source: modbus
uri: {{ .host }}:502
uri: {{ joinHostPort .host "502" }}
id: 51 # TWE
register:
address: 101
@ -64,7 +64,7 @@ render: |
{{- if eq .tempsource "buffer" }}
temp:
source: modbus
uri: {{ .host }}:502
uri: {{ joinHostPort .host "502" }}
id: 50 # Speicher
register:
address: 1
@ -73,7 +73,7 @@ render: |
scale: 0.1
limittemp:
source: modbus
uri: {{ .host }}:502
uri: {{ joinHostPort .host "502" }}
id: 50 # Speicher
register:
address: 2

View file

@ -58,7 +58,7 @@ render: |
initial: 0
set:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
register:
address: 102 # PV Überschussleistung
@ -67,7 +67,7 @@ render: |
scale: {{ if eq .excess "plus" }}1{{ else }}-1{{ end }}
power:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
register:
address: 103 # aktuelle Aufnahmeleistung [E] der WP
@ -75,7 +75,7 @@ render: |
decode: int16
energy:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
register:
address: 1020 # kumulierter Stromverbrauch (Energieaufnahme) [E / Wh] seit dem letzten Reset
@ -85,7 +85,7 @@ render: |
{{- if .tempsource }}
temp:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
register:
address: {{ if eq .tempsource "warmwater_top" -}} 2002 {{ else if eq .tempsource "warmwater_bottom" -}} 2003 {{ else if eq .tempsource "buffer_top" -}} 3002 {{ else }} 3003 {{- end }} # 2002 Trinkwasser Oben, 2003 Trinkwasser Unten, 3002 Wärmespeicher Oben, 3003 Wärmespeicher Unten
@ -94,7 +94,7 @@ render: |
scale: 0.1
limittemp:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
register:
address: {{ if eq .tempsource "warmwater_top" -}} 2050 {{ else if eq .tempsource "warmwater_bottom" -}} 2050 {{ else if eq .tempsource "buffer_top" -}} 3050 {{ else }} 3050 {{- end }} # 2050 Trinkwasser Speicher, 3050 Wärmespeicher

View file

@ -20,7 +20,7 @@ render: |
source: delta # nur Differenz zu der von WP berechneten Überschussleistung (Reg. 2012)
get:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
register:
address: 2012 # totale von der WP berechnete Überschussleistung Auflösung 1 W
@ -28,7 +28,7 @@ render: |
decode: int16
set:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
register:
address: 2201 # SUR Überschussleistung Auflösung 1 W
@ -36,7 +36,7 @@ render: |
decode: int16
temp:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
register:
address: 2000 # angezeigte Temperatur Auflösung 0,1°C
@ -45,7 +45,7 @@ render: |
scale: 0.1
limittemp:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
register:
address: 2203 # Legionellen/Überschuss Solltemperatur Auflösung 0,1°C

View file

@ -19,7 +19,7 @@ params:
default: 502
render: |
type: wallbe
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
meter: # only if a charge meter is connected to the controller
power: true
energy: true

View file

@ -19,7 +19,7 @@ params:
default: 502
render: |
type: wallbe
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
legacy: true # set only for older Wallbe devices (pre ~2019, old controller firmware)
meter: # only if a charge meter is connected to the controller
power: true

View file

@ -19,5 +19,5 @@ params:
default: 502
render: |
type: wallbe
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
legacy: true # set only for older Wallbe devices (pre ~2019, old controller firmware)

View file

@ -17,4 +17,4 @@ params:
default: 502
render: |
type: wallbe
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}

View file

@ -18,4 +18,4 @@ params:
default: 502
render: |
type: webasto-next
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}

View file

@ -10,4 +10,4 @@ params:
- name: host
render: |
type: weidmüller
uri: {{ .host }}:502
uri: {{ joinHostPort .host "502" }}

View file

@ -18,7 +18,7 @@ params:
type: string
render: |
type: dsmr
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
{{- if .energy }}
energy: {{ .energy }}
{{- end }}

View file

@ -14,7 +14,7 @@ render: |
{{- if eq .usage "grid" }}
power:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
type: holding
decode: int32s
@ -25,13 +25,13 @@ render: |
source: calc
add:
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
type: holding
decode: int32s
address: 40067 # Photovoltaikleistung in Watt
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
type: holding
decode: int32s
@ -41,7 +41,7 @@ render: |
{{- if eq .usage "battery" }}
power:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
type: holding
decode: int32s
@ -49,7 +49,7 @@ render: |
scale: -1 # reverse direction
soc:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
address: 40082 # Batterie-SOC in %
type: holding

View file

@ -67,7 +67,7 @@ params:
render: |
type: e3dc-rscp
usage: {{ .usage }}
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
user: {{ .user }}
password: {{ .password }}
key: {{ .key }}

View file

@ -40,7 +40,7 @@ render: |
{{- if eq .usage "grid" }}
power:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:W
@ -49,7 +49,7 @@ render: |
- 213:W
energy:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:TotWhImp
@ -59,7 +59,7 @@ render: |
scale: 0.001
currents:
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:AphA
@ -67,7 +67,7 @@ render: |
- 203:AphA
- 213:AphA
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:AphB
@ -75,7 +75,7 @@ render: |
- 203:AphB
- 213:AphB
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:AphC
@ -84,7 +84,7 @@ render: |
- 213:AphC
voltages:
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:PhVphA
@ -92,7 +92,7 @@ render: |
- 203:PhVphA
- 213:PhVphA
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:PhVphB
@ -100,7 +100,7 @@ render: |
- 203:PhVphB
- 213:PhVphB
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:PhVphC
@ -109,7 +109,7 @@ render: |
- 213:PhVphC
powers:
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:WphA
@ -117,7 +117,7 @@ render: |
- 203:WphA
- 213:WphA
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:WphB
@ -125,7 +125,7 @@ render: |
- 203:WphB
- 213:WphB
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:WphC
@ -138,23 +138,23 @@ render: |
source: calc
add:
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 160:1:DCW # mppt 1
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 160:2:DCW # mppt 2
energy:
source: calc
add:
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 160:1:DCWH # mppt 1
scale: 0.001
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 160:2:DCWH # mppt 2
scale: 0.001
@ -165,23 +165,23 @@ render: |
source: calc
add:
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 160:3:DCW # mppt 3 charge
scale: -1
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 160:4:DCW # mppt 4 discharge
energy:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 160:4:DCWH # mppt 4 (discharge)
scale: 0.001
soc:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 124:0:ChaState
batterymode: # model 124
@ -195,14 +195,14 @@ render: |
value: 0
set:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 124:0:StorCtl_Mod
- source: const
value: 100 # %
set:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 124:0:OutWRte
- case: 2 # hold
@ -213,14 +213,14 @@ render: |
value: 2
set:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 124:0:StorCtl_Mod
- source: const
value: 0 # %
set:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 124:0:OutWRte
- case: 3 # charge
@ -231,21 +231,21 @@ render: |
value: 1 # off
set:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 124:0:ChaGriSet
- source: const
value: 2
set:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 124:0:StorCtl_Mod
- source: const
value: {{ if .maxchargerate }}-{{ .maxchargerate }}{{ end }} # %
set:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 124:0:OutWRte
{{- include "battery-params" . }}

View file

@ -27,7 +27,7 @@ render: |
{{- if eq .usage "grid" }}
power:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:W
@ -36,7 +36,7 @@ render: |
- 213:W
energy:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:TotWhImp
@ -46,7 +46,7 @@ render: |
scale: 0.001
currents:
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:AphA
@ -54,7 +54,7 @@ render: |
- 203:AphA
- 213:AphA
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:AphB
@ -62,7 +62,7 @@ render: |
- 203:AphB
- 213:AphB
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:AphC
@ -71,7 +71,7 @@ render: |
- 213:AphC
voltages:
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:PhVphA
@ -79,7 +79,7 @@ render: |
- 203:PhVphA
- 213:PhVphA
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:PhVphB
@ -87,7 +87,7 @@ render: |
- 203:PhVphB
- 213:PhVphB
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:PhVphC
@ -96,7 +96,7 @@ render: |
- 213:PhVphC
powers:
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:WphA
@ -104,7 +104,7 @@ render: |
- 203:WphA
- 213:WphA
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:WphB
@ -112,7 +112,7 @@ render: |
- 203:WphB
- 213:WphB
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:WphC
@ -125,32 +125,32 @@ render: |
source: calc
add:
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 160:1:DCW # mppt 1
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 160:2:DCW # mppt 2
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 160:3:DCW # mppt 3
energy:
source: calc
add:
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 160:1:DCWH # mppt 1
scale: 0.001
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 160:2:DCWH # mppt 2
scale: 0.001
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 160:3:DCWH # mppt 3
scale: 0.001
@ -161,23 +161,23 @@ render: |
source: calc
add:
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 160:4:DCW # mppt 4 charge
scale: -1
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 160:5:DCW # mppt 5 discharge
energy:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 160:5:DCWH # mppt 5 (discharge)
scale: 0.001
soc:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 124:0:ChaState
batterymode: # model 124
@ -191,14 +191,14 @@ render: |
value: 0
set:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 124:0:StorCtl_Mod
- source: const
value: 100 # %
set:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 124:0:OutWRte
- case: 2 # hold
@ -209,14 +209,14 @@ render: |
value: 2
set:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 124:0:StorCtl_Mod
- source: const
value: 0 # %
set:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 124:0:OutWRte
- case: 3 # charge
@ -227,21 +227,21 @@ render: |
value: 1 # off
set:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 124:0:ChaGriSet
- source: const
value: 2
set:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 124:0:StorCtl_Mod
- source: const
value: -{{ .maxchargerate }} # %
set:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
value: 124:0:OutWRte
{{- include "battery-params" . }}

View file

@ -29,21 +29,21 @@ render: |
currents:
- source: modbus
id: 0
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
address: 4099 # Netz Ampere L1 | Grid amps L1
type: holding
decode: uint16
- source: modbus
id: 0
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
address: 4100 # Netz Ampere L2 | Grid amps L2
type: holding
decode: uint16
- source: modbus
id: 0
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
address: 4101 # Netz Ampere L3 | Grid amps L3
type: holding
@ -51,7 +51,7 @@ render: |
power:
source: modbus
id: 0
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
type: holding
decode: int32
@ -63,7 +63,7 @@ render: |
add:
- source: modbus
id: 0
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
type: holding
decode: uint32
@ -73,7 +73,7 @@ render: |
power:
source: modbus
id: 0
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
type: holding
decode: int32
@ -82,7 +82,7 @@ render: |
soc:
source: modbus
id: 0
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
address: 4146 # Batterie-SOC in %
type: holding

View file

@ -15,7 +15,7 @@ render: |
power:
source: modbus
id: 0
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
address: 31657 # Active power of built-in electric energy sensor
type: holding
@ -23,7 +23,7 @@ render: |
energy:
source: modbus
id: 0
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
address: 31679 # Total negative active energy of built-in electric energy sensor
type: holding
@ -32,7 +32,7 @@ render: |
currents:
- source: modbus
id: 0
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
address: 31651 # Huawei phase A grid current
type: holding
@ -40,7 +40,7 @@ render: |
scale: 0.1
- source: modbus
id: 0
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
address: 31653 # Huawei phase B grid current
type: holding
@ -48,7 +48,7 @@ render: |
scale: 0.1
- source: modbus
id: 0
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
address: 31655 # Huawei phase C grid current
type: holding
@ -59,7 +59,7 @@ render: |
power:
source: modbus
id: 0
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
address: 30354 # Active power
type: holding
@ -67,7 +67,7 @@ render: |
energy:
source: modbus
id: 0
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
address: 30344 # E-Total
type: holding
@ -78,7 +78,7 @@ render: |
power:
source: modbus
id: 0
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
address: 30360
type: holding
@ -87,7 +87,7 @@ render: |
energy:
source: modbus
id: 0
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
address: 30312 # Total discharge
type: holding
@ -96,7 +96,7 @@ render: |
soc:
source: modbus
id: 0
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
address: 30368
type: holding

View file

@ -61,7 +61,7 @@ render: |
power:
source: modbus
id: 0
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
address: 40521 # Active power
type: holding
@ -69,7 +69,7 @@ render: |
energy:
source: modbus
id: 0
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
register:
address: 40560 # E-Total
type: holding

View file

@ -41,7 +41,7 @@ params:
default: 30s
render: |
type: rct
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
usage: {{ .usage }}
cache: {{ .cache }}
{{- include "battery-params" . }}

View file

@ -29,7 +29,7 @@ render: |
{{- if eq .usage "grid" }}
power:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 247
register:
address: 30005 # [Grid sensor] Active power
@ -37,7 +37,7 @@ render: |
decode: int32
energy:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
register:
address: 30562 # Accumulated import energy
@ -46,7 +46,7 @@ render: |
scale: 0.01
currents:
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
register:
address: 31017 # Phase A current
@ -54,7 +54,7 @@ render: |
decode: int32
scale: 0.01
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
register:
address: 31019 # Phase B current
@ -62,7 +62,7 @@ render: |
decode: int32
scale: 0.01
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
register:
address: 31021 # Phase C current
@ -73,7 +73,7 @@ render: |
{{- if eq .usage "pv" }}
power:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 247
register:
type: holding
@ -84,7 +84,7 @@ render: |
{{- if eq .usage "battery" }}
power:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 247
register:
type: holding
@ -93,7 +93,7 @@ render: |
scale: -1
energy:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
register:
address: 30574 # Battery accumulated discharge energy
@ -102,7 +102,7 @@ render: |
scale: 0.01
soc:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 247
register:
address: 30014 # Energy storage system SOC
@ -114,7 +114,7 @@ render: |
convert: float2int
set:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 247
register:
address: 40048 # Discharge Cut-Off SoC

View file

@ -23,7 +23,7 @@ render: |
source: calc
add:
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
register:
address: 3502 # Pac
@ -31,7 +31,7 @@ render: |
decode: uint32s
scale: -1
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
register:
address: 3518 # Pac consumption
@ -41,7 +41,7 @@ render: |
{{- if eq .usage "pv" }}
power:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
register:
address: 3502 # Pac
@ -49,7 +49,7 @@ render: |
decode: uint32s
energy:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 1
register:
address: 3516 # total yield

View file

@ -18,7 +18,7 @@ render: |
{{- if or (eq .usage "grid") (eq .usage "charge") }}
power:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:W
@ -29,7 +29,7 @@ render: |
- 213:W
energy:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:TotWhImp
@ -41,7 +41,7 @@ render: |
scale: 0.001
currents:
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:AphA
@ -51,7 +51,7 @@ render: |
- 203:AphA
- 213:AphA
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:AphB
@ -61,7 +61,7 @@ render: |
- 203:AphB
- 213:AphB
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:AphC
@ -72,7 +72,7 @@ render: |
- 213:AphC
voltages:
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:PhVphA
@ -82,7 +82,7 @@ render: |
- 203:PhVphA
- 213:PhVphA
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:PhVphB
@ -92,7 +92,7 @@ render: |
- 203:PhVphB
- 213:PhVphB
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:PhVphC
@ -103,7 +103,7 @@ render: |
- 213:PhVphC
powers:
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:WphA
@ -113,7 +113,7 @@ render: |
- 203:WphA
- 213:WphA
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:WphB
@ -123,7 +123,7 @@ render: |
- 203:WphB
- 213:WphB
- source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:WphC
@ -136,7 +136,7 @@ render: |
{{- if eq .usage "pv" }}
power:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:W
@ -147,7 +147,7 @@ render: |
- 213:W
energy:
source: sunspec
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .id }}
value:
- 201:TotWhExp

View file

@ -35,7 +35,7 @@ render: |
type: custom
power:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
{{- if eq .usage "grid" }}
id: 255
register:
@ -60,7 +60,7 @@ render: |
scale: -1
soc:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 255
register:
address: 1068 # SOC
@ -81,7 +81,7 @@ render: |
value: -{{- .maxdischargepower }} # value must be negative
set:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 255
register:
address: 1074 # max discharge power
@ -95,7 +95,7 @@ render: |
value: 0
set:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 255
register:
address: 1074 # max discharge power

View file

@ -32,21 +32,21 @@ render: |
source: calc
add:
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 100 # com.victronenergy.system
register:
address: 820 # L1 grid power
type: input
decode: int16
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 100 # com.victronenergy.system
register:
address: 821 # L2 grid power
type: input
decode: int16
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 100 # com.victronenergy.system
register:
address: 822 # L3 grid power
@ -55,7 +55,7 @@ render: |
{{- if .meterid }}
currents:
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .meterid }}
register:
address: 2617 # L1 grid current
@ -63,7 +63,7 @@ render: |
decode: int16
scale: 0.1
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .meterid }}
register:
address: 2619 # L2 grid current
@ -71,7 +71,7 @@ render: |
decode: int16
scale: 0.1
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: {{ .meterid }}
register:
address: 2621 # L3 grid current
@ -85,49 +85,49 @@ render: |
source: calc
add:
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 100 # com.victronenergy.system
register:
address: 808 # ACout pv power L1
type: input
decode: uint16
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 100 # com.victronenergy.system
register:
address: 809 # ACout pv power L2
type: input
decode: uint16
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 100 # com.victronenergy.system
register:
address: 810 # ACout pv power L3
type: input
decode: uint16
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 100 # com.victronenergy.system
register:
address: 811 # ACin pv power L1
type: input
decode: uint16
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 100 # com.victronenergy.system
register:
address: 812 # ACin pv power L2
type: input
decode: uint16
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 100 # com.victronenergy.system
register:
address: 813 # ACin pv power L3
type: input
decode: uint16
- source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 100 # com.victronenergy.system
register:
address: 850 # DC pv power
@ -138,7 +138,7 @@ render: |
{{- if eq .usage "battery" }}
power:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 100 # com.victronenergy.system
register:
address: 842 # active DC power
@ -147,7 +147,7 @@ render: |
scale: -1
soc:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 100 # com.victronenergy.system
register:
address: 843 # Soc
@ -158,7 +158,7 @@ render: |
convert: float2int
set:
source: modbus
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
id: 100 # com.victronenergy.system
register:
address: 2901 # limit soc

View file

@ -1,5 +1,5 @@
{{ define "mqtt" }}
broker: {{ .host }}:{{ .port }}
broker: {{ joinHostPort .host .port }}
{{- if .user }}
user: {{ .user }}
{{- end }}

View file

@ -7,15 +7,15 @@ baudrate: {{ .baudrate }}
comset: {{ .comset }}
{{- else if or (eq .modbus "rs485tcpip") .rs485tcpip }}
# RS485 via TCP/IP (Modbus RTU)
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
rtu: true
{{- else if or (eq .modbus "tcpip") .tcpip }}
# Modbus TCP
uri: {{ .host }}:{{ .port }}
uri: {{ joinHostPort .host .port }}
rtu: false
{{- else if or (eq .modbus "udp") .udp }}
# Modbus UDP
uri: {{ .host }}:{{ if (ne .port "502") }}{{ .port }}{{ else }}8899{{ end }}
uri: {{ joinHostPort .host .port }}
udp: true
rtu: true
{{- else }}

View file

@ -3,6 +3,7 @@ package templates
import (
"bytes"
"fmt"
"net"
"net/url"
"strings"
"text/template"
@ -70,6 +71,13 @@ func FuncMap(tmpl *template.Template) *template.Template {
"timeRound": func(t time.Time, d time.Duration) time.Time {
return t.Round(d)
},
"joinHostPort": func(host, port string) string {
res := net.JoinHostPort(host, port)
if strings.Contains(host, ":") {
return `"` + res + `"`
}
return res
},
"urlEncode": url.QueryEscape,
"unquote": unquote,
"quote": yamlQuote,