rules backup;
trying to fix mqtt freeze
This commit is contained in:
BIN
src/ESPEasy/config_Garden_U0_Build20116_202210.dat
Normal file
BIN
src/ESPEasy/config_Garden_U0_Build20116_202210.dat
Normal file
Binary file not shown.
62
src/ESPEasy/rules1.txt
Normal file
62
src/ESPEasy/rules1.txt
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
On manualwatering do
|
||||||
|
gpio,12,1 //start watering (open valve)
|
||||||
|
timerSet,8,%eventvalue% //timer 1 set for 5 sec
|
||||||
|
Publish %sysname%/Water/start,{"soil":"[Soil#RH]","temp":"[bmp#Temperature]", "eventvalue": "%eventvalue%"}
|
||||||
|
endon
|
||||||
|
On startwatering do
|
||||||
|
gpio,12,1 //start watering (open valve)
|
||||||
|
timerSet,8,10 //timer 1 set for 5 sec
|
||||||
|
Publish %sysname%/Water/start,{"soil":"[Soil#RH]"}
|
||||||
|
endon
|
||||||
|
On stopwatering do
|
||||||
|
timerSet,8,0 //timer 1 set to halt, used to stop watering before the timer ends!
|
||||||
|
gpio,12,0 //stop watering (close valve)
|
||||||
|
Publish %sysname%/Water/stop,{"soil":"[Soil#RH]"}
|
||||||
|
endon
|
||||||
|
On Rules#Timer=8 do
|
||||||
|
gpio,12,0 //stop watering (close valve)
|
||||||
|
endOn
|
||||||
|
|
||||||
|
|
||||||
|
On Soil#RH do
|
||||||
|
if [Soil#RH]<70 and [Soil#RH]>20
|
||||||
|
//Publish %sysname%/Water/start,{"soil":"[Soil#RH]"}
|
||||||
|
event,startwatering
|
||||||
|
else
|
||||||
|
gpio,12,0 //stop watering (close valve)
|
||||||
|
//event,stopwatering
|
||||||
|
//deepsleep,30
|
||||||
|
endif
|
||||||
|
endOn
|
||||||
|
|
||||||
|
//Time events GMT (17:00 is 14:00GMT)
|
||||||
|
On Clock#Time=All,%sunrise% do
|
||||||
|
Publish %sysname%/state/time,{"sunrise":"%sunrise%"}
|
||||||
|
event,manualwatering=10
|
||||||
|
endon
|
||||||
|
On Clock#Time=All,%sunset% do
|
||||||
|
Publish %sysname%/state/time,{"sunset":"%sunset%"}
|
||||||
|
event,manualwatering=10
|
||||||
|
endon
|
||||||
|
|
||||||
|
//On Clock#Time=All,**:*5 do
|
||||||
|
// Publish %sysname%/state/time,{"time":"%systime%"}
|
||||||
|
// event,manualwatering=5
|
||||||
|
//endon
|
||||||
|
//On Clock#Time=All,**:*0 do
|
||||||
|
// Publish %sysname%/state/time,{"time":"%systime%"}
|
||||||
|
// event,manualwatering=5
|
||||||
|
//endon
|
||||||
|
|
||||||
|
On Clock#Time=All,**:00 do
|
||||||
|
//event,nightwatering=3
|
||||||
|
endon
|
||||||
|
|
||||||
|
On nightwatering do
|
||||||
|
If %systime% < %sunrise% //12:00:00
|
||||||
|
event,manualwatering=%eventvalue%
|
||||||
|
Endif
|
||||||
|
If %systime% > %sunset%//19:00:00
|
||||||
|
event,manualwatering=%eventvalue%
|
||||||
|
Endif
|
||||||
|
endon
|
||||||
@@ -218,6 +218,7 @@ exports.SendCmd = function (message = "") {
|
|||||||
topic = EspDeviceName + "/cmd";
|
topic = EspDeviceName + "/cmd";
|
||||||
console.log("MQTT> command topic is:" + topic);
|
console.log("MQTT> command topic is:" + topic);
|
||||||
console.log("MQTT> message:" + message);
|
console.log("MQTT> message:" + message);
|
||||||
|
//mqtt_client.clear();
|
||||||
mqtt_client.publish(topic, message, (r) => {
|
mqtt_client.publish(topic, message, (r) => {
|
||||||
console.log("MQTT> Published to '" + topic + "'>'" + message + "'");
|
console.log("MQTT> Published to '" + topic + "'>'" + message + "'");
|
||||||
console.log(r);
|
console.log(r);
|
||||||
|
|||||||
@@ -96,7 +96,7 @@
|
|||||||
crosshair: {
|
crosshair: {
|
||||||
enabled: true
|
enabled: true
|
||||||
},
|
},
|
||||||
minimum: 990,
|
//minimum: 990,
|
||||||
//maximum: 1080,
|
//maximum: 1080,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user