Config UI: Modbus Comset 8N2, i18n (#20830)

This commit is contained in:
Michael Geers 2025-04-24 14:49:13 +02:00 • committed by GitHub
parent 3c3ab44594
commit ef0a12d9a4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 73 additions and 17 deletions

View file

@ -2,11 +2,11 @@
<FormRow
v-if="showConnectionOptions"
id="modbusTcpIp"
label="Modbus Connection"
:label="$t('config.modbus.connection')"
:help="
connection === 'tcpip'
? 'The device is addressable from evcc via LAN/Wifi.'
: 'The device is diretly connected to evcc via a RS485 interface.'
? $t('config.modbus.connectionHintTcpip')
: $t('config.modbus.connectionHintSerial')
"
>
<div class="btn-group" role="group">
@ -20,7 +20,9 @@
tabindex="0"
autocomplete="off"
/>
<label class="btn btn-outline-primary" for="modbusTcpIp">Network</label>
<label class="btn btn-outline-primary" for="modbusTcpIp">
{{ $t("config.modbus.connectionValueTcpip") }}
</label>
<input
id="modbusSerial"
v-model="connection"
@ -31,10 +33,12 @@
tabindex="0"
autocomplete="off"
/>
<label class="btn btn-outline-primary" for="modbusSerial">Serial / USB</label>
<label class="btn btn-outline-primary" for="modbusSerial">
{{ $t("config.modbus.connectionValueSerial") }}
</label>
</div>
</FormRow>
<FormRow id="modbusId" label="Modbus ID">
<FormRow id="modbusId" :label="$t('config.modbus.id')">
<PropertyField
id="modbusId"
property="id"
@ -46,7 +50,11 @@
/>
</FormRow>
<div v-if="connection === 'tcpip'">
<FormRow id="modbusHost" label="IP address or hostname" help="Example: 192.0.2.2">
<FormRow
id="modbusHost"
:label="$t('config.modbus.host')"
:help="$t('config.modbus.hostHint')"
>
<PropertyField
id="modbusHost"
property="host"
@ -57,7 +65,7 @@
@change="$emit('update:host', $event.target.value)"
/>
</FormRow>
<FormRow id="modbusPort" label="Port">
<FormRow id="modbusPort" :label="$t('config.modbus.port')">
<PropertyField
id="modbusPort"
property="port"
@ -71,11 +79,11 @@
<FormRow
v-if="showProtocolOptions"
id="modbusTcp"
label="Modbus Protocol"
:label="$t('config.modbus.protocol')"
:help="
protocol === 'tcp'
? 'Device has native LAN/Wifi support or is connected through a RS485 to Ethernet adapter with protocol translation.'
: 'Connection through a RS485 to Ethernet adapter without protocol translation.'
? $t('config.modbus.protocolHintTcp')
: $t('config.modbus.protocolHintRtu')
"
>
<div class="btn-group" role="group">
@ -89,7 +97,9 @@
tabindex="0"
autocomplete="off"
/>
<label class="btn btn-outline-primary" for="modbusTcp">TCP</label>
<label class="btn btn-outline-primary" for="modbusTcp">
{{ $t("config.modbus.protocolValueTcp") }}
</label>
<input
id="modbusRtu"
v-model="protocol"
@ -100,12 +110,18 @@
tabindex="0"
autocomplete="off"
/>
<label class="btn btn-outline-primary" for="modbusRtu">RTU</label>
<label class="btn btn-outline-primary" for="modbusRtu">
{{ $t("config.modbus.protocolValueRtu") }}
</label>
</div>
</FormRow>
</div>
<div v-else>
<FormRow id="modbusDevice" label="Device name" help="Example: /dev/ttyUSB0">
<FormRow
id="modbusDevice"
:label="$t('config.modbus.device')"
:help="$t('config.modbus.deviceHint')"
>
<PropertyField
id="modbusDevice"
property="device"
@ -116,7 +132,7 @@
@change="$emit('update:device', $event.target.value)"
/>
</FormRow>
<FormRow id="modbusBaudrate" label="Baudrate">
<FormRow id="modbusBaudrate" :label="$t('config.modbus.baudrate')">
<PropertyField
id="modbusBaudrate"
property="baudrate"
@ -128,7 +144,7 @@
@change="$emit('update:baudrate', $event.target.value)"
/>
</FormRow>
<FormRow id="modbusComset" label="ComSet">
<FormRow id="modbusComset" :label="$t('config.modbus.comset')">
<PropertyField
id="modbusComset"
property="comset"
@ -203,7 +219,7 @@ export default defineComponent({
return this.connection === "tcpip" && this.capabilities.includes("rs485");
},
comsetOptions() {
return ["8N1", "8E1"].map((v) => {
return ["8N1", "8E1", "8N2"].map((v) => {
return { key: v, name: v };
});
},

View file

@ -279,6 +279,26 @@ battery = "Hausbatterie hinzufügen"
ext = "Zusätzlichen Zähler hinzufügen"
pv = "PV-Anlage hinzufügen"
[config.modbus]
baudrate = "Baudrate"
comset = "ComSet"
connection = "Modbus Verbindung"
connectionHintSerial = "Das Gerät ist direkt an evcc über eine RS485 Schnittstelle angeschlossen."
connectionHintTcpip = "Das Gerät ist von evcc aus über LAN/Wifi erreichbar."
connectionValueSerial = "Seriell / USB"
connectionValueTcpip = "Netzwerk"
device = "Gerätename"
deviceHint = "Beispiel: /dev/ttyUSB0"
host = "IP Adresse oder Hostname"
hostHint = "Beispiel: 192.0.2.2"
id = "Modbus ID"
port = "Port"
protocol = "Modbus Protokoll"
protocolHintRtu = "Verbindung über eine RS485 Schnittstelle an einem Ethernet Adapter ohne Protokollübersetzung."
protocolHintTcp = "Gerät hat native LAN/Wifi Unterstützung oder ist über eine RS485 Schnittstelle an einen Ethernet Adapter mit Protokollübersetzung angeschlossen."
protocolValueRtu = "RTU"
protocolValueTcp = "TCP"
[config.modbusproxy]
description = "Erlaubt mehreren Clients den Zugriff auf ein einzelnes Modbus-Gerät."
title = "Modbus-Proxy"

View file

@ -279,6 +279,26 @@ battery = "Add battery meter"
ext = "Add external meter"
pv = "Add solar meter"
[config.modbus]
baudrate = "Baud rate"
comset = "ComSet"
connection = "Modbus connection"
connectionHintSerial = "The device is directly connected to evcc via a RS485 interface."
connectionHintTcpip = "The device is addressable from evcc via LAN/Wifi."
connectionValueSerial = "Serial / USB"
connectionValueTcpip = "Network"
device = "Device name"
deviceHint = "Example: /dev/ttyUSB0"
host = "IP address or hostname"
hostHint = "Example: 192.0.2.2"
id = "Modbus ID"
port = "Port"
protocol = "Modbus protocol"
protocolHintRtu = "Connection through a RS485 to Ethernet adapter without protocol translation."
protocolHintTcp = "Device has native LAN/Wifi support or is connected through a RS485 to Ethernet adapter with protocol translation."
protocolValueRtu = "RTU"
protocolValueTcp = "TCP"
[config.modbusproxy]
description = "Allow multiple clients to access a single Modbus device."
title = "Modbus Proxy"