Giter Club home page Giter Club logo

smart-thermostat's Introduction

Smart Thermostat

The idea of this project is to create a truly smart thermostat. Main features are:

  • Can be integrated into a home automation system (such as Home Assistant)
  • Cloud connection not required
  • Wifi connected
  • Initial setup (e.g., wifi credentials) configured via touch screen interface
  • Will act similarly to a person's preferences when it comes to HVAC. For example:
    • the temperature set should be dependent upon local forecast
    • If the outside temp is close to the set thermostat temp, suggest opening a window
    • Detect if a window or door is open and disable the heat/AC
  • Use Matter protocol over wifi (thermostat V2)
  • Provide local web site to control/configure thermostat
  • Allow ssh login
  • Provide diagnostic logging (rsyslog as well?)
  • Detect degradation of temp rise/fall to identify clogged filter or service required
  • Employ remote temp sensors to balance temp within home
  • Detect lower air quality to suggest opening a window (and disable HVAC)
  • No mechanical buttons - soft buttons on the TouchScreen only ... except maybe a master reset if things go wrong!

Basic layout of thermostat:

December 18, 2023 Changes to MQTT and addition of telnet support

Version 0.7.2 adds support for telnet and soft back light bring up (more on that later). It also fixes a handful of bugs and reliability (especially around MQT) has been dramatically increased.

Prior to this release, the backlight would come on immediately with "full brightness" (depending on the ambient light level). Now, the logic has been updated to bring the back light up slowly to match the current room light level. Also the backlight will continue to match the detected light, so if you turn the room light on, it will match.

Auto reconnect in the ESP MQTT module has been enabled. Ths eliminates the responsibility for smart-thermostat to re-establish an MQTT connection if it is lost. Trying to do this manually led to race conditions and some incorrect logic assumptions. Now the built in module (from Esspressif) handles it ... and it is incredibly reliable!

Telnet support has been added! There is no credential checking mechanism, but this is not a high security device. It could be added later by a contributor if wanted. Via telnet, a user can reconfigure the stat, monitoring th elogging output, reboot and check on stats & error counts.

October 4, 2023 addition of Matter support

Getting started: https://docs.espressif.com/projects/esp-matter/en/latest/esp32/developing.html

Matter support is delayed until the SDK can be added as a library to PlatformIO. Currently, the actions required to create a dev environment is too extreme.

September 8, 2023 update - V0.6

The thermostat app code is now 100% ESP-IDF based. All dependencies on the Arduino framework have been removed. This provides for much better control of the code and better integration with the upcoming Matter implementation.

FYI: There are some libraries being used that have soem compile-time errors. These are currently being worked with the maintainers. See PR comments.

FYI #2: Many details have changed with today's commit (such as the partition scheme). It is best to clear out old builds and be sure everything (ESP-IDF and libraries) are up-to-date. Details in the platformio.ini file.

May 2023 update - V0.2

Great progress! The processor has been selected, the ESP-32 and the user interface is (albeit crude) created! To generate the user interface elements and menuing system, SquareLine Studio was used. This integrates with the graphics library used; LVGL.

Operating environment

FreeRTOS will be the OS. Tasks are created to drive the user interface, the statemachine, the web server and reading of the sensors. The state machine will make up the primary task that runs on a continuous, low-priority loop. The user interface task, which drives the TFT is the highest priority. All other tasks will have higher priorities.

The code is currently exceeding the usual partitioning table, so the large_app partition scheme was used. OTA update has not been tried sicne switching to this partition scheme, but it may now be broken. Later with an ESP32 chip with a larger FLASH should be able to handle the code and perform OTA updates.

MCU

The processor of choice is the ESP32 with 4MB FLASH.

The coice to use an Espressif MCU was made since it is cheaper, smaller and more simple to integrate into the circuit. It also provides enough GPIO pins to control everything.

Eventually, the ESP32-C6 will be used as it has support for 802.15.4 (Zigbee / Thread). But it does not have enough GPIO pins, so a multiplexer must be added to the PCB. Alternatively, wifi plus Matter could be used and skip Zigbee and Thread. This is still under investigation.

Built onto the PCB is a SWD interface allowing GDB debugging, as well as loading firmware.

Currently, build output shows:

Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (6.3.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES: 
 - framework-arduinoespressif32 @ 3.20009.0 (2.0.9) 
 - tool-esptoolpy @ 1.40501.0 (4.5.1) 
 - tool-mkfatfs @ 2.0.1 
 - tool-mklittlefs @ 1.203.210628 (2.3) 
 - tool-mkspiffs @ 2.230.0 (2.30) 
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ deep, Compatibility ~ soft
Found 42 compatible libraries
Scanning dependencies...
Dependency Graph
|-- LovyanGFX @ 1.1.6
|-- Adafruit AHTX0 @ 2.0.3
|-- Smoothed @ 1.2.0
|-- micro-timezonedb @ 1.0.2
|-- lvgl @ 8.3.7
|-- Preferences @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- Update @ 2.0.0
|-- WebServer @ 2.0.0
|-- WiFi @ 2.0.0
Building in release mode
Retrieving maximum program size .pio/build/esp32dev/firmware.elf
Checking size .pio/build/esp32dev/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [===       ]  33.1% (used 108372 bytes from 327680 bytes)
Flash: [=====     ]  45.9% (used 1445209 bytes from 3145728 bytes)
Configuring upload protocol...
AVAILABLE: cmsis-dap, esp-bridge, esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa
CURRENT: upload_protocol = esptool
Looking for upload port...
Using manually specified: /dev/ttyUSB1
Uploading .pio/build/esp32dev/firmware.bin
esptool.py v4.5.1
Serial port /dev/ttyUSB1
Connecting.....
Chip is ESP32-D0WD-V3 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 78:21:84:e2:28:1c
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
etc...

Touch screen

The TFT display chosen is the MSP3218 with the ILI9341 TFT driver and the XPT2046 touch controller. LVGL supports this display nicely (see lvgl_conf.h). The 3.2" screen is a bit tight for all menus and controls, but with a stylus, it is fine ... might be tough with a finger.

SquareLine Sudio designed screens:

Power Supply

Built into the PCB is a power supply capable of providing stable 5V DC for the processor and sensors. An LM2576HVT-5 will be used to allow for 24V in and still remain stable regulating the power.

LM2576HVT Datasheet

A low droput voltage regulator is incorporated into the PCB to regulate the 5V to 3v3. AMS1117 Datasheet

Sensors

Other than an onboard Temp/Humidity/Air quality sensor setup, there can also be remote sensors (maybe connected via MQTT or proprietary ethernet protocol?) that will provide data to make various decisions. These could be inside the home, outside or even from online sources (such as local weather sites).

To measure indoor temp & humidity, the Aosong AHT20 is being used. More manufacturer information can be found HERE.

A light sensor (LDR) is currently incoporated into the PCB (as a voltage divider) and is being measured for ambient light. It will be used to determine brightness of the TFT display when it is woken.

Motion sensing is being done with the Hi-Link LD2410 uWave sensor. These are available on Amazon and AliExpress.

Possibilities

Integrate SMS/chat ability

This can be used to notify user of events/alerts. Could also be Slack or other notifications. An onboard annunciator (like a speaker) feels wrong.

Use super capacitor to maintain power during power outage

This would maintain power during brief power outages


V1 task list:

  • Build 24VAC to 5VDC power supply with minimal ripple (< 2%)
  • Decide on MCU/SBC
  • Determine sensors to be used (temp, humidity, air quality)
  • Develop V1 of host app (to get basic thermostat functionality)
  • Generate schematic & PCB
  • Generate PCB BOM (compatible with JLCPCB parts list)
  • Have PCB manufactured (JLCPCB)
  • Add OTA update ability (via web page)

V2 task list:

  • Design device web page; crude but done
  • Design 3D printed case (Polycase may be good supplier or JLCPCB)
  • Implement Matter
  • Develop Home Assistant integration (maybe via Matter?)
  • Add MQTT/HA communications (publish and subscriber support)

Maybe:

  • Add air quality monitoring (to PCB and app)

General to-do:

  • Measure current draw of entire thermostat, TFT LED backlight on & off
  • Measure current draw with no TFT display attached
  • Measure voltage ripple while under load
  • Redesign PCB to incoporate ESP chip and tighten up layout
  • Add serial output pins to connect serial terminal to catch print statements

Specs...

FreeRTOS Elements:

  • Interrupt: Touch
  • When: User touches display; Asserts line LO

  • Interrupt: Motion
  • When: LD2410 senses motion; asserts line HI

  • Task: aht
  • Freq: 10 secs
  • Purpose: update temp & humidity

  • Task: touch
  • Freq: int (triggered indirectly via TFT touch int)
  • Purpose:
    • Update last touch point
    • Play audible beep

  • Task: motion
  • Freq: int (triggered directly via motion int)
  • Purpose: update last motion detected timestamp

  • Task: state-machine
  • Freq: 1 sec
  • Purpose:
    • Pump state machine
    • Using temp & humidity, motion, last touch pt,
    • Call routines to navigate menus (options / settings)
    • Adjust display brightness (when on) based on LDR
    • Turn off display with no motion

States:

  • Init (start)
  • Idle
  • Fan only
  • Heat
  • Cool
  • Error

To be added:

  • Wifi
  • Web server
  • Matter over wifi
  • Telnet
  • OTA updates
  • Add air quality monitoring device -- Maybe a future feature

Parameters set by user:

  • Wifi credentials
  • Location (zip code) for outdoor temp - or URI for local/private temp sensor
  • Home Assistant FQDN / IP
  • Temp swing
  • Max / min temp (when to alert user)
  • email list / SMS for notifications
  • c / f
  • reversing valve (for a heat pump)
  • auto changeover (A/C to/from Heat)

Calculated params:

  • Average temp change rate vs temp differential (inside / outside temps)
    • When value exceeded (based on HVAC mode), ask if window/door is open
  • Average temp change rate
    • Detects when filter / furnace needs servicing
    • Used to calculate time to temp

smart-thermostat's People

Contributors

aquini avatar michael-burke4 avatar smeisner avatar y9rabbito avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

smart-thermostat's Issues

Local Weather

Research usefulness and ability to fetch weather & temp for the local area (via something like wunderground.com). The local weather can then be used to set the background graphics on the touch screen.

Motion sensor too sensitive

With the RCWL-0516 mounted upside down (looking at rear of board), it is constantly triggering for motion. This makes the sensor virtually useless.

Full code review/cleanup of mqtt module

The MQTT source code was developed (and it is working) without concern for code documentation or cleaning up old code. A full review of th emodul eis required to document (comments) and cleanup the code, including structure.

Telnet support

Add simple telnet based CLI to set parameters, review logs and restart thermostat

BLE support

If the thermostat NVRAM is found to be uninitialized (no wifi credentials), enable BLE to allow config via a smartphone.

Zigbee

Once the onboard MCU is switched to the ESP32-C6 (which has Zigbee support), research must be done to figure out how to enable Zigbee on it. This will allow comms with home automation systems.

Must be able to be enabled/disabled via user config on touchscreen.

Save config settings to NVS

Whenever settings change, save them to the NV storage area. This can include:

  • All fields of OperatingParameters struct
  • Wifi creds
  • Calibration data for touch screen (also need to restore this on startup)
  • Historical data (such as reboot count)

Autoupdating from Github

Enable automatically updating the firmware if a new version is located on Github. The code to apply a new firmware image is included in the web.cpp file.

Auto updating must be able to be enabled/disabled via user config on touchscreen.

Touchscreen UI

A nice looking user interface must be designed and implemented to support the touchscreen and provide local weather backgrounds.

Documentation

Provide tech docs on PCB / MCU (such as use of IO pins) and software.

Logging support

Add a facility to log events and provide a recall buffer for review

Crash during wifi reconnect

Crashed while wifi was dropping and connection reestablished:

[19761.20h.02m.32s.829] I (196938675) SENSORS: Temp: 75.1 (raw: 80.60 F)  Humidity: 34.0 (raw: 21.71)
[19761.20h.02m.32s.836] I (196938675) MQTT: {"Temperature":"75.06","Humidity":"34.02","Setpoint":74,"Mode":"heat","CurrMode":"idle"}
[19761.20h.02m.42s.918] I (196948765) SENSORS: Temp: 75.0 (raw: 80.57 F)  Humidity: 33.7 (raw: 20.84)
[19761.20h.02m.42s.926] I (196948765) MQTT: {"Temperature":"75.01","Humidity":"33.70","Setpoint":74,"Mode":"heat","CurrMode":"idle"}
[19761.20h.02m.53s.008] I (196958855) SENSORS: Temp: 75.0 (raw: 80.54 F)  Humidity: 33.4 (raw: 20.24)
[19761.20h.02m.53s.015] I (196958855) MQTT: {"Temperature":"74.96","Humidity":"33.36","Setpoint":74,"Mode":"heat","CurrMode":"idle"}
[19761.20h.03m.03s.099] I (196968945) SENSORS: Temp: 74.9 (raw: 80.47 F)  Humidity: 33.0 (raw: 19.91)
[19761.20h.03m.03s.106] I (196968945) MQTT: {"Temperature":"74.91","Humidity":"33.01","Setpoint":74,"Mode":"heat","CurrMode":"idle"}
[19761.20h.03m.13s.188] I (196979035) SENSORS: Temp: 74.9 (raw: 80.43 F)  Humidity: 32.7 (raw: 19.79)
[19761.20h.03m.13s.195] I (196979035) MQTT: {"Temperature":"74.87","Humidity":"32.69","Setpoint":74,"Mode":"heat","CurrMode":"idle"}
[19761.20h.03m.23s.278] I (196989125) SENSORS: Temp: 74.8 (raw: 80.39 F)  Humidity: 32.4 (raw: 19.33)
[19761.20h.03m.23s.285] I (196989125) MQTT: {"Temperature":"74.82","Humidity":"32.35","Setpoint":74,"Mode":"heat","CurrMode":"idle"}
[19761.20h.03m.24s.853] I (196990705) SENSORS: Current time: 15:03:24
[19761.20h.03m.33s.369] I (196999215) SENSORS: Temp: 74.8 (raw: 80.33 F)  Humidity: 32.0 (raw: 19.06)
[19761.20h.03m.33s.376] I (196999215) MQTT: {"Temperature":"74.77","Humidity":"32.02","Setpoint":74,"Mode":"heat","CurrMode":"idle"}
[19761.20h.03m.39s.383] I (197005235) wifi:bcn_timeout,ap_probe_send_start
[19761.20h.03m.41s.885] I (197007735) wifi:ap_probe_send over, resett wifi status to disassoc
[19761.20h.03m.41s.885] I (197007735) wifi:state: run -> init (c800)
[19761.20h.03m.41s.890] I (197007735) wifi:pm stop, total sleep time: 92468438 us / 130538481 us
[19761.20h.03m.41s.890] 
[19761.20h.03m.41s.894] I (197007735) wifi:<ba-del>idx:0, tid:0
[19761.20h.03m.41s.901] I (197007745) wifi:new:<1,0>, old:<1,0>, ap:<255,255>, sta:<1,0>, prof:1
[19761.20h.03m.41s.907] I (197007755) telnet: Telnet session termination requested
[19761.20h.03m.41s.913] I (197007755) telnet: Starting new telnet service instance
[19761.20h.03m.41s.923] E (197007765) transport_base: poll_read select error 113, errno = Software caused connection abort, fd = 62
[19761.20h.03m.41s.930] E (197007775) mqtt_client: Poll read error: 119, aborting connection
[19761.20h.03m.41s.935] I (197007775) MQTT: MQTT_EVENT_DISCONNECTED
[19761.20h.03m.41s.941] I (197007785) telnet: Telnet session termination requested
[19761.20h.03m.41s.950] W (197007785) telnet: No action taken - no telnet connection and telnet task not started
[19761.20h.03m.42s.033] I (197007885) WIFI:   event = STA_DISCONECTED - retry # 0 (MAX 5)
[19761.20h.03m.42s.034] W (197007885) WIFI:   connect to the AP failed - retrying
[19761.20h.03m.42s.039] I (197007885) telnet: Start telnetTask()
[19761.20h.03m.42s.053] W (197007905) WIFI: Starting network reconnect task
[19761.20h.03m.42s.053] I (197007905) WIFI: wifiReconnect()
[19761.20h.03m.42s.055] I (197007905) wifi:flush txq
[19761.20h.03m.42s.057] I (197007905) wifi:stop sw txq
[19761.20h.03m.42s.061] I (197007905) wifi:lmac stop hw txq
[19761.20h.03m.42s.064] W (197007905) WIFI: WifiDeinit()
[19761.20h.03m.42s.068] I (197007915) wifi:Deinit lldesc rx mblock:10
[19761.20h.03m.42s.078] I (197007925) WIFI: - Restarting wifi
[19761.20h.03m.42s.078] I (197007925) WIFI: wifiStart()
[19761.20h.03m.42s.084] W (197007925) WIFI:   Wifi driver not started; Calling init and create funcs
[19761.20h.03m.42s.088] I (197007935) WIFI:   Initializing wifi
[19761.20h.03m.42s.093] I (197007935) WIFI:   Setting wifi hostname
[19761.20h.03m.42s.098] I (197007945) pp: pp rom version: e7ae62f
[19761.20h.03m.42s.104] I (197007945) net80211: net80211 rom version: e7ae62f
[19761.20h.03m.42s.112] I (197007965) wifi:wifi driver task: 3fcbab5c, prio:23, stack:6656, core=0
[19761.20h.03m.42s.122] I (197007975) wifi:wifi firmware version: ce9244d
[19761.20h.03m.42s.123] I (197007975) wifi:wifi certification version: v7.0
[19761.20h.03m.42s.124] I (197007975) wifi:config NVS flash: enabled
[19761.20h.03m.42s.129] I (197007975) wifi:config nano formating: disabled
[19761.20h.03m.42s.134] I (197007975) wifi:Init data frame dynamic rx buffer num: 32
[19761.20h.03m.42s.140] I (197007985) wifi:Init management frame dynamic rx buffer num: 32
[19761.20h.03m.42s.145] I (197007985) wifi:Init management short buffer num: 32
[19761.20h.03m.42s.150] I (197007995) wifi:Init dynamic tx buffer num: 32
[19761.20h.03m.42s.154] I (197007995) wifi:Init static tx FG buffer num: 2
[19761.20h.03m.42s.159] I (197008005) wifi:Init static rx buffer size: 1600
[19761.20h.03m.42s.163] I (197008005) wifi:Init static rx buffer num: 10
[19761.20h.03m.42s.167] I (197008015) wifi:Init dynamic rx buffer num: 32
[19761.20h.03m.42s.172] I (197008015) wifi_init: rx ba win: 6
[19761.20h.03m.42s.176] I (197008025) wifi_init: tcpip mbox: 32
[19761.20h.03m.42s.181] I (197008025) wifi_init: udp mbox: 6
[19761.20h.03m.42s.185] I (197008025) wifi_init: tcp mbox: 6
[19761.20h.03m.42s.189] I (197008035) wifi_init: tcp tx win: 5744
[19761.20h.03m.42s.194] I (197008035) wifi_init: tcp rx win: 5744
[19761.20h.03m.42s.199] I (197008045) wifi_init: tcp mss: 1440
[19761.20h.03m.42s.204] I (197008045) wifi_init: WiFi IRAM OP enabled
[19761.20h.03m.42s.209] I (197008055) wifi_init: WiFi RX IRAM OP enabled
[19761.20h.03m.42s.214] I (197008055) WIFI: MAC Address: 34:85:18:50:7b:88
[19761.20h.03m.42s.220] I (197008065) WIFI:   Calling esp_wifi_start()
[19761.20h.03m.42s.225] I (197008065) wifi:mode : sta (34:85:18:50:7b:88)
[19761.20h.03m.42s.231] I (197008075) wifi:enable tsf
[19761.20h.03m.42s.882] I (197008075) WIFI:   Waiting for event callback...
[19761.20h.03m.42s.882] I (197008725) wifi:new:<6,0>, old:<1,0>, ap:<255,255>, sta:<6,0>, prof:1
[19761.20h.03m.42s.883] I (197008735) wifi:state: init -> auth (b0)
[19761.20h.03m.42s.891] I (197008735) wifi:state: auth -> assoc (0)
[19761.20h.03m.43s.459] I (197009305) SENSORS: Temp: 74.7 (raw: 80.28 F)  Humidity: 31.7 (raw: 19.20)
[19761.20h.03m.43s.892] I (197009735) wifi:state: assoc -> init (2700)
[19761.20h.03m.43s.893] I (197009745) wifi:new:<6,0>, old:<6,0>, ap:<255,255>, sta:<6,0>, prof:1
[19761.20h.03m.43s.897] I (197009745) telnet: Telnet session termination requested
[19761.20h.03m.43s.904] I (197009745) telnet: Starting new telnet service instance
[19761.20h.03m.44s.022] I (197009875) WIFI:   event = STA_DISCONECTED - retry # 0 (MAX 5)
[19761.20h.03m.44s.024] W (197009875) WIFI:   connect to the AP failed - retrying
[19761.20h.03m.44s.029] I (197009875) telnet: Start telnetTask()
[19761.20h.03m.45s.237] I (197011085) wifi:new:<11,0>, old:<6,0>, ap:<255,255>, sta:<11,0>, prof:1
[19761.20h.03m.45s.239] I (197011085) wifi:state: init -> auth (b0)
[19761.20h.03m.45s.243] I (197011095) wifi:state: auth -> assoc (0)
[19761.20h.03m.45s.249] I (197011095) wifi:state: assoc -> run (10)
[19761.20h.03m.45s.286] I (197011135) wifi:connected with <ssid>, aid = 2, channel 11, BW20, bssid = f0:9f:c2:a7:10:90
[19761.20h.03m.45s.288] I (197011135) wifi:security: WPA2-PSK, phy: bgn, rssi: -64
[19761.20h.03m.45s.297] I (197011145) wifi:pm start, type: 1
[19761.20h.03m.45s.297] 
[19761.20h.03m.45s.300] I (197011145) wifi:set rx beacon pti, rx_bcn_pti: 0, bcn_timeout: 25000, mt_pti: 0, mt_time: 10000
[19761.20h.03m.45s.308] I (197011155) wifi:<ba-add>idx:0 (ifx:0, f0:9f:c2:a7:10:90), tid:0, ssn:0, winSize:64
[19761.20h.03m.45s.352] I (197011195) wifi:AP's beacon interval = 102400 us, DTIM period = 3
[19761.20h.03m.46s.304] I (197012155) esp_netif_handlers: sta ip: 192.168.0.71, mask: 255.255.255.0, gw: 192.168.0.254
[19761.20h.03m.46s.309] I (197012155) WIFI:   event = IP_EVENT_STA_GOT_IP - ip: 192.168.0.71
[19761.20h.03m.46s.315] I (197012155) WIFI: connected to ap SSID:<ssid> password:****
[19761.20h.03m.51s.943] E (197017795) esp-tls: Failed to create socket (family 2 socktype 1 protocol 0)
[19761.20h.03m.51s.947] E (197017795) transport_base: Failed to open a new connection: 32770
[19761.20h.03m.51s.953] E (197017795) mqtt_client: Error transport connect
[19761.20h.03m.51s.957] I (197017805) MQTT: MQTT_EVENT_ERROR
[19761.20h.03m.51s.962] I (197017805) MQTT: MQTT_EVENT_DISCONNECTED
[19761.20h.03m.51s.968] I (197017805) telnet: Telnet session termination requested
[19761.20h.03m.51s.974] I (197017815) telnet: Starting new telnet service instance
[19761.20h.03m.52s.098] I (197017945) telnet: Start telnetTask()
[19761.20h.03m.52s.118] E (197017965) telnet: bind: 9 (Bad file number)
[19761.20h.03m.52s.118] I (197017965) telnet: Completing telnetTask()
[19761.20h.03m.53s.538] I (197019385) SENSORS: Temp: 74.7 (raw: 80.24 F)  Humidity: 31.5 (raw: 18.91)
[19761.20h.04m.02s.094] E (197027945) esp-tls: Failed to create socket (family 2 socktype 1 protocol 0)
[19761.20h.04m.02s.097] E (197027945) transport_base: Failed to open a new connection: 32770
[19761.20h.04m.02s.103] E (197027945) mqtt_client: Error transport connect
[19761.20h.04m.02s.127] I (197027955) MQTT: MQTT_EVENT_ERROR
[19761.20h.04m.02s.127] I (197027955) MQTT: MQTT_EVENT_DISCONNECTED
[19761.20h.04m.02s.127] I (197027965) telnet: Telnet session termination requested
[19761.20h.04m.02s.127] E (197027965) telnet: closesocket: 9 (Bad file number)
[19761.20h.04m.02s.135] Guru Meditation Error: Core  0 panic'ed (StoreProhibited). Exception was unhandled.
[19761.20h.04m.02s.135] 
[19761.20h.04m.02s.135] Core  0 register dump:
[19761.20h.04m.02s.135] PC      : 0x403820d5  PS      : 0x00060d33  A0      : 0x80380397  A1      : 0x3fccb060  
[19761.20h.04m.02s.146] A2      : 0x3fcc6744  A3      : 0x00060d20  A4      : 0x00000000  A5      : 0x00060d23  
[19761.20h.04m.02s.157] A6      : 0xb33fffff  A7      : 0xb33fffff  A8      : 0x967c967c  A9      : 0x967c967c  
[19761.20h.04m.02s.157] A10     : 0x967c967c  A11     : 0x00000000  A12     : 0x00000000  A13     : 0x3fccb050  
[19761.20h.04m.02s.168] A14     : 0x3fccb030  A15     : 0x0000000c  SAR     : 0x00000004  EXCCAUSE: 0x0000001d  
[19761.20h.04m.02s.179] EXCVADDR: 0x967c9684  LBEG    : 0x400556d5  LEND    : 0x400556e5  LCOUNT  : 0xfffffffc  
[19761.20h.04m.02s.190] 
[19761.20h.04m.02s.190] 
[19761.20h.04m.02s.190] Backtrace: 0x403820d2:0x3fccb060 0x40380394:0x3fccb080 0x4200a198:0x3fccb0a0 0x42004d54:0x3fccb0c0 0x420f0385:0x3fccb110 0x420efe0a:0x3fccb140 0x420435cd:0x3fccb180 0x42043817:0x3fccb1a0 0x420438de:0x3fccb1c0 0x42044519:0x3fccb1e0 0x40381589:0x3fccb210
[19761.20h.04m.02s.221] 

NTP support

Add support for an NTP client. This will provide local time of day, but will not work if network connection is down or not allowed.

One-shot operation

It has been requested to have a feature on the thermostat that allows for a "one shot" activation of the HVAC system. Not based on temperature, but more based on having a quick excessive heat/cool to increase comfort.

For example, it's a very hot day and you come in from doing yard work. You want the air conditioning to come on, but you don't want the temperature set to 50F/10C indefinitely.

therefore, having a feature to run the heat or cool for a set time (maybe 15 minutes) and then resume normal operation would be useful.

Temporary Hold feature

An override to the current set temp. If the thermostat is set at 68F/20C and very cold weather is expected, you should be able to set the temp a little higher and hold until the user disables it.

Write system log & traces to Partition 4, SPIFFS area

Looking at the ESP32 partition, there is a partition that can be used for logging;

 ## Label            Usage          Type ST Offset     Length
  4 spiffs           Unknown data     01 82 0x00c90000 0x00360000

Use this area to record ESP32 logging, including panic data.

MQTT

Add support for MQTT to push events to home automation systems. Maybe also use MQTT to subscribe to events to allow HA to control the thermostat.

This feature would need to enabled/disabled via the user config.

Temperature via matter

Hello there, I was looking at your code and was wondering if you managed to set the temperature into the matter protocol, I just noticed this part local_temperature, or do you have any clue on how to send the temperature via matter?

Add support for Matter over wifi

After the ESP32-C6 MCU is incorporated, research how to enable Thread protocol to support Matter. This allows for integration into home automation systems.

Must be able to be enabled/disabled via user config on touchscreen.

Switch to ESP-IDF framework

To get rid of Arduino dependencies, we need to switch to the ESP-IDF framework. Most libraries are already ESP-IDF compliant. The problem (I believe) is with the DFRobot AHT20 library. It relies on the Arduino framework, specifically the I2C library.

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.