Coder Social home page Coder Social logo

espthermostat's Introduction

ESPthermostat

Software for the 4 channel relay controller and 8 channel DS18B20 sensor reader provided by 3DStar.ro

Features

  • simple or secure MQTT connection, Let's Ecrypt CA cetificate already loaded
  • topic structure for multiple buildings (locations) control: location/device_espid/+
  • main and backup WiFi connections
  • secured, no access point is presented in case both WiFi connections are unavailable
  • after the initial configuration, web access can be disabled, module uses just pure MQTT
  • extra information on device status topic: type, ID, supply voltage, AP SSID, AP RSSI, AP mac

Hardware

Roll your own or get one from 3DStar shop in PCB, kit (PCB + components), SMD kit (PCB with soldered SMD components + bags of through hole components) or fully assembled form.

The ESP-01 / ESP-01S from AI Thinker is used to control one PCA9536D 4bit IO expander. On each channel there is a relay that can be used to control heating equipment (boilers, pumps, valves, etc.).

8 connectors are provided for directly attaching 1-Wire DS18B20 temperature sensors. Their number is not limited and by using splitter cables more than 8 can be attached.

Build & upload

  • there are 2 methods:
    • download, edit config.h, build & upload
    • download binary and upload For building the sources PlatformIO is recommended for automatic library management.

Usage

  • mqtt topic: LOC/TIP/NAME_ESPid where LOC, TIP and NAME are user defined and ESPid is the HEX representation of your ESP mac address' last 3 bytes. What follows are possible suffixes and must be appended to the above mqtt topic.

  • command topic: /cmnd/...

    • save: save current configuration to LittleFS

    • update: perform OTA update

    • reset: restart ESP device

    • format: format LittleFS space

    • list: list current LittleFS stored config.json to Serial @ 115200bps. Other than this serial is not used at all.

    • config: change device configuration. Due to MQTT message length restrictions do not send json messages longer than 256 bytes. Get examples from config.json in data folder. You can send any part at any time. Remember to send save command after you are satisfied with the configuration.

    • /rX: relay control. X is the relay number. Payload can be 0 = OFF, 1 = ON.

  • relay status topic: /relay/X where X is the relay number. Payload will be 0 for OFF and 1 for ON. It is updated by the ESP after processing commands, statuses are sent with retain flag.

  • sensorss topic: /temp, a json message is sent continaing the unique codes and temperature of all found DS18B20 sensors.

  • status topic: /stat where the ESP sends periodic updates (heartbeat) with type, ID, supply voltage, SSID, RSSI, BSSID (AP mac) Example: {"Type":"thermostat","ID":"abcdef","Vin":3.31,"SSID":"WIFI","RSSI":-29,"BSSID":"D8:50:E6:XX:XX:XX"}

  • will topic: /will Payload is 1 when device is ON and 0 when powered OFF

Libraries

PCB example

espthermostat's People

Contributors

cctweaker avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

lboue

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.