A .NET application that monitors Home Assistant entities, checks weather conditions, and displays visual notifications on WLED-compatible LED strips.
GassiMeter integrates three main components:
- Home Assistant Integration (optional) - Monitor entity states
- Weather Monitoring - Check rain forecasts via OpenWeather API
- LED Visualization - Display information on WLED-compatible LED strips
The application runs continuously, checking conditions at configurable intervals and updating LED displays accordingly.
- .NET 9.0 or later
- WLED-compatible LED strip with ESP32
- OpenWeather API key (free tier available)
- Home Assistant instance (optional)
For the legend (show what color means what) and scale I created a few STL files as well as the Blend File (for Blender) so you can change the text if you decide to use my design:
https://www.thingiverse.com/thing:7117297
The application includes a config.json file that needs to be configured with your specific settings:
Hass (Optional)
Sensor: The Home Assistant entity ID to monitorRequiredState: The required state value to check for
Weather (Required)
Longitude: Geographic longitude for weather dataLatitude: Geographic latitude for weather dataDelay: Interval between weather checks (format: "HH:MM:SS", default: "00:02:00")
Wled (Required)
Url: WLED device JSON API endpointCount: Number of LEDs to control (default: 60)Start: Starting LED index (default: 0)MinutesPerLed: Minutes represented per LED (default: 2)Brightness: LED brightness level 0-255 (default: 128)Colors: Array of color-to-rain-amount mappings for LED displayColorCode: 6-character hex color code (e.g., "32FF32" for green)RainAmount: Rain amount in mm/hour that triggers this color- Required values: Must include entries for
RainAmount: -1(missing data) andRainAmount: 0(no rain) - Colors are interpolated between defined values for smooth gradients
- Example color scheme:
-1: "000000" (LEDs off - missing historical data)0: "32FF32" (Green - sunny/no rain)0.5: "00B4FF" (Light Blue - drizzle)2.5: "0032C8" (Blue - light rain)5: "FF3296" (Pink - heavy rain/thunderstorm)10: "DC1414" (Red - very heavy rain)20: "FFC800" (Orange - extreme weather)
OperationTime (Optional)
FromTime: Start time for operation (format: "HH:MM:SS", e.g., "06:00:00")ToTime: End time for operation (format: "HH:MM:SS", e.g., "22:00:00")
- Copy
secrets.example.jsontosecrets.json - Fill in your actual values:
HassBearer: Home Assistant long-lived access token (only required if using Hass integration)WeatherApiKey: OpenWeather API key (required)
The application uses the OpenWeather API to fetch hourly rain forecasts. The free tier includes:
- 1,000 API calls per day
Important: With the default 2-minute interval, running 24/7 will make approximately 720 calls per day, which is within the free tier limit. If you want to reduce the interval make sure you set a limit at WeatherApi. One Call per minute is above the free tier when running 24h.
- Clone the repository
- Install .NET 9.0 SDK
- Configure
config.jsonwith your location and device settings - Copy
secrets.example.jsontosecrets.jsonand add your API keys - Get your OpenWeather API key from openweathermap.org
- Configure your WLED device and note its IP address
- Build and run the application:
dotnet build
dotnet run- Clone the repository
- Configure
config.jsonandsecrets.jsonon your host machine - Build the Docker image:
docker build -t gassimeter .- Run the container with volume mounts for configuration:
docker run -d \
--name gassimeter \
-v /path/to/your/config.json:/app/config.json \
-v /path/to/your/secrets.json:/app/secrets.json \
gassimeterReplace /path/to/your/ with the actual paths to your configuration files on the host system.
The application requires two configuration files that should be mounted as volumes:
- config.json: Application settings including weather location, WLED device URL, and color mappings
- secrets.json: API keys and sensitive credentials
Example with absolute paths:
docker run -d \
--name gassimeter \
-v /home/user/gassimeter/config.json:/app/config.json \
-v /home/user/gassimeter/secrets.json:/app/secrets.json \
gassimeterThis approach keeps your configuration and secrets outside the container, making it easy to update settings without rebuilding the image.
To use the Home Assistant integration:
- Generate a long-lived access token in Home Assistant
- Add the token to
secrets.jsonasHassBearer - Configure the
Hasssection inconfig.jsonwith your entity and required state - If the Hass configuration is omitted, this step will be skipped automatically
- Flash your ESP32 with WLED firmware
- Connect to your WiFi network
- Note the device's IP address
- Update the
Wled.Urlin your config to point tohttp://[device-ip]/json/state
- Configuration errors: Ensure JSON syntax is valid in both config files
- API errors: Verify your OpenWeather API key is valid and active
- WLED connection: Check that the ESP32 is accessible on your network
- Home Assistant: Verify your long-lived token has appropriate permissions
This project is open source. Please check the LICENSE file for details.
