Hi
I am trying to get my sunshades down automaticly when the measured light level is above 10000 lux.
Sensor: Licht_RegenSensor1
Reading: brightness (value between 0 and 50000 or so)
Sunshade: Zonnescherm (up or down command)
So i tried:
define ZonneschermLichtDown notify Licht_RegenSensor1:.*brightness:.*>10000.* set Zonnescherm down
define ZonneschermLichtDown notify IF ([Licht_RegenSensor1:brightness] > 10000) (set Zonnescherm down)
and about 10 variants on this, but nothing works.
Anybody have a good idea about this?
thanks, Peter
Hello,
first of all - I used THRESHOLD for things like this. If you use IF you may use ReadingsVal to get the value of the Reading brigtness.
define xxx notify Sensor:brightness IF (ReadingsVal(Sensor, reading, default) > 10000) (set ....)
Gruß Christoph
Hi Peter,
the important hint from Christoph is: you need a trigger pattern!
ZitatDefine
define <name> notify <pattern> <command>
Execute a command when received an event for the definition <pattern>.
In your case the device Licht_RegenSensor1 could be the trigger or more sharp: a certain event from this device - may be Licht_RegenSensor1:brightness or Licht_RegenSensor1:.*brightness:.*
I don't know the events from this device. You could use the Event monitor to look for Events and generate the notify himself!
Especially for "IF" the syntax IF ([Licht_RegenSensor1:brightness] > 10000) (set Zonnescherm down) should be working too. In the same way like IF (ReadingsVal(Sensor, reading, default) > 10000) (set ....)
Regards Otto
Thanks guys, I am going to try some stuff out!
Ok, so this works:
define ZonneschermLicht THRESHOLD Licht_RegenSensor1:brightness:6000:10000 Zonnescherm|set @ down|set @ up
But I want to add a second reading; rain. If it rains, it should never go out.
Would that be something like:
define ZonneschermLicht THRESHOLD Licht_RegenSensor1:brightness:6000:10000 AND Licht_RegenSensor1:regen1:off Zonnescherm|set @ down|set @ up|
Use DOIF for that, it allows numerical comparison as well as logical conditions.
LG
pah
Cool thanks, never checked that function out actually.
Ok, to make it a little more difficult ;D :
I need a buffer. I want the sunscreen to not DIRECTLY respond, but when the lux value has been over/under threshold for a specific time (say, 2 minutes). Is that possible?