diff --git a/src/ESPEasy/config_Garden_U0_Build20116_202210.dat b/src/ESPEasy/config_Garden_U0_Build20116_202210.dat new file mode 100644 index 0000000..8ba2e2f Binary files /dev/null and b/src/ESPEasy/config_Garden_U0_Build20116_202210.dat differ diff --git a/src/ESPEasy/rules1.txt b/src/ESPEasy/rules1.txt new file mode 100644 index 0000000..7b62d92 --- /dev/null +++ b/src/ESPEasy/rules1.txt @@ -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 \ No newline at end of file diff --git a/src/mqtt.js b/src/mqtt.js index c752677..ba1649e 100644 --- a/src/mqtt.js +++ b/src/mqtt.js @@ -218,6 +218,7 @@ exports.SendCmd = function (message = "") { topic = EspDeviceName + "/cmd"; console.log("MQTT> command topic is:" + topic); console.log("MQTT> message:" + message); + //mqtt_client.clear(); mqtt_client.publish(topic, message, (r) => { console.log("MQTT> Published to '" + topic + "'>'" + message + "'"); console.log(r); diff --git a/views/chartGarden.ejs b/views/chartGarden.ejs index df2ed38..c241968 100644 --- a/views/chartGarden.ejs +++ b/views/chartGarden.ejs @@ -96,7 +96,7 @@ crosshair: { enabled: true }, - minimum: 990, + //minimum: 990, //maximum: 1080, }, ], @@ -121,7 +121,7 @@ xValueFormatString: "HH:mm on DD MMM, YYYY", color: "#F08080", dataPoints: temp.out - }, + }, /*{ name: "Dew Point", type: "line",//line