ReadingsVal wrong timespec

Begonnen von gent, 25 Juli 2024, 20:22:26

Vorheriges Thema - Nächstes Thema

gent

Hi,

folgender Code in einem DoIF liefert wrong timespec, warum nur?

([ecowitt:data_outdoor_app_temp_value] > 23 and [ReadingsVal("FL_DECT_REP","temperature",99)] > 24)
(set Rollo_Flur pct 25)

Der Unterschied zwischen ecowitt:data_outdoor_app_temp_value und FL_DECT_REP:temperature ist, dass letzteres den Wert nicht als Zahl, sondern so liefert "24.0 C (measured)"

Ich dachte, das kann man dann mit ReadingsVal in eine Zahl umwandeln.

Wie kommt da jetzt eine "timespec" ins Spiel?

Viele Grüße
Holger
fhem auf rPi3 mit USB boot und M2, cul866 (hm), homebridge, FlowerSens, Shelly, Harmony, WemosD1, Sonoff/Tasmota, grafana, mqtt/mosquitto

Otto123

#1
Zitat von: gent am 25 Juli 2024, 20:22:26ReadingsVal in eine Zahl umwandeln.
ReadingsVal
ReadingsNum
siehe Doku https://fhem.de/commandref_DE.html#perl

Vorschlag (ungetestet)
([ecowitt:data_outdoor_app_temp_value:d] > 23 and [FL_DECT_REP:temperature:d] > 24)
(set Rollo_Flur pct 25)
siehe Doku https://fhem.de/commandref_DE.html#DOIF_Filtern_nach_Zahlen

Zitat von: gent am 25 Juli 2024, 20:22:26Wie kommt da jetzt eine "timespec" ins Spiel?
Weil DOIF denkt Du liest eine Zeit aus...

Gruß Otto
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

gent

Danke. Ich hab's mir mal wieder zu umständlich gemacht. Ich konnte nicht ahnen, dass DoIF da schon von sich aus etwas anbietet. Aber so ist es eben, wenn man nur ab und zu mal was neues ausprobieren will.

Liebe Grüße
fhem auf rPi3 mit USB boot und M2, cul866 (hm), homebridge, FlowerSens, Shelly, Harmony, WemosD1, Sonoff/Tasmota, grafana, mqtt/mosquitto

Prof. Dr. Peter Henning

Zitat von: gent am 25 Juli 2024, 20:38:46DoIF da schon von sich aus etwas anbietet.
Nicht doch. Das sind FHEM Basics, das hat mit Doif nichts zu tun.

LG

pah