Read current weather data from Davis WeatherLink Live units + connected sensors
Project description
WeatherLink Live Local Python API
Python library to read weather data from a Davis WeatherLink Live station + connected sensors (e.g. Vantage Vue). Features:
- discover WeatherLink Live stations in the local network
- read sensor values (called conditions) using the local API - no internet connection required
Although the WeatherLink Live stations are tighly coupled with the web service weatherlink.com, it can be used in offline situations aswell. The well designed HTTP interface makes it easy to read the current weather data via the local network - perfect for IoT / SmartHome applications. In fact, I couldn't find any other commercial weather station with an open ethernet-based protocol (please correct me if I'm wrong).
To set up the WeatherLink Live stations, you need the Davis WeatherLink app (Android, iOS) and a weatherlink.com account. Further sensors can be connected to the station. Afterwards, the weather data is accessible via weatherlink.com (if online) and the local API.
Documentation
Python library: https://weatherlink-live-local-python.rtfd.io/
API specification: https://weatherlink.github.io/weatherlink-live-local-api/
Install
pip install weatherlink-live-local
Example
import weatherlink_live_local as wlll
devices = wlll.discover()
print(devices)
# select first device, get IP address
ip_first_device = devices[0].ip_addresses[0]
# specify units
wlll.set_units(
temperature=wlll.units.TemperatureUnit.CELSIUS,
pressure=wlll.units.PressureUnit.HECTOPASCAL,
rain=wlll.units.RainUnit.MILLIMETER,
wind_speed=wlll.units.WindSpeedUnit.METER_PER_SECOND,
)
# poll sensor data / conditions
while True:
conditions = wlll.get_conditions(ip_first_device)
print(f"Inside temperature: {conditions.inside.temp:.2f} °C")
print(f"Outside temperature: {conditions.integrated_sensor_suites[0].temp:.2f} °C")
time.sleep(10)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file weatherlink-live-local-0.2.0.tar.gz
.
File metadata
- Download URL: weatherlink-live-local-0.2.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bdc978fd98bd4b9848c4c9fa098c26c3fcdf658c4f507c3f422169ebe610344 |
|
MD5 | c5b80bb7304b0e4813438d6be75ddab4 |
|
BLAKE2b-256 | 993a705cb8c4719bd0cc6bcdc8a82bb026843eb6e7e1f3e1e1bb41e1d914811e |