RULES: control between sensors

Moderators: Voyager, BertB, rtenklooster, Stuntteam, grovkillen, TD-er

Post Reply
Message
Author
giobbe
Normal user
Posts: 12
Joined: 20 Mar 2017, 10:29

RULES: control between sensors

#1 Post by giobbe » 20 Nov 2018, 17:16

Hello,
I'm writing a Rules for Espeasy 2 that has to check me on temperature sensors and to satisfy a condition to open a valve.
I created a Dummy Sensor to write the old temperature value on it to check the current value.
Only I do not control temperatures (if [TEMP-BOILER#Temperature] < [OLD-TEMP#TemperatureB]).
How do I make the control between sensors?
My Rules is:

on TEMP-BOILER#Temperature do
if [OLD-TEMP#Attivo] != 3
event,controllatempb
endif
endon

on controllatempb do
if [TEMP-BOILER#Temperature] < [OLD-TEMP#TemperatureB]
TaskValueSet 3,1,[TEMP-BOILER#Temperature]
event,controllaboiler
endif
if [TEMP-BOILER#Temperature] > [OLD-TEMP#TemperatureB]
TaskValueSet 3,1,[TEMP-BOILER#Temperature]
event,controllaboiler
endif
endon

on controllaboiler do
if [TEMP-BOILER#Temperature] > 36.00
gpio,11,0
gpio,12,1
gpio,13,0
TaskValueSet 3,2,1
MotorShieldCMD,DCMotor,1,Backward,250
timerSet,2,5
else
gpio,11,0
gpio,12,0
gpio,13,1
TaskValueSet 3,2,2
MotorShieldCMD,DCMotor,1,Forward,250
timerSet,2,5
endif
endon

on Rules#Timer=2 do //When Timer2 expires, do
MotorShieldCMD,DCMotor,1,Release // spegne motore valvola1
endon


Thanks
Giobbe

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest