Python 3.14.7 (tags/v3.14.7:823f032, Aug  5 2026, 10:51:32) [MSC v.1944 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
...     forecast = fetch_weather_solar_forecast()
...
...     # Decision Matrix Logic
...     if current_solar_kw > 4.5 and battery_soc_percent > 85.0 and forecast['cloud_coverage'] < 30:
...         decision = "MAXIMUM_SOLAR_PEAK"
...         action = "ENABLE_HIGH_LOADS"
...         # Publish MQTT command to edge controller to start sauna preheat
...         payload = json.dumps({"sauna_relay": True, "pool_pump": True, "mode": "Solar_Direct"})
...         client.publish("eco/site/power_control", payload)
...
...     elif battery_soc_percent < 30.0:
...         decision = "BATTERY_CRITICAL"
...         action = "SHED_NON_ESSENTIAL_LOADS"
...         payload = json.dumps({"sauna_relay": False, "pool_pump": False, "mode": "Eco_Save"})
...         client.publish("eco/site/power_control", payload)
...
...     else:
...         decision = "BALANCED_OPERATION"
...         action = "MAINTAIN_CURRENT_STATE"
...
...     return {
...         "status": "Success",
...         "decision": decision,
...         "action_taken": action,
...         "telemetry_summary": {
...             "solar_kw": current_solar_kw,
...             "battery_soc": battery_soc_percent,
...             "forecast_clouds": forecast['cloud_coverage']
...         }
...     }
