Skip to content

Commit 4770b4c

Browse files
naltatisclaude
andauthored
Add documentation for valid plugin (#912)
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8b70d19 commit 4770b4c

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

docs/devices/plugins.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Neben diesen Integrations-Plugins, gibt es noch Helfer-Plugins, die Zusatzfunkti
3434
- [Const Plugin](#const) - Spezielles Plugin das einfach einen konstanten Wert zurückliefert.
3535
- [Calc Plugin](#calc) - Meta-Plugin um Ausgaben von anderen Plugins arithmetisch zu verknüpfen.
3636
- [Combined Plugin](#combined) - Meta-Plugin speziell für `charger` um die booleschen Status-Werte für den angeschlossenen (_plugged_) und ladenden (_charging_) Zustand zu einem einzigen Ladestatus zu kombinieren.
37+
- [Valid Plugin](#valid) - Meta-Plugin um Plugin-Werte basierend auf einer booleschen Validierung bereitzustellen.
3738

3839
### Syntax
3940

@@ -555,3 +556,26 @@ charging:
555556
source: mqtt
556557
topic: openWB/lp/1/boolChargeStat
557558
```
559+
560+
### Valid <Tag label="lesen" category="read" /> {#valid}
561+
562+
Das `valid` Plugin ermöglicht es, Plugin-Werte basierend auf einer booleschen Validierung bereitzustellen.
563+
Es trennt die Gültigkeit eines Werts von dessen eigenem Inhalt.
564+
Wenn die Validierung `false` zurückgibt, wird der Wert als nicht verfügbar betrachtet.
565+
566+
Dies ist besonders nützlich für Integrationen wie ioBroker, die Gültigkeit und Wert getrennt bereitstellen.
567+
568+
**Beispiel Lesen**:
569+
570+
```yaml
571+
source: valid
572+
valid:
573+
source: mqtt
574+
topic: iobroker/wallbox/power/valid
575+
value:
576+
source: mqtt
577+
topic: iobroker/wallbox/power/value
578+
```
579+
580+
In diesem Beispiel wird der Wert nur verwendet, wenn das `valid` Topic `true` zurückgibt.
581+
Wenn es `false` zurückgibt, wird der Wert als nicht verfügbar markiert.

i18n/en/docusaurus-plugin-content-docs/current/devices/plugins.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ In addition to these integration plugins, there are also helper plugins that pro
3434
- [Const Plugin](#const) - Special plugin that simply returns a constant value.
3535
- [Calc Plugin](#calc) - Meta-plugin for arithmetically linking outputs from other plugins.
3636
- [Combined Plugin](#combined) - Meta-plugin specifically for `charger` to combine the boolean status values for the connected (_plugged_) and charging (_charging_) state into a single charging status.
37+
- [Valid Plugin](#valid) - Meta-plugin for providing plugin values based on boolean validation.
3738

3839
### Syntax
3940

@@ -555,3 +556,26 @@ charging:
555556
source: mqtt
556557
topic: openWB/lp/1/boolChargeStat
557558
```
559+
560+
### Valid <Tag label="read" category="read" /> {#valid}
561+
562+
The `valid` plugin allows providing plugin values based on boolean validation.
563+
It separates the validity of a value from its actual content.
564+
If the validation returns `false`, the value is considered unavailable.
565+
566+
This is particularly useful for integrations like ioBroker that provide validity and value separately.
567+
568+
**Reading Example**:
569+
570+
```yaml
571+
source: valid
572+
valid:
573+
source: mqtt
574+
topic: iobroker/wallbox/power/valid
575+
value:
576+
source: mqtt
577+
topic: iobroker/wallbox/power/value
578+
```
579+
580+
In this example, the value is only used when the `valid` topic returns `true`.
581+
If it returns `false`, the value is marked as unavailable.

0 commit comments

Comments
 (0)