tthRelay
tthRelay copied to clipboard
This is Time, Temperature and Humidity Relay
trafficstars
tthRelay
This is Time, Temperature and Humidity Relay.

- manual mode on/off
- time mode from hh:mm to hh:mm
- temperature mode (cooling/heating) with adjustable hysteresis and time priority from hh to hh
- humidity mode (humidifier/dehumidifier) with adjustable hysteresis and time priority from hh to hh
- support Normally Open/Normally Closed relay
- support single shot to simulate momentary button press with adjustable time from 150 milliseconds to 500 milliseconds in 50 millisecond steps
- support for AHT1x/AHT2x and HTU2xD/SHT2x/Si70xx sensors
- temperature and humidity recorder to SPI flash with charts, up to 400KB (enough to store an annual record in 30 minute increments)
- control relay via Telegram messenger with default update rate of 10 seconds (can be configured via html page), up to 20 relay bots in one group chat
- in case of sensor failure, the relay goes into the off state - only manual and switching by time will work
- if two sensors with different addresses are connected and one of them fails during boot, the second sensor will be used automatically
- station hostname used as relay ID, you can have as many relays on the network as you want as long as they all have different hostnames
The software is provided "AS IS" without warranty of any kind. Don't leave it unattended.
- Download Flash Download Tools from https://www.espressif.com/en/support/download/other-tools
- Download tthRelay *.bin files
- In Flash Download Tools:
- set SPI speed 80MHz
- set SPI Mode QIO
- set Flash Size 32Mbit
- check DoNotChgBin
- fw_latest.bin at address 0x00000
- fs_latest.bin at address 0x200000
- Connect any ESP8266 with QIO 4MB flash to USB, select COM port and baud rate than press Start

-
Connect HTU2xD/SHT2x/Si70xx or AHT1x/AHT2x digital humidity and temperature Sensor as follows:
- ESP-01 (1):
- GPIO3/RX to SCL
- GPIO2/D4/LED to SDA
- Vcc
- Gnd
- ESP-12, NodeMCU, Sonoff Basic R1, WeMos:
- GPIO5/D1 to SCL
- GPIO4/D2 to SDA
- Vcc
- Gnd
- Sonoff TH10/TH16:
- GPIO14/D5 to SCL
- GPIO4/D2 to SDA
- Vcc
- Gnd
- ESP-01 (1):
-
Connect relay as follows:
- ESP-01 (1):
- GPIO0/D3
- Sonoff Basic R1, Sonoff TH10/TH16:
- GPIO12/D6
- ESP-12, NodeMCU, WeMos:
- GPIO0/D3
- GPIO12/D6
- GPIO13/D7
- ESP-01 (1):
(1) To work on the ESP-01, the flash memory must be replaced with 4MB/32Mbit.
Recommended to add a 680ohm/220uF RC filter to prevent accidental switching on startup, see ESP8266 GPIO Behaviour at Boot.

- Connect to tthRelay WiFi access point using password 12345678
- Type in browser http://192.168.4.1/
- Put User Name: admin and Password: 12345678
- For security purposes, please change login/password for the access point Settings -> Access Point Config and Settings -> Server Config page then click Save (server password is also used as the Arduino IDE OTA password)
- Set WiFi Network name and password in Settings -> Station Config page than click Save and Reboot
- The tthRelay will connect to the WiFi network and tthRelay access point will disappear
- Type in browser http://tthRelay.local/ (use IP address instead of mDNS on Android and Win7 devices, address can be found in the UART logs at speed 115200bps)
- Go to Time or Settings -> NTP Config and set your timezone than click Save and Reboot
- Test relay in manual mode Relay -> Manual or Settings -> Relay Config -> Manual, if it doesn't switch then click on Advance and rearrange Relay Pin, Relay Type then Save and Reboot
Used frameworks, libraries: