Hello.
Can anybody explain to me how to compare reading "temperature" with numbers or even better with attribute owg_th?
I found an example in commandref but it doesn't work.
IF ([outdoor:humidity] > 70) (set switch1 off)
Any ideas how to make this work?
I haven't used IF but a short extract from a similar statement in commandref..
IF state query of the device "outdoor" in the condition:
Do you have a device named outdoor that has a humidity reading?
This is an example. Of course I edited it and it didnt work.
Hello,
could you please post the output of "list DEVICENAME". There the readings are listed.
Hey there must be a notify before IF.
define check_humidity notify outdoor.* IF ([outdoor:humidity] > 70) (set switch1 off)
If there was a new reading / new data from the device "outdoor" the reading humidity was checked.
I guessIF ([your_device:temperature > 70) (set switch1 off)
would test reading temperature in your_device greater than the value 70
If it's not a number then you need to use gt, lt, eq, ne etc. and enclose the characters in quotes - see other IF examples
With respect to an attribute, see http://fhem.de/commandref.html#perl (http://fhem.de/commandref.html#perl) section in commandref, specifically AttrVal(<devicename>,<attribute>,<defaultvalue>)
define heating_notify1 notify OWX_T {IF ([OWX_T:temperature] gt 53) { fhem("set relay blink 10 1")}}
This is an actual code.
It would still help to see list DEVICENAME as suggested above, and for relay too!
If 53 is char and not numeric then use of gt is OK but 53 should be "53" - as noted in my earlier post and the examples
Is relay a defined device? Does set relay blink 10 1
do what you expect from the fhem commandline?
Why {} ?
I have a working notify like:
define xxx notify Fensterkontakt_01.open IF (ReadingsVal("Rollo_01","pct",0) != 100) (set Rollo_01 100)
try this one
define heating_notify1 notify OWX_T.* IF ([OWX_T:temperature] gt 53) (set relay blink 10 1)
Thank you, I finally got it working!