I am trying to build a door automatic on wemos D1 mini with mega 24052018.
Created a plugin to control wemos motorshield.
I am trying to build rules bases on light sensor and reed switches.
The rules below do work, but not together. Together the motor stops and starts every second.
Can somebody guide me to the correct rule settings?
https://drive.google.com/open?id=1vbuuN ... ZweMvd6Kkh
Code: Select all
On System#Boot do
TaskValueSet 7,1,0 // no day = 0
TaskValueSet 7,2,100.00 // Helligkeit on dummy sensor
TaskValueSet 7,3,0 // DC Motor off
TaskValueSet 7,4,0 // Timer off
endon
// day or night
On Lichtsensor#Analog do
if [Lichtsensor#Analog] > [Dummies#HelligkeitTriggerTag]
TaskValueSet 7,1,1
else
TaskValueSet 7,1,0
endif
endon
// if day and door not open than motor backwards
On Dummies#Tag do
if [Dummies#Tag]=1 and [Reed1-oben#Switch]=0
WemosMotorShieldCMD 0 Backward 50
TaskValueSet 7,3,1
else
WemosMotorShieldCMD 0 Stop
TaskValueSet 7,3,0
endif
endon
// if night and door not closed than motor forward
On Dummies#Tag do
if [Dummies#Tag]=0 and [Reed2-unten#Switch]=0
WemosMotorShieldCMD 0 Forward 50
TaskValueSet 7,3,1
else
WemosMotorShieldCMD 0 Stop
TaskValueSet 7,3,0
endif
endon