Hello,
since i can´t create a rule which depends on sunrise/sunset, i created a temp-switch that switches ON and off on sunrise/sunset (using it external)
So i want that the lights /PIR only turns ON/OFF when it´s dark outside.
The problem is, that it doesn´t matter if the switch is ON or OFF, the rule "if switch2#switch2 = 1" will be ignored and it always goes through, so the lights still turns on and off
if switch2#switch2 = 1
On pir#switch do
pwm,4,1
timerSet,1,20
endon
On Rules#Timer=1 do
pwm,4,0
endon
endif
Any ideas ? Using R120 with ESP12 wemos.
Problems using rules
Moderators: grovkillen, Stuntteam, TD-er
Re: Problems using rules
This is the rule I use to control my hot water
I use dummy switches controlled by domoticz for occupancy and if its night / day
also after the boiler starts heating the water a timer is set to check the boiler temperature has heated, if not I get a notification.
I also have some overide switches
Code: Select all
On thermon do
pcfgpio,3,0 //turn on
endon
On thermoff do
pcfgpio,3,1 //turn off
endon
on Hotwater#Temperature<39 do
if [dumb#Occupied]=1
if [dumb#Night]=0
event,thermon
timerSet,1,200
endon
On Rules#Timer=1 do
if Boiler#Temperature<30 do
TaskValueSet 10,1,100
endon
on Hotwater#Temperature>39 do
event,thermoff
TaskValueSet 10,1,5
endon
on Hotwater#Temperature<28 do
event,thermoff
TaskValueSet 10,1,1
endon
on occupied do
TaskValueSet 9,1,1
endon
on notoccupied do
TaskValueSet 9,1,0
endon
On Clock#Time=all,22:30 do
TaskValueSet 9,2,1
endon
On Clock#Time=all,06:00 do
TaskValueSet 9,2,0
endon
on hw_over_ride_on do
TaskValueSet 9,2,0
endon
on hw_over_ride_off do
TaskValueSet 9,2,1
endon
also after the boiler starts heating the water a timer is set to check the boiler temperature has heated, if not I get a notification.
I also have some overide switches
Re: Problems using rules
Below my code for a task like yours
GPIO12 is the relais for the light
PIR#motion is the PIR
dummy#light is the externally controlled dummy switch for day/night
i´d say you have to swap your first 2 lines ?
GPIO12 is the relais for the light
PIR#motion is the PIR
dummy#light is the externally controlled dummy switch for day/night
i´d say you have to swap your first 2 lines ?
Code: Select all
On System#Boot do
gpio,5,1
endon
On PIR#motion=1 do
if [dummy#light]=1
gpio,12,1
timerSet,1,60
else
endif
endon
On Rules#Timer=1 do
gpio,12,0
endon
Re: Problems using rules
Thank you !
... Working !!
... Working !!
Who is online
Users browsing this forum: No registered users and 54 guests