rules backup;

trying to fix mqtt freeze
This commit is contained in:
Dobromir Popov ONE
2022-06-27 00:42:34 +03:00
parent 907531eee9
commit 312d0b308a
4 changed files with 65 additions and 2 deletions

Binary file not shown.

62
src/ESPEasy/rules1.txt Normal file
View 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

View File

@@ -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);

View File

@@ -96,7 +96,7 @@
crosshair: { crosshair: {
enabled: true enabled: true
}, },
minimum: 990, //minimum: 990,
//maximum: 1080, //maximum: 1080,
}, },
], ],
@@ -121,7 +121,7 @@
xValueFormatString: "HH:mm on DD MMM, YYYY", xValueFormatString: "HH:mm on DD MMM, YYYY",
color: "#F08080", color: "#F08080",
dataPoints: temp.out dataPoints: temp.out
}, },
/*{ /*{
name: "Dew Point", name: "Dew Point",
type: "line",//line type: "line",//line