diff --git a/config/ESP_cmds.txt b/config/ESP_cmds.txt new file mode 100644 index 0000000..7fc4269 --- /dev/null +++ b/config/ESP_cmds.txt @@ -0,0 +1,183 @@ +http://192.168.0.172/control?cmd=event,setrange=20,40 + +https://espeasy.readthedocs.io/en/latest/Plugin/P036.html + + + +https://espeasy.readthedocs.io/en/latest/Rules/Rules.html +https://www.letscontrolit.com/wiki/index.php/Tutorial_Rules#TaskValueSet + + +http://192.168.1.109/control?cmd=Monitor,GPIO,13 +http://192.168.1.109/control?cmd=GPIO,2,1 + +http://192.168.1.109/control?cmd=event,startwatering +--------------------- +WIFI: +CPU:80 MHz +Crystal:26MHz +Flash:40MHz 1MB(8MBit) +FLASH MODE: DOUT +Reset Method: DTR + +------------------------------------------ +WiFiRepeater: +popov2 %25TGBnhy6%3D +------------------------------------------ +Tasmota IR: + +Ssid1 popov +Password1 %TGBnhy6= + +GPIO2 - DHT + +------------------------------------------ +Espeasy: +######POST FLASH###### +[2020-06-16 00:23:54] Sending SERIAL: "..." +[2020-06-16 00:24:17] Sending SERIAL: " WifiSSID popov " +[2020-06-16 00:24:24] Sending SERIAL: " WifiKey %TGBnhy6= " +[2020-06-16 00:24:31] Sending SERIAL: "Save" +[2020-06-16 00:24:33] Sending SERIAL: "WifiConnect" + + +BPM: + Vcc = GPIO-1 (D10) TX + GND = GPIO-2 (D4) + D1 SCL + D2 SDA +Analog: +relay(water):GPIO-12 (D) + +MQTT: +ESP_Easy/cmd +GPIOtoggle,2 +--- + +On startwatering do + gpio,2,1 +endon + +On stopwatering do + gpio,2,0 +endon + +On Rules#Timer=1 do + gpio,12,0 //stop watering (close valve) +endOn + +On Soil#RH do + if[Soil#RH] < 10 + Publish ESP_Easy/Water/start,{"soil":"[Soil#RH]"} + endif +endOn + + +--------------------- + +On System#Boot do +gpio,0,1 +timerSet,1,50 +TaskValueSet 1,1,1 // set a flag on the Dummy device indicating that your timer is active +endon + +On Rules#Timer=1 do +gpio,0,0 +TaskValueSet 1,1,0 // reset the timer flag +endon + +On Input1#Switch=1 do +if [Dummy#TimerSet] = 1 // checking the flag to see if the timer is still running +timerSet,1,50 // if the timer is running, reset the timer again to 50... or did you want to cancel the timer...? +endif +endon + +On Input2#Switch=1 do +if [Dummy#TimerSet] = 1 // checking the flag to see if the timer is still running +timerSet,1,50 +endif +endon +--------------------------- + + + on TempHumidityPressure_OUTSIDE#%RH do + TaskValueSet,7,1,[TempHumidityPressure_OUTSIDE#°C]-(100-[TempHumidityPressure_OUTSIDE#%RH])/5 // "7" is the number of the task that the dummy device is on, "1" is its first value where we dump our result + if [TempHumidityPressure_OUTSIDE#%RH]>49 + Publish %sysname%/DewPoint_OUTSIDE/°C,[Dew_point#°C1] + else + Publish %sysname%/DewPoint_OUTSIDE/°C,[Dew_point#°C1]* //This asterix shows that the calculation is not correct due to the humidity being below 50%! + endif + endon + + + + + ----------------------- + current : + //1 +On manualwatering do + gpio,12,1 //start watering (open valve) + timerSet,8,%eventvalue% //timer 1 set for 5 sec + Publish ESP_Easy/Water/start,{"soil":"[Soil#RH]", "eventvalue": "%eventvalue%"} +endon +On startwatering do + gpio,12,1 //start watering (open valve) + timerSet,8,10 //timer 1 set for 5 sec + Publish ESP_Easy/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 ESP_Easy/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 ESP_Easy/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 ESP_Easy/state/time,{"sunrise":"%sunrise%"} + event,manualwatering=15 +endon +On Clock#Time=All,%sunset% do + Publish ESP_Easy/state/time,{"sunset":"%sunset%"} +endon + +//On Clock#Time=All,**:*5 do +// Publish ESP_Easy/state/time,{"time":"%systime%"} +// event,manualwatering=5 +//endon +//On Clock#Time=All,**:*0 do +// Publish ESP_Easy/state/time,{"time":"%systime%"} +// event,manualwatering=5 +//endon + +On Clock#Time=All,**:*0 do + event,nightwatering=3 +endon + +On nightwatering do + If %systime% < 12:00:00 //%sunrise% + event,manualwatering=%eventvalue% + Endif + If %systime% > %sunset%//19:00:00 + event,manualwatering=%eventvalue% + Endif +endon + +19240227 + + +//2 \ No newline at end of file