Weather monitoring system with RTL-SDR and AI-powered recommendations.
- RTL-SDR Weather Monitoring: Monitors weather sensors using RTL-433
- Web API: RESTful API for accessing weather data
- Database Storage: SQLite database for weather reports and recommendations
- AI-Powered Recommendations: Uses Ollama to provide smart home automation recommendations
The system now queries an Ollama server every 15 minutes (configurable) to get AI-powered recommendations for:
- Whether to operate the air conditioner
- What temperature to set the air conditioner to
- Whether windows should be open
- Weather description with reasoning
Configuration can be managed in two ways:
- Static Configuration: Edit
config.jsonfile (loaded at startup) - Dynamic Configuration: Use the API endpoints to update configuration at runtime
Configuration schema:
{
"ollamaServerURL": "http://localhost:11434",
"ollamaModel": "llama3.2",
"indoorDeviceModel": "LaCrosse-TX141W",
"outdoorDeviceModel": "LaCrosse-TX141W",
"recommendationIntervalMinutes": 15
}You can now update the configuration without restarting the service:
# Get current configuration
curl http://localhost:6656/config
# Update configuration
curl -X POST http://localhost:6656/config \
-H "Content-Type: application/json" \
-d '{
"ollamaServerURL": "http://localhost:11434",
"ollamaModel": "llama3.2:1b",
"indoorDeviceModel": "New-Indoor-Sensor",
"outdoorDeviceModel": "New-Outdoor-Sensor",
"recommendationIntervalMinutes": 30
}'Features of Dynamic Updates:
- Changes take effect immediately
- Configuration is automatically saved to
config.json - If recommendation interval changes, the worker is automatically restarted
- Validation ensures all required fields are provided
GET /reports/latest- Get the latest weather reportGET /reports/:model- Get weather reports for a specific device modelGET /models- Get all device models with report countsGET /recommendations/latest- Get the latest AI recommendationGET /config- NEW Get current configurationPOST /config- NEW Update configuration dynamically
The system expects Ollama to return JSON in this format:
{
"shouldOperateAirConditioner": true,
"temperatureToSetAirConditionerInF": 72,
"shouldWindowBeOpen": false,
"weatherDescription": "Indoor temperature is 75°F while outdoor is 85°F. AC recommended to maintain comfort."
}- Ollama Server: Ensure Ollama is running on the configured URL
- Model: The specified model should be available in Ollama
- Device Models: Configure the correct device model names for indoor/outdoor sensors
The new OllamaRecommendation table stores:
- Timestamp of recommendation
- AI recommendations (AC operation, temperature, window status)
- Weather description with reasoning
- Indoor and outdoor temperatures used for the recommendation
go build -o oWeatherReader main.go
./oWeatherReaderThe service runs on port 6656 by default.