- Python 99.1%
- Dockerfile 0.9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
Limits no longer seem to be always present, make finding and processing them more robust. |
||
| .forgejo/workflows | ||
| rootfs/rws2mqtt/app | ||
| tests | ||
| .gitignore | ||
| docker-compose.yml | ||
| Dockerfile | ||
| pytest.ini | ||
| README.md | ||
| requirements-dev.txt | ||
| requirements.txt | ||
rws2mqtt
Rijkswaterstaat data (waterhoogte, waterafvoer) in MQTT
Usage
Go to this page, open the details for the height/flow measurement(s) you want to track. Click 'Export/delen' and then 'Link' to find the location code. It will look something like tiel.waal
Config
Mandatory is one or more sensor entries with their location code and type. The name is optional; when omitted it is derived from the location code by replacing dots with spaces and title casing it (tiel.waal becomes Tiel Waal).
interval: 10m
sensor:
- location: 'tiel.waal'
name: 'Tiel-Waal' # Optional!
type: 'waterafvoer'
- location: 'tiel.waal'
type: 'waterhoogte'
For a single sensor, you don't have to define an array:
sensor:
location: 'tiel.waal'
type: 'waterhoogte'
Valid types are waterhoogte, waterafvoer, watertemperatuur and zouten. The interval accepts either a number of seconds or a duration such as 10m or 1h30m.
Full config (with defaults):
interval: 900
oneshot: false
sensor:
- location: tiel.waal
name: Tiel-Waal
type: waterhoogte
mqtt:
host: localhost
port: 0 # 0 means 1883, or 8883 when ssl is enabled
ssl: false
ssl_insecure: false
client_id: rws2mqtt
topic: rws2mqtt
keepalive: 0
username: null # may also be nested under an 'auth' key
password: null
homeassistant:
discovery: false
topic: homeassistant
cleanup: true
logging:
file: null
level: INFO
colourize: false
format: '%(asctime)s %(name)s %(levelname)-8s %(message)s'
date_format: '%Y-%m-%d %H:%M:%S'
The config file is read from /etc/rws2mqtt.yml, or from the path in the CONFIG environment variable.
Development
python3 -m pip install -r requirements-dev.txt
python3 -m pytest