ah, got it!
changed the rule a bit, but motor is not triggered even '[Dummy#Concat]=1101'
also 'TaskValueSet 7,3,1' is not set.
Seems like the 'if' is to working, but dont know why.
[Dummy#Concat] is updated as expected.
Code: Select all
//999 default
//1[Dummies#Tag][Reed1-oben#Switch][Reed2-unten#Switch]
//1110 day door open
//1101 day door down
//1010 night door open
//1001 night door down
On System#Boot do
TaskValueSet 7,1,0 // no day = 0
TaskValueSet 7,2,100 // Helligkeit on dummy sensor
TaskValueSet 7,3,0 // DC Motor off
TaskValueSet 7,4,0 // Timer off
TaskValueSet 8,1,999 // To concat of some dummys (named Dummy#Concat) '999' just as a default ref
timerSet,2,10
endon
// day or night
On Lichtsensor#Analog do
if [Lichtsensor#Analog] > [Dummies#HelligkeitTriggerTag]
TaskValueSet 7,1,1
else
TaskValueSet 7,1,0
endif
endon
On Dummy#Concat do
// if day and door not open than motor backwards
if [Dummy#Concat]=1101
WemosMotorShieldCMD 0 Backward 50
TaskValueSet 7,3,1
timerSet,1,60
timerSet,2,0
endif
// if night and door not closed than motor backwards
if [Dummy#Concat]=1010
WemosMotorShieldCMD 0 Forward 50
TaskValueSet 7,3,1
timerSet,1,60
timerSet,2,0
endif
// you can add multiple [Dummy#Concat]= statements here...
endon
//every 10 sek Timer1 is adding values from the devices to the concat dummy
On Rules#Timer=1 do
TaskValueSet 8,1,1[Dummies#Tag][Reed1-oben#Switch][Reed2-unten#Switch]
timerSet,1,10
endon
// if motor run for more than 60 seconds and no reed is read, stop
On Rules#Timer=2 do
if [Dummies#DCmotor]=1
WemosMotorShieldCMD 0 Stop
TaskValueSet 7,3,0
endif
timerSet,1,10
endon