├── .unotes ├── templates │ └── title_date.hbs └── unotes_meta.json ├── app ├── .vscode │ ├── settings.json │ └── extensions.json ├── .unotes │ ├── templates │ │ └── title_date.hbs │ └── unotes_meta.json ├── .gitignore ├── CMakeLists.txt ├── src │ ├── ui │ │ ├── components │ │ │ └── ui_comp_hook.c │ │ ├── filelist.txt │ │ ├── CMakeLists.txt │ │ ├── ui_events.h │ │ ├── screens │ │ │ ├── ui_ThermostatRestart.c │ │ │ ├── ui_MatterConfig.c │ │ │ ├── ui_DeviceName.c │ │ │ ├── ui_MqttConfig.c │ │ │ ├── ui_WifiConfig.c │ │ │ ├── ui_Info.c │ │ │ ├── ui_LessCommonSetup.c │ │ │ └── ui_Setup.c │ │ ├── ui_helpers.h │ │ ├── ui.h │ │ └── ui_helpers.c │ ├── CMakeLists.txt │ ├── Thermostat_events.py │ ├── Stream.cpp │ ├── main.cpp │ ├── indicators.cpp │ ├── aht.c │ ├── state_machine.cpp │ ├── i2cdev.c │ └── Thermostat.sll ├── include │ ├── telnet.h │ ├── Arduino.h │ ├── version.h │ ├── Stream.h │ ├── README │ ├── gpio_defs.hpp │ ├── aht.h │ ├── thermostat.hpp │ ├── i2cdev.h │ ├── tft.hpp │ └── web_ui.h ├── default_16mb.csv ├── tests.txt ├── measure-heap.sh ├── lib │ └── README ├── boards │ └── esp32-s3-thermostat.json ├── platformio.ini ├── smart-thermostat.code-workspace └── variants │ └── esp32-s3-thermostat │ └── pins_arduino.h ├── assets ├── thermostat-info.png ├── thermostat-main.png ├── thermostat-setup.png ├── Block Diagram.drawio.png ├── thermostat-lesscommon.png ├── thermostat-wificonfig.png └── Block Diagram.drawio ├── firmware ├── firmware_v0.6.bin └── firmware_v0.7.2.bin ├── .gitignore ├── .vscode └── c_cpp_properties.json ├── InitialSetup.md ├── .github └── workflows │ └── ci.yml └── README.md /.unotes/templates/title_date.hbs: -------------------------------------------------------------------------------- 1 | # {{capitalizeAll title}} 2 | 3 | {{formatDate date "llll"}} 4 | 5 | -------------------------------------------------------------------------------- /app/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.tabSize": 2, 3 | "editor.detectIndentation": false 4 | } -------------------------------------------------------------------------------- /app/.unotes/templates/title_date.hbs: -------------------------------------------------------------------------------- 1 | # {{capitalizeAll title}} 2 | 3 | {{formatDate date "llll"}} 4 | 5 | -------------------------------------------------------------------------------- /assets/thermostat-info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smeisner/smart-thermostat/HEAD/assets/thermostat-info.png -------------------------------------------------------------------------------- /assets/thermostat-main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smeisner/smart-thermostat/HEAD/assets/thermostat-main.png -------------------------------------------------------------------------------- /firmware/firmware_v0.6.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smeisner/smart-thermostat/HEAD/firmware/firmware_v0.6.bin -------------------------------------------------------------------------------- /assets/thermostat-setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smeisner/smart-thermostat/HEAD/assets/thermostat-setup.png -------------------------------------------------------------------------------- /firmware/firmware_v0.7.2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smeisner/smart-thermostat/HEAD/firmware/firmware_v0.7.2.bin -------------------------------------------------------------------------------- /assets/Block Diagram.drawio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smeisner/smart-thermostat/HEAD/assets/Block Diagram.drawio.png -------------------------------------------------------------------------------- /assets/thermostat-lesscommon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smeisner/smart-thermostat/HEAD/assets/thermostat-lesscommon.png -------------------------------------------------------------------------------- /assets/thermostat-wificonfig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/smeisner/smart-thermostat/HEAD/assets/thermostat-wificonfig.png -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | .pio 2 | .vscode/.browse.c_cpp.db* 3 | .vscode/c_cpp_properties.json 4 | .vscode/launch.json 5 | .vscode/ipch 6 | lib 7 | -------------------------------------------------------------------------------- /app/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.16.0) 2 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 3 | project(espidf-test) 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Accounting/ 2 | pcb/Thermostat-backups 3 | backups 4 | pcb/production/.nfs* 5 | *backup 6 | *.DONOTCOMPILE 7 | *DO_NOT_COMPILE* 8 | Matter/ -------------------------------------------------------------------------------- /app/src/ui/components/ui_comp_hook.c: -------------------------------------------------------------------------------- 1 | // This file was generated by SquareLine Studio 2 | // SquareLine Studio version: SquareLine Studio 1.3.2 3 | // LVGL version: 8.3.6 4 | // Project name: Thermostat 5 | 6 | -------------------------------------------------------------------------------- /app/include/telnet.h: -------------------------------------------------------------------------------- 1 | void telnet_esp32_listenForClients(void (*callbackParam)(uint8_t *buffer, size_t size)); 2 | void telnet_esp32_sendData(uint8_t *buffer, size_t size); 3 | int telnet_esp32_vprintf(const char *fmt, va_list va); 4 | -------------------------------------------------------------------------------- /app/src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file was automatically generated for projects 2 | # without default 'CMakeLists.txt' file. 3 | 4 | FILE(GLOB_RECURSE app_sources ${CMAKE_SOURCE_DIR}/src/*.*) 5 | 6 | idf_component_register(SRCS ${app_sources}) 7 | -------------------------------------------------------------------------------- /app/default_16mb.csv: -------------------------------------------------------------------------------- 1 | # Name, Type, SubType, Offset, Size, Flags 2 | nvs, data, nvs, 0x9000, 0x5000, 3 | otadata, data, ota, 0xe000, 0x2000, 4 | app0, app, ota_0, 0x10000, 0x640000, 5 | app1, app, ota_1, 0x650000,0x640000, 6 | spiffs, data, spiffs, 0xc90000,0x360000, 7 | coredump, data, coredump,0xFF0000,0x10000, -------------------------------------------------------------------------------- /app/src/ui/filelist.txt: -------------------------------------------------------------------------------- 1 | screens/ui_MainScreen.c 2 | screens/ui_Info.c 3 | screens/ui_Setup.c 4 | screens/ui_LessCommonSetup.c 5 | screens/ui_WifiConfig.c 6 | screens/ui_MatterConfig.c 7 | screens/ui_MqttConfig.c 8 | screens/ui_DeviceName.c 9 | screens/ui_ThermostatRestart.c 10 | ui.c 11 | components/ui_comp_hook.c 12 | ui_helpers.c 13 | -------------------------------------------------------------------------------- /app/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "platformio.platformio-ide" 6 | ], 7 | "unwantedRecommendations": [ 8 | "ms-vscode.cpptools-extension-pack" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /app/src/ui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | SET(SOURCES screens/ui_MainScreen.c 2 | screens/ui_Info.c 3 | screens/ui_Setup.c 4 | screens/ui_LessCommonSetup.c 5 | screens/ui_WifiConfig.c 6 | screens/ui_MatterConfig.c 7 | screens/ui_MqttConfig.c 8 | screens/ui_DeviceName.c 9 | screens/ui_ThermostatRestart.c 10 | ui.c 11 | components/ui_comp_hook.c 12 | ui_helpers.c) 13 | 14 | add_library(ui ${SOURCES}) 15 | -------------------------------------------------------------------------------- /app/include/Arduino.h: -------------------------------------------------------------------------------- 1 | /*--------------------------------------------------------------- 2 | Simple header file to incorporate Arduino functions 3 | mostly for the LD2410 sensor library. 4 | ---------------------------------------------------------------*/ 5 | 6 | #include "thermostat.hpp" 7 | #include "Stream.h" 8 | 9 | #define F(x) (x) 10 | #define HEX "0x%x" 11 | 12 | typedef uint8_t byte; 13 | 14 | #define delay(x) vTaskDelay(pdMS_TO_TICKS(x)) -------------------------------------------------------------------------------- /app/tests.txt: -------------------------------------------------------------------------------- 1 | Verify update over the air works 2 | Motion detection operates 3 | Voltage ripple minimal under load 4 | Light detection operates corretly (display diming influenced correctly) 5 | Waking display (via touch) from dim and from sleep work correctly 6 | Validate HVAC mode change via touch 7 | Validate HVAC mode change via web page 8 | Validate temperature change via touch 9 | Validate temperature change via web page 10 | Validate all config menu items via touch 11 | -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Linux", 5 | "includePath": [ 6 | "${workspaceFolder}/**", 7 | "/home/steve/.platformio/packages/framework-arduinoespressif32/libraries/**" 8 | ], 9 | "defines": [], 10 | "compilerPath": "/usr/bin/gcc", 11 | "cStandard": "c17", 12 | "cppStandard": "gnu++14", 13 | "intelliSenseMode": "linux-gcc-x64" 14 | } 15 | ], 16 | "version": 4 17 | } -------------------------------------------------------------------------------- /app/include/version.h: -------------------------------------------------------------------------------- 1 | 2 | #define VERSION_MAJOR 0 3 | #define VERSION_MINOR 8 4 | #define VERSION_BUILD 0 5 | 6 | #define VERSION_BUILD_DATE __DATE__ 7 | #define VERSION_BUILD_TIME __TIME__ 8 | 9 | #define _STR(x) #x 10 | #define STR(x) _STR(x) 11 | 12 | #define VERSION_STRING STR(VERSION_MAJOR) "." STR(VERSION_MINOR) "." STR(VERSION_BUILD) 13 | #define VERSION_COPYRIGHT "(C) Tah Der 2025 (steve@meisners.net)" 14 | #define VERSION_BUILD_DATE_TIME VERSION_BUILD_DATE " - " VERSION_BUILD_TIME 15 | 16 | extern const char *VersionString; 17 | extern const char *VersionCopyright; 18 | extern const char *VersionBuildDateTime; 19 | -------------------------------------------------------------------------------- /app/measure-heap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # While the thermostat firmware is running, it periodically outputs the 4 | # amount of heap free space. It does this every minute. The script below 5 | # will pares the output log file and generate a CSV that includes 6 | #