- The configure intents to present devices that implement multiple usages in a single device or have linked templates and provide an easier step by step configuration experience e.g. by not asking for the same data for different usages over and over again
- Commit 880557594f changes this behaviour and now presents all devices that have multiple usages, e.g. meters that could be used as battery or pv meter
- This change introduces a new property `allineone` that should be used with the `usage` `param` the identify a device that implements multiple usages in the same device
- The filter to present these devices is extended by checking for this property
38 lines
954 B
YAML
38 lines
954 B
YAML
template: powerdog
|
|
products:
|
|
- description:
|
|
generic: Powerdog
|
|
params:
|
|
- name: usage
|
|
choice: ["grid", "pv"]
|
|
allinone: true
|
|
- name: modbus
|
|
choice: ["tcpip"]
|
|
render: |
|
|
type: custom
|
|
power:
|
|
{{- if eq .usage "grid" }}
|
|
source: calc #calculate current overall consumption + (current pv effort * (-1) )
|
|
add:
|
|
- source: modbus
|
|
{{- include "modbus" . | indent 4 }}
|
|
register:
|
|
address: 40026 #register for overall consumption
|
|
type: holding
|
|
decode: int32
|
|
- source: modbus
|
|
{{- include "modbus" . | indent 4 }}
|
|
register:
|
|
address: 40002 #register for pv effort
|
|
type: holding
|
|
decode: int32
|
|
scale: -1 #scale with -1 to get a substraction
|
|
{{- end }}
|
|
{{- if eq .usage "pv" }}
|
|
source: modbus
|
|
{{- include "modbus" . | indent 2 }}
|
|
register:
|
|
address: 40002 #register for pv effort
|
|
type: holding
|
|
decode: int32
|
|
{{- end }}
|