Download Arduino IDE: Download Arduino IDE from https://www.arduino.cc/en/Main/Software
Install ESP8266 board software: Open Arduino IDE and select File ? Preferences (Arduino ? Preferences on Mac) and add the following text for field Additional Boards Manager URLs: http://arduino.esp8266.com/stable/package_esp8266com_index.json and select OK. Open Tools ? Boards... ? Boards Manager... and scroll down and click on esp8266 by ESP8266 Community. Click the Install button to download and install the latest ESP8266 board software. Select Close.
Dependacy on ( the following lib need to be isntalled) : https://github.com/i4things/Gateway/blob/master/src/arduino-esp32/DHTesp.zip
Use Board: "WeMos D1 R1"
Scenario : Wemos, DHT22 sensor measuring temperature and humidity and 2 relays
Relay 1 is for Automatic Garage door - when Open/Close button on web page is clicked Relay 1 is ON for 2 sec
DTH22 measures temp and humidity and send it every 10 min to the server ( if different)
Relay 2 is connected to a fan
When humidity over 70% relay 2 is automatically switched ON for 2 hours cycle
When clicked on web page - "Relay 2 ON" button Relay 2 is switched ON.
When clicked on web page - "Relay 2 OFF" button Relay 2 is switched OFF. ( if humidity is > 70% it will be switched ON automatically after 10 minutes again)
Relay 2 cannot stay ON for more then 2 hours every 2.5 hours
If Relay 2 is switched OFF because max ON ( 2 hours) is reached it cannot be switched ON for the next 1/2h
- The default pins on D1 Relay Shield and DHT Shiled cannot be used as they clash with serial interface for logging and built-in led. Please make sure they are not connected and you have actually bridged them as described below
DOOR Relay controling pin to D7
FAN Relay controling pin to D6
DHT data pin to D5