@@ -28,9 +28,10 @@ struct DeviceConfig {
2828 bool alert_enabled; // Enable/disable alert output
2929 bool alert_on_cloud; // Trigger alert on cloud detection
3030 float alert_cloud_temp_threshold; // Cloud temperature threshold (°C)
31+ bool alert_cloud_below; // true = alert when temp < threshold, false = alert when temp > threshold
3132 bool alert_on_light; // Trigger alert on high light (dawn/lights)
3233 float alert_light_threshold; // Light threshold in lux for alert
33- bool alert_active_high ; // true = alert HIGH when triggered , false = alert LOW
34+ bool alert_light_above ; // true = alert when lux > threshold , false = alert when lux < threshold
3435
3536 // Measurement intervals (milliseconds)
3637 uint16_t measurement_interval; // Default: 2000 ms
@@ -72,10 +73,11 @@ class ConfigManager {
7273 // Alert defaults
7374 config.alert_enabled = false ;
7475 config.alert_on_cloud = true ;
75- config.alert_cloud_temp_threshold = -10.0 ; // Alert if sky temp < -10°C (clouds)
76+ config.alert_cloud_temp_threshold = -10.0 ; // Cloud temperature threshold
77+ config.alert_cloud_below = true ; // Alert when sky temp < threshold (warmer = clouds)
7678 config.alert_on_light = true ;
77- config.alert_light_threshold = 10.0 ; // Alert if light > 10 lux (dawn/lights)
78- config.alert_active_high = true ; // HIGH = alert active
79+ config.alert_light_threshold = 10.0 ; // Light threshold
80+ config.alert_light_above = true ; // Alert when light > threshold (dawn/lights)
7981
8082 // Timing defaults
8183 config.measurement_interval = 2000 ;
@@ -137,9 +139,10 @@ class ConfigManager {
137139 bool isAlertEnabled () { return config.alert_enabled ; }
138140 bool isAlertOnCloud () { return config.alert_on_cloud ; }
139141 float getAlertCloudTempThreshold () { return config.alert_cloud_temp_threshold ; }
142+ bool isAlertCloudBelow () { return config.alert_cloud_below ; }
140143 bool isAlertOnLight () { return config.alert_on_light ; }
141144 float getAlertLightThreshold () { return config.alert_light_threshold ; }
142- bool isAlertActiveHigh () { return config.alert_active_high ; }
145+ bool isAlertLightAbove () { return config.alert_light_above ; }
143146 uint16_t getMeasurementInterval () { return config.measurement_interval ; }
144147 const char * getDeviceLabel () { return config.device_label ; }
145148
@@ -151,9 +154,10 @@ class ConfigManager {
151154 void setAlertEnabled (bool value) { config.alert_enabled = value; }
152155 void setAlertOnCloud (bool value) { config.alert_on_cloud = value; }
153156 void setAlertCloudTempThreshold (float value) { config.alert_cloud_temp_threshold = value; }
157+ void setAlertCloudBelow (bool value) { config.alert_cloud_below = value; }
154158 void setAlertOnLight (bool value) { config.alert_on_light = value; }
155159 void setAlertLightThreshold (float value) { config.alert_light_threshold = value; }
156- void setAlertActiveHigh (bool value) { config.alert_active_high = value; }
160+ void setAlertLightAbove (bool value) { config.alert_light_above = value; }
157161 void setMeasurementInterval (uint16_t value) { config.measurement_interval = value; }
158162 void setDeviceLabel (const char * label) {
159163 strncpy (config.device_label , label, sizeof (config.device_label ) - 1 );
@@ -169,10 +173,9 @@ class ConfigManager {
169173 Serial.print (" # Cloud Threshold: " ); Serial.println (config.cloud_threshold , 2 );
170174 Serial.print (" # Alert Enabled: " ); Serial.println (config.alert_enabled ? " YES" : " NO" );
171175 Serial.print (" # Alert on Cloud: " ); Serial.println (config.alert_on_cloud ? " YES" : " NO" );
172- Serial.print (" # Alert Cloud Temp Threshold: " ); Serial.print (config.alert_cloud_temp_threshold , 2 ); Serial.println (" °C" );
176+ Serial.print (" # Alert Cloud Temp Threshold: " ); Serial.print (config.alert_cloud_temp_threshold , 2 ); Serial.print (" °C " ); Serial. println (config. alert_cloud_below ? " (below) " : " (above) " );
173177 Serial.print (" # Alert on Light: " ); Serial.println (config.alert_on_light ? " YES" : " NO" );
174- Serial.print (" # Alert Light Threshold: " ); Serial.print (config.alert_light_threshold , 2 ); Serial.println (" lux" );
175- Serial.print (" # Alert Active High: " ); Serial.println (config.alert_active_high ? " YES" : " NO" );
178+ Serial.print (" # Alert Light Threshold: " ); Serial.print (config.alert_light_threshold , 2 ); Serial.print (" lux " ); Serial.println (config.alert_light_above ? " (above)" : " (below)" );
176179 Serial.print (" # Measurement Interval: " ); Serial.print (config.measurement_interval ); Serial.println (" ms" );
177180 Serial.print (" # Device Label: " ); Serial.println (config.device_label );
178181 Serial.println (" # ============================" );
0 commit comments