#6
Post
by Mierke » 04 Feb 2017, 12:14
Hi, i'm using this rules to control 4 lights with 2 pushbuttons.
on s2#S do
TaskValueSet 9,1,[tv#tv]+1
TaskValueSet 9,2,[salon#salon]+1
timerSet,1,1
timerSet,2,2
endon
on s1#S do
TaskValueSet 9,3,[keuken#keuken]+1
TaskValueSet 9,4,[eetplaats#eetplaats]+1
timerSet,3,1
timerSet,4,2
endon
on sw2#S=1 do
TaskValueSet 9,1,[Dummy#switch1]-1
if [salon#salon] > 0
gpio,14,0
pwm,14,0
else
gpio,14,1
endif
endon
on sw1#S=1 do
TaskValueSet 9,3,[Dummy#switch3]-1
if [eetplaats#eetplaats] > 0
gpio,2,0
pwm,2,0
else
gpio,2,1
endif
endon
On Rules#Timer=2 do
TaskValueSet 9,1,0
TaskValueSet 9,2,0
endon
On Rules#Timer=4 do
TaskValueSet 9,3,0
TaskValueSet 9,4,0
endon
On Rules#Timer=1 do
if [Dummy#switch1] = 1
gpio,13,1
else
gpio,13,0
pwm,13,0
endif
endon
On Rules#Timer=3 do
if [Dummy#switch3] = 1
gpio,0,1
else
gpio,0,0
pwm,0,0
endif
endon
<> Task Device Name Port IDX/Variable GPIO Values
Edit 1 Temperature - DS18b20 Garage 28-b1-a6-3b-5-0-0-68 65 GPIO-16 Temperature garage:24.63
Edit 2 Switch input keuken GPIO-0 keuken: 0
Edit 3 Switch input eetplaats GPIO-2 eetplaats: 0
Edit 4 Switch input tv GPIO-13 tv: 0
Edit 5 Switch input salon GPIO-14 salon: 0
Edit 6 Switch input s1 GPIO-12 S: 1
Edit 7 Switch input s2 GPIO-15 S: 1
Edit 8
Edit 9 Dummy Device Dummy switch1:0.00
switch2:0.00
switch3:0.00
switch4:0.00
Edit 10 Switch input sw1 GPIO-12 S: 0
Edit 11 Switch input sw2 GPIO-15 S: 0
Edit 12