Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ export default defineConfig({
link: "/heating",
},
{
label: "User-defined",
translations: { de: "Benutzerdefiniert" },
label: "Plugins",
link: "/plugins",
},
],
Expand Down
36 changes: 36 additions & 0 deletions src/content/docs/de/plugins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Zusätzlich können Plugins auch für die in [Messaging](/de/reference/configura
- [Convert Plugin](#convert) - Meta-Plugin zur Datentyp-Konvertierung beim Schreiben (z. B. float zu int).
- [Delta Plugin](#delta) - Meta-Plugin zur Umwandlung von absoluten Werten in Änderungswerte (Deltas) beim Schreiben.
- [Ignore Plugin](#ignore) - Meta-Plugin zum Unterdrücken spezifischer Fehlermeldungen.
- [IfElse Plugin](#ifelse) - Meta-Plugin für bedingte Schreibvorgänge mit zwei Zweigen (if/else).
- [Map Plugin](#map) - Meta-Plugin zur Übersetzung von Integer-Werten (z. B. gerätespezifische Modi in evcc-Modi).
- [Meter Plugin](#meter-plugin) - Plugin um ein anderes Messgerät als Datenquelle zu verwenden.
- [Sequence Plugin](#sequence) - Meta-Plugin zur sequentiellen Ausführung mehrerer Schreibvorgänge.
Expand Down Expand Up @@ -1039,6 +1040,7 @@ Es wird verwendet, wenn ein Plugin einen anderen Datentyp erwartet als evcc lief
| float2int | Float64 → Int64 (Nachkommastellen werden abgeschnitten) |
| int2float | Int64 → Float64 |
| int2bytes | Int64 → Byte-Array (Big Endian, 8 Bytes) |
| bool2int | Bool → Int64 (true=1, false=0) |

**Beispiel** (evcc liefert float, Gerät erwartet int):

Expand Down Expand Up @@ -1188,6 +1190,40 @@ batterymode:

In diesem Beispiel gibt das Gerät einen harmlosen Modbus-Fehler zurück, der ignoriert wird.

### IfElse <Badge text="schreiben" variant="caution" size="small" />

Das `ifelse` Plugin führt bedingte Schreibvorgänge mit zwei Zweigen aus.
Je nach Eingabewert wird entweder das `if` oder das `else` Plugin ausgeführt.

**Parameter**:

| Parameter | Typ | Erfordert | Beschreibung |
| --------- | ------ | --------- | --------------------------------------------------------- |
| if | config | ja | Plugin, das bei erfüllter Bedingung ausgeführt wird |
| else | config | ja | Plugin, das bei nicht erfüllter Bedingung ausgeführt wird |

**Funktionsweise**:

- Bei `bool` Werten: `true` führt `if` aus, `false` führt `else` aus
- Bei `int64` Werten: `> 0` führt `if` aus, sonst `else`

**Unterstützte Datentypen**: `int64`, `bool`

**Beispiel** (unterschiedliche Endpunkte für An- und Ausschalten):

```yaml
enable:
source: ifelse
if:
source: http
uri: http://device.local/api/on
method: POST
else:
source: http
uri: http://device.local/api/off
method: POST
```

### Map <Badge text="lesen" variant="tip" size="small" /> <Badge text="schreiben" variant="caution" size="small" />

Das `map` Plugin übersetzt Integer-Werte in andere Integer-Werte mithilfe einer Lookup-Tabelle.
Expand Down
36 changes: 36 additions & 0 deletions src/content/docs/en/plugins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Additionally, plugins can also be used for the endpoints described in [Messaging
- [Convert Plugin](#convert) - Meta-plugin for data type conversion when writing (e.g., float to int).
- [Delta Plugin](#delta) - Meta-plugin for converting absolute values to delta/increment values when writing.
- [Ignore Plugin](#ignore) - Meta-plugin for suppressing specific error messages.
- [IfElse Plugin](#ifelse) - Meta-plugin for conditional write operations with two branches (if/else).
- [Map Plugin](#map) - Meta-plugin for translating integer values (e.g., device-specific modes to evcc modes).
- [Meter Plugin](#meter-plugin) - Plugin to use another meter as a data source.
- [Sequence Plugin](#sequence) - Meta-plugin for sequential execution of multiple write operations.
Expand Down Expand Up @@ -1039,6 +1040,7 @@ It is used when a plugin expects a different data type than evcc provides.
| float2int | Float64 → Int64 (decimal places are truncated) |
| int2float | Int64 → Float64 |
| int2bytes | Int64 → Byte array (Big Endian, 8 bytes) |
| bool2int | Bool → Int64 (true=1, false=0) |

**Example** (evcc provides float, device expects int):

Expand Down Expand Up @@ -1188,6 +1190,40 @@ batterymode:

In this example, the device returns a harmless modbus error that is ignored.

### IfElse <Badge text="write" variant="caution" size="small" />

The `ifelse` plugin performs conditional write operations with two branches.
Depending on the input value, either the `if` or the `else` plugin is executed.

**Parameters**:

| Parameter | Type | Required | Description |
| --------- | ------ | -------- | --------------------------------------------- |
| if | config | yes | Plugin executed when the condition is met |
| else | config | yes | Plugin executed when the condition is not met |

**How it works**:

- For `bool` values: `true` runs `if`, `false` runs `else`
- For `int64` values: `> 0` runs `if`, otherwise runs `else`

**Supported data types**: `int64`, `bool`

**Example** (different endpoints for enabling and disabling):

```yaml
enable:
source: ifelse
if:
source: http
uri: http://device.local/api/on
method: POST
else:
source: http
uri: http://device.local/api/off
method: POST
```

### Map <Badge text="read" variant="tip" size="small" /> <Badge text="write" variant="caution" size="small" />

The `map` plugin translates integer values to other integer values using a lookup table.
Expand Down