Hey guys I've tried this again with dev 11 and im still having issues. I'm using this to control my hydroponocs setup
Running a total of 8 timers that are used to control the on /off times of 4 relays. These timer values are saved by using 2 dummy devices, which allows me to change the on/off schedule for day and night.
In addition there are a few other temperatures and gpio that im reading. In total I'm using 12 devices.
- the thing runs ok if I set the controller to standalone only but if I set it to http domotics it freezes up.
Code: Select all
on system enable#status=1 do
Timerset,1,10
Timerset,3,20
Timerset,5,30
Timerset,7,10
TaskValueSet 9,1,3
TaskValueSet 9,2,237
TaskValueSet 9,3,2
TaskValueSet 9,4,238
TaskValueSet 10,1,2
TaskValueSet 10,2,298
TaskValueSet 10,3,70
TaskValueSet 10,4,7200
endon
on system enable#status=0 do
gpio,5,1
gpio,4,1
gpio,0,1
gpio,2,1
endon
on rules#timer=1 do
if [system enable#status]=1
gpio,5,0
timerset,2,[Timer1#SprayON1]
endif
endon
on rules#timer=2 do
if [system enable#status]=1
gpio,5,1
timerset,1,[Timer1#SprayOFF1]
endif
endon
on rules#timer=3 do
if [system enable#status]=1
gpio,4,0
timerset,4,[Timer1#SprayON2]
endif
endon
on rules#timer=4 do
If [system enable#status]=1
gpio,4,1
timerset 3,[Timer1#SprayOFF2]
endif
endon
on rules#timer=5 do
if [system enable#status]=1
gpio,0,0
timerset,6,[Timer2#SprayON3]
endif
endon
on rules#timer=6 do
if [system enable#status]=1
gpio,0,1
timerset,5,[Timer2#SprayOFF3]
endif
endon
on rules#timer=7 do
if [system enable#status]=1
gpio,2,1
timerset,8,[Timer2#PumpOFF]
endif
endon
on rules#timer=8 do
if [system enable#status]=1
gpio,2,0
timerset,7,[Timer2#PumpON]
endif
endon
On Pump#Status=1 do
TaskValueSet 12,1,0
TaskValueSet 12,2,0
TaskValueSet 12,3,0
TaskValueSet 12,4,[LOG#Pcount]+1
endon
On top solenoid#status=1 do
TaskValueSet 12,1,[LOG#S1Count]+1
endon
On Middle solenoid#status=1 do
TaskValueSet 12,2,[LOG#S2Count]+1
endon
On Bottom solenoid#status=1 do
TaskValueSet 12,3,[LOG#S3Count]+1
endon
On Clock#Time=All,12:00 do
TaskValueSet 9,1,5
TaskValueSet 9,2,595
TaskValueSet 9,3,5
TaskValueSet 9,4,595
TaskValueSet 10,1,5
TaskValueSet 10,2,595
TaskValueSet 10,3,80
TaskValueSet 10,4,14400
endon
On Clock#Time=All,20:00 do
TaskValueSet 9,1,3
TaskValueSet 9,2,237
TaskValueSet 9,3,2
TaskValueSet 9,4,238
TaskValueSet 10,1,2
TaskValueSet 10,2,298
TaskValueSet 10,3,70
TaskValueSet 10,4,7200
endon