About this project

PySmartHome-PC is a resilient smart home platform designed to bridge ESP32 sensor nodes with a robust Python server running on a Windows PC. The system collects temperature and humidity data from ESP32 devices (such as ESP32 Hub and ESP32-S3) equipped with DHT22 sensors and OLED displays. These nodes expose a minimal HTTP API endpoint (/api/status) which the Python server polls every 10 seconds. The server, built with Flask, logs data to CSV files and serves a local dashboard at http://localhost:5000. It also syncs data and configuration to GitHub every 5 minutes, enabling a mirror online dashboard hosted on GitHub Pages. This dual-dashboard approach ensures data availability both locally and remotely, with identical visual designs and features. Key features include: - Interactive charts with zoom, pan, and CSV export capabilities. - Rich statistics per room, including averages, min/max values, and trend analysis against previous days. - A specialized power outage scheduling system for regions with planned cuts, featuring rolling 2-hour slots, Friday skips, and live countdowns with progress bars. - A local file manager for uploading, downloading, and deleting server files. - Ten customizable themes (e.g., cyberpunk, light, retro CRT) and full support for Persian and English languages with RTL layout. - Configuration via environment variables for IPs, intervals, and thresholds, keeping code changes minimal. - Automatic installation of dependencies and startup scripts for ease of use on Windows. The architecture emphasizes reliability and simplicity, avoiding complex Arduino frameworks on the server side while maintaining minimal firmware on the ESP32s. The project is open-source under the MIT license and welcomes contributions for future features like WebSocket updates and temperature forecasting.