Compare commits
2 Commits
b346be9431
...
95e159ee5d
| Author | SHA1 | Date | |
|---|---|---|---|
| 95e159ee5d | |||
| 5da44e1397 |
32
README.md
32
README.md
@@ -2,9 +2,14 @@
|
|||||||
|
|
||||||
> Automated climate control system using Raspberry Pi Pico W with web interface and scheduling
|
> Automated climate control system using Raspberry Pi Pico W with web interface and scheduling
|
||||||
|
|
||||||
## Overview
|
## Recent Updates
|
||||||
|
|
||||||
This project provides automated climate monitoring and control using a Raspberry Pi Pico W. Features dual-zone temperature monitoring, AC/heater control, time-based scheduling, and a web interface for easy management.
|
- 🆕 **Immediate schedule application:** When resuming scheduling from hold mode, the system now instantly applies the current schedule targets (no delay).
|
||||||
|
- 🆕 **Aggressive memory management:** Garbage collection runs every 5 seconds for improved reliability.
|
||||||
|
- 🆕 **Manual hold settings:** `ac_target` and `heater_target` in `config.json` now only store your last manual hold settings, not schedule targets.
|
||||||
|
- 🆕 **NTP sync optimization:** NTP modules are loaded only when needed, saving RAM.
|
||||||
|
- 🆕 **Temperature validation:** Impossible sensor readings are ignored for safety.
|
||||||
|
- 🆕 **Improved config persistence:** All changes are saved and reloaded immediately.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
@@ -17,6 +22,7 @@ This project provides automated climate monitoring and control using a Raspberry
|
|||||||
- ✅ Configurable alert thresholds
|
- ✅ Configurable alert thresholds
|
||||||
- ✅ Exception recovery (system won't crash permanently)
|
- ✅ Exception recovery (system won't crash permanently)
|
||||||
- ✅ Graceful shutdown with Ctrl+C
|
- ✅ Graceful shutdown with Ctrl+C
|
||||||
|
- ✅ **Aggressive garbage collection for stability**
|
||||||
|
|
||||||
- **Climate Control**
|
- **Climate Control**
|
||||||
- ✅ Automated AC control with temperature swing logic
|
- ✅ Automated AC control with temperature swing logic
|
||||||
@@ -24,6 +30,7 @@ This project provides automated climate monitoring and control using a Raspberry
|
|||||||
- ✅ Short-cycle protection for both AC and heater
|
- ✅ Short-cycle protection for both AC and heater
|
||||||
- ✅ Dual relay control via opto-coupler for 110V AC
|
- ✅ Dual relay control via opto-coupler for 110V AC
|
||||||
- ✅ Mutual exclusion (AC and heater never run simultaneously)
|
- ✅ Mutual exclusion (AC and heater never run simultaneously)
|
||||||
|
- ✅ **Manual hold settings are preserved and not overwritten by schedules**
|
||||||
|
|
||||||
- **Scheduling System**
|
- **Scheduling System**
|
||||||
- ✅ 4 configurable time-based schedules per day
|
- ✅ 4 configurable time-based schedules per day
|
||||||
@@ -33,6 +40,7 @@ This project provides automated climate monitoring and control using a Raspberry
|
|||||||
- ✅ Permanent hold mode (manual control until restart)
|
- ✅ Permanent hold mode (manual control until restart)
|
||||||
- ✅ Schedule configuration persists through reboots
|
- ✅ Schedule configuration persists through reboots
|
||||||
- ✅ Hold modes reset to Automatic on restart (safety feature)
|
- ✅ Hold modes reset to Automatic on restart (safety feature)
|
||||||
|
- ✅ **Immediate schedule application after resuming from hold**
|
||||||
|
|
||||||
- **Web Interface**
|
- **Web Interface**
|
||||||
- ✅ Real-time temperature display
|
- ✅ Real-time temperature display
|
||||||
@@ -43,11 +51,23 @@ This project provides automated climate monitoring and control using a Raspberry
|
|||||||
- ✅ Countdown timer for temporary holds
|
- ✅ Countdown timer for temporary holds
|
||||||
- ✅ Mobile-responsive design
|
- ✅ Mobile-responsive design
|
||||||
- ✅ Auto-refresh dashboard (30 seconds)
|
- ✅ Auto-refresh dashboard (30 seconds)
|
||||||
|
- ✅ **Settings and schedule changes are reflected instantly**
|
||||||
|
|
||||||
- **Planned Features**
|
## Configuration Notes
|
||||||
- 🚧 Humidity monitoring (DHT22/SHT31)
|
|
||||||
- 🚧 Soil moisture monitoring
|
- **AC/Heater target settings:**
|
||||||
- 🚧 Additional relay control for fans, grow lights
|
- `ac_target` and `heater_target` in `config.json` are updated whenever you use Temp Hold, Perm Hold, or when a schedule is applied.
|
||||||
|
- When schedules are active, these values are updated to match the current schedule’s targets.
|
||||||
|
- This ensures the config file always reflects the current operating temperatures, whether in hold mode or schedule mode.
|
||||||
|
|
||||||
|
- **Immediate schedule application:**
|
||||||
|
- When you click "Resume Scheduling," the system applies the current schedule targets instantly, so the dashboard updates without delay.
|
||||||
|
|
||||||
|
- **Memory management:**
|
||||||
|
- Garbage collection runs every 5 seconds to prevent memory fragmentation and crashes.
|
||||||
|
|
||||||
|
- **Sensor validation:**
|
||||||
|
- Temperatures outside the range -50°F to 150°F are ignored to prevent false readings.
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
|
|||||||
@@ -85,7 +85,6 @@ class ScheduleMonitor:
|
|||||||
if not schedule:
|
if not schedule:
|
||||||
return
|
return
|
||||||
|
|
||||||
# Check if this is a different schedule than last applied
|
|
||||||
schedule_id = schedule.get('time', '') + schedule.get('name', '')
|
schedule_id = schedule.get('time', '') + schedule.get('name', '')
|
||||||
if schedule_id == self.last_applied_schedule:
|
if schedule_id == self.last_applied_schedule:
|
||||||
return # Already applied
|
return # Already applied
|
||||||
@@ -94,16 +93,29 @@ class ScheduleMonitor:
|
|||||||
# Update AC settings if provided
|
# Update AC settings if provided
|
||||||
if 'ac_target' in schedule:
|
if 'ac_target' in schedule:
|
||||||
self.ac_monitor.target_temp = float(schedule['ac_target'])
|
self.ac_monitor.target_temp = float(schedule['ac_target'])
|
||||||
|
self.config['ac_target'] = float(schedule['ac_target']) # <-- ADD THIS
|
||||||
|
|
||||||
if 'ac_swing' in schedule:
|
if 'ac_swing' in schedule:
|
||||||
self.ac_monitor.temp_swing = float(schedule['ac_swing'])
|
self.ac_monitor.temp_swing = float(schedule['ac_swing'])
|
||||||
|
self.config['ac_swing'] = float(schedule['ac_swing']) # <-- ADD THIS
|
||||||
|
|
||||||
# Update heater settings if provided
|
# Update heater settings if provided
|
||||||
if 'heater_target' in schedule:
|
if 'heater_target' in schedule:
|
||||||
self.heater_monitor.target_temp = float(schedule['heater_target'])
|
self.heater_monitor.target_temp = float(schedule['heater_target'])
|
||||||
|
self.config['heater_target'] = float(schedule['heater_target']) # <-- ADD THIS
|
||||||
|
|
||||||
if 'heater_swing' in schedule:
|
if 'heater_swing' in schedule:
|
||||||
self.heater_monitor.temp_swing = float(schedule['heater_swing'])
|
self.heater_monitor.temp_swing = float(schedule['heater_swing'])
|
||||||
|
self.config['heater_swing'] = float(schedule['heater_swing']) # <-- ADD THIS
|
||||||
|
|
||||||
|
# Save updated config to file so targets persist
|
||||||
|
try:
|
||||||
|
import json
|
||||||
|
with open('config.json', 'w') as f:
|
||||||
|
json.dump(self.config, f)
|
||||||
|
print("✅ Config updated with active schedule targets")
|
||||||
|
except Exception as e:
|
||||||
|
print("⚠️ Could not save config: {}".format(e))
|
||||||
|
|
||||||
# Log the change
|
# Log the change
|
||||||
schedule_name = schedule.get('name', 'Unnamed')
|
schedule_name = schedule.get('name', 'Unnamed')
|
||||||
|
|||||||
Reference in New Issue
Block a user