rules for roller shutter on nodemcu+relays 2ch
Posted: 23 Sep 2018, 01:22
hi, i have:
n°1 nodemcu with espeasy 192.168.0.151
n° raspberry with domoticz 192.168.0.105
n°1 ralay arduino 2ch
i want to:
control with wall switch the blind (up and down)
control with domoticz (up and down...and STOP)
put with domoticz at 50% opening or 20% opening or 80%opening and so on...
now, i created on espeasy this tasks:
and under esp rules i create this rules:
with external wall switch is perfect:
if i put GPIO3 (wall switch UP) or GPIO1 (wall switch DOWN) to GND the relay (GPIO12 UP or GPIO15 DOWN) are activated for 10seconds and then turn off
i added a rule to prevent that if i click on wall switch gpio1 down and i press gpio3 up when the gpio1 is still active the system stop GPIO1 and acrivate GPIO3.
and also that works well
the problems come with domoticz
i put same idx=24 in rele_gpio12 and rele_gpio15 because when i create a dummy sensor as switch and then i modify it from switch web page in "venetian blinds EU" i have only to commad to write here:
1) action for power on
2) action for power off
i write there:
http://192.168.0.151/control?cmd=GPIO,12,1
that activate relay ch1 to go UP
http://192.168.0.151/control?cmd=GPIO,15,1
that activate relay ch2 to go DOWN
if i click open the relay ch1 open for 6sec (ok)
if i click close the relay ch2 open for 6sec (ok)
but howto i can stop if i not want to wait 6sec?
how can i change the rules to have for example: if i press the wall switch for 3second -> open the relay for 6sec; if i press the wall switch for less than 3 second, put off thre relativle channel relay?
what i have to do to control the blinds with domoticz? and also manage the stop? and the percentage opening?
thanks
n°1 nodemcu with espeasy 192.168.0.151
n° raspberry with domoticz 192.168.0.105
n°1 ralay arduino 2ch
i want to:
control with wall switch the blind (up and down)
control with domoticz (up and down...and STOP)
put with domoticz at 50% opening or 20% opening or 80%opening and so on...
now, i created on espeasy this tasks:
and under esp rules i create this rules:
Code: Select all
on pulsante_gpio3#Switch do
if [pulsante_gpio3#Switch]=1
gpio,12,1 //closing
else
gpio,12,0
endif
endon
on pulsante_gpio1#Switch do
if [pulsante_gpio1#Switch]=1
gpio,15,1 //opening
else
gpio,15,0
endif
endon
on rele_gpio12#Switch do
if [rele_gpio12#Switch]=1 //closing
gpio,15,0 // set off relay to opening
SendToHTTP 192.168.0.105,8085,/json.htm?type=command¶m=switchlight&idx=24&switchcmd=On
timerSet,1,6 //timer 1 set for 6 secondi
endif
endon
on STOP#Switch do
if [rele_gpio12#Switch]=0 or [rele_gpio15#Switch]=0
timerSet,1,0 //timer to STOP
endon
On Rules#Timer=1 do
gpio,12,0 //stop relè
gpio,15,0
endOn
on rele_gpio15#Switch do
if [rele_gpio15#Switch]=1 //now opening
gpio,12,0 //put off relay of closing
SendToHTTP 192.168.0.105,8085,/json.htm?type=command¶m=switchlight&idx=24&switchcmd=Off
timerSet,1,6 //timer 1 set for 6 secondi
endif
endon
if i put GPIO3 (wall switch UP) or GPIO1 (wall switch DOWN) to GND the relay (GPIO12 UP or GPIO15 DOWN) are activated for 10seconds and then turn off
i added a rule to prevent that if i click on wall switch gpio1 down and i press gpio3 up when the gpio1 is still active the system stop GPIO1 and acrivate GPIO3.
and also that works well
the problems come with domoticz
i put same idx=24 in rele_gpio12 and rele_gpio15 because when i create a dummy sensor as switch and then i modify it from switch web page in "venetian blinds EU" i have only to commad to write here:
1) action for power on
2) action for power off
i write there:
http://192.168.0.151/control?cmd=GPIO,12,1
that activate relay ch1 to go UP
http://192.168.0.151/control?cmd=GPIO,15,1
that activate relay ch2 to go DOWN
if i click open the relay ch1 open for 6sec (ok)
if i click close the relay ch2 open for 6sec (ok)
but howto i can stop if i not want to wait 6sec?
how can i change the rules to have for example: if i press the wall switch for 3second -> open the relay for 6sec; if i press the wall switch for less than 3 second, put off thre relativle channel relay?
what i have to do to control the blinds with domoticz? and also manage the stop? and the percentage opening?
thanks