http://mcsSprinklers.com/mcsTasmota.zip and http://mcsSprinklers.com/mcsTasmota6.zip contains binary images of Tasmota firmware used in Sonoff and similar ESP micro-controllers that has been augmented for irrigation control.
These images will control irrigation on an interval where the user specifies the interval, ON duration, and optionally hour of day to start. They will also accept scheduling commands and direct ON/OFF control commands to control each relay of the unit. This is normally done via MQTT protocol.
This discussion will consider only the MQTT route and HomeSeer. For MQTT interface either mcsMQTT or mcsSprinklers plugins will be discussed. The easiest setup for irrigation is with mcsSprinklers as this plugin is designed explicitly for irrigation, but it has capabilities that go well beyond the minimum required to use mcsTasmota. mcsMQTT is more generic and does not have an irrigation context, but basic control can be done using it and HomeSeer.
The assumption for this discussion is that a Sonoff 4CH Pro (or Sonoff 4CH Pro R2) has been flashed with mcsTasmota, Mosquitto or other MQTT broker is running on the user network and either mcsMQTT or mcsSprinklers has been enabled under HS3. Each will be a separate use case.
The next step is to tell mcsTasmota what the backup/failover irrigation schedule will be. This needs to be done only one time, but can be changed as the irrigation needs change. The easiest way to do this is with Publist using mcsMQTT. For this example the following assumptions are made:
1. Sonoff 4CH has been setup with GPIO2 used for enable/disable (first figure)
2. Sonoff 4CH has been setup with Topic 'IrrigationValve' (second figure)
The 4CH will report status using the IrrigationValve/STATE topic every 5 minutes. An example is below that shows all 4 relays (POWER) are OFF as well as information about Wifi and Uptime.
After the irrigation has been enabled then the payload of the topic will include an irrigation section such as below. Enabling irrigation will be discussed later. In this case it is reporting that irrigation is in AUTO mode which means it will monitor HS for relay control and if HS has not turn on the first relay within then next 259 minutes then mcsTasmota will turn it ON. Similar for relays 2,3, and 4 with different times. Setting these times will be discussed later.
When mcsTasmota turns a relay ON of OFF it will report the event using a topic similiar to below where in this case it is relay 4 being turn ON.
HS can command the relay to be turned ON using the same topic with /cmnd inserted. This is shown below:
HS can provide this command via mcsMQTT in various ways which include changing a HS device to ON or triggering an event that sends this message. This command is provide automatically by mcsSprinklers when it determines it is time to control the relay.
These images will control irrigation on an interval where the user specifies the interval, ON duration, and optionally hour of day to start. They will also accept scheduling commands and direct ON/OFF control commands to control each relay of the unit. This is normally done via MQTT protocol.
This discussion will consider only the MQTT route and HomeSeer. For MQTT interface either mcsMQTT or mcsSprinklers plugins will be discussed. The easiest setup for irrigation is with mcsSprinklers as this plugin is designed explicitly for irrigation, but it has capabilities that go well beyond the minimum required to use mcsTasmota. mcsMQTT is more generic and does not have an irrigation context, but basic control can be done using it and HomeSeer.
The assumption for this discussion is that a Sonoff 4CH Pro (or Sonoff 4CH Pro R2) has been flashed with mcsTasmota, Mosquitto or other MQTT broker is running on the user network and either mcsMQTT or mcsSprinklers has been enabled under HS3. Each will be a separate use case.
The next step is to tell mcsTasmota what the backup/failover irrigation schedule will be. This needs to be done only one time, but can be changed as the irrigation needs change. The easiest way to do this is with Publist using mcsMQTT. For this example the following assumptions are made:
1. Sonoff 4CH has been setup with GPIO2 used for enable/disable (first figure)
2. Sonoff 4CH has been setup with Topic 'IrrigationValve' (second figure)
The 4CH will report status using the IrrigationValve/STATE topic every 5 minutes. An example is below that shows all 4 relays (POWER) are OFF as well as information about Wifi and Uptime.
Code:
IrrigationValve/STATE={"Time":"2018-06-16T18:57:22","Uptime":"0T06:53:51","Vcc":3.190,"POWER1":"OFF","POWER2":"OFF","POWER3":"OFF","POWER4":"OFF", ,"Wifi":{"AP":1,"SSId":"U","RSSI":64,"APMac":"78:8A:20:84:48:1D"}}
Code:
IrrigationValve/STATE={"Time":"2018-06-16T18:57:22","Uptime":"0T06:53:51","Vcc":3.190,"POWER1":"OFF","POWER2":"OFF","POWER3":"OFF","POWER4":"OFF", "Irrigation":{ "IrrigationMode":"AUTO", "Time1":"259", "Time2":"258", "Time3":"257", "Time4":"258"} ,"Wifi":{"AP":1,"SSId":"U","RSSI":64,"APMac":"78:8A:20:84:48:1D"}}
Code:
IrrigationValve/POWER4=ON
Code:
IrrigationValve/cmnd/POWER4=ON
Comment