DOIF mit Abfrage vom Statistikmodul

Begonnen von FEHMPiDi, 29 Juli 2018, 21:08:23

Vorheriges Thema - Nächstes Thema

FEHMPiDi

Hallo,

ich möchte in einem Doif gern Werte vom Statistikmodul abfragen.
Das Reading im Statistikmodul enthält aber mehr als ein Reading.

statRain        Hour: 0.0 Day: 0.0 Month: 30.3 Year: -1504.2

Wie frage ich das jetzt also im Doif ab:
Mein Device heißt CTW600, das Reading dann statRain. Wie komme ich an die einzelnen Werte für Hour, Day, Month und Year ran?

[CTW600_RaPI2:statRain]

Danke
Diirk

FHEM5.7@RaspPi.3|NanoCUL868-HM|NanoCUL868-Max|SDuino|DS18B20|1xHM-Sen-MDIR-WM55|   
2xHM-LC-Sw1PBU-FM|HM-LC-SW4-DR|I2C_MCP23017|2xMAX-ShutterContact|11xHM-LC-Bl1PBU-FM|CTW600|VCONTROL|1xHM-Sen-MDIR-O|2xMilight

Damian

Dafür kannst du DOIF-Filter nutzen: https://fhem.de/commandref_DE.html#DOIF_Filtern_nach_Zahlen

Ich mache den Anfang, du machst den Rest.

[CTW600_RaPI2:statRain:"hour: (\d+\.\d+)"]
Programmierte FHEM-Module: DOIF-FHEM, DOIF-Perl, DOIF-uiTable, THRESHOLD, FHEM-Befehl: IF

FEHMPiDi

Hi,

danke. Dann hoffe ich mal das ich das so richtig verstanden habe. Ich werde es bald merken...

[CTW600_RaPI2:statRain:"Hour: (\d+\.\d+)" < 1] and [CTW600_RaPI2:statRain:"Day: (\d+\.\d+)" < 1]

Gruß
FHEM5.7@RaspPi.3|NanoCUL868-HM|NanoCUL868-Max|SDuino|DS18B20|1xHM-Sen-MDIR-WM55|   
2xHM-LC-Sw1PBU-FM|HM-LC-SW4-DR|I2C_MCP23017|2xMAX-ShutterContact|11xHM-LC-Bl1PBU-FM|CTW600|VCONTROL|1xHM-Sen-MDIR-O|2xMilight

Damian

Zitat von: FEHMPiDi am 30 Juli 2018, 10:08:20
Hi,

danke. Dann hoffe ich mal das ich das so richtig verstanden habe. Ich werde es bald merken...

[CTW600_RaPI2:statRain:"Hour: (\d+\.\d+)" < 1] and [CTW600_RaPI2:statRain:"Day: (\d+\.\d+)" < 1]

Gruß

Warum hast du den Vergleich in die Klammer gepackt? Der Klammerausdruck kann nur die Zahl liefern:

[CTW600_RaPI2:statRain:"Hour: (\d+\.\d+)"] < 1 and [CTW600_RaPI2:statRain:"Day: (\d+\.\d+)"] < 1
Programmierte FHEM-Module: DOIF-FHEM, DOIF-Perl, DOIF-uiTable, THRESHOLD, FHEM-Befehl: IF

FEHMPiDi

Oh ja stimmt. Sorry, da hab ich mich wohl geirrt.
FHEM5.7@RaspPi.3|NanoCUL868-HM|NanoCUL868-Max|SDuino|DS18B20|1xHM-Sen-MDIR-WM55|   
2xHM-LC-Sw1PBU-FM|HM-LC-SW4-DR|I2C_MCP23017|2xMAX-ShutterContact|11xHM-LC-Bl1PBU-FM|CTW600|VCONTROL|1xHM-Sen-MDIR-O|2xMilight