Python library and CLI tool for interacting with Vivosun Thermo devices via Bluetooth
Project description
Vivosun Thermo Python Library and CLI
Vivosun Thermo is a Python library and CLI tool for interacting with Vivosun Thermo devices via Bluetooth. It allows you to:
- Read the current temperature, humidity, and computed VPD from your device.
- Scan for nearby devices.
- Use a simple API for custom integrations.
The library supports both a command-line interface (CLI) and a Python API. It is licensed under the MIT License.
Features
- CLI: Command-line interface to scan and read data from Vivosun Thermo devices.
- API: A Python interface for programmatic access to temperature, humidity, and VPD readings.
- Flexible Output: Supports text and JSON output formats for integration with other tools.
Supported Devices
- VS-THB1S: VIVOSUN AeroLab Hygrometer Thermometer
CLI Usage
Installation
# see details for your OS: https://github.com/pypa/pipx
brew install pipx
# install as CLI
pipx install vivosun_thermo
Scan for Nearby Devices
Use the list command to scan for nearby devices:
vivosun-thermo list
Options:
-f,--format: Output format (text or json). Default: text.--scan-timeout: Duration (in seconds) for scanning devices.--adapter: Bluetooth adapter name (e.g., hci0 on Linux).
NOTE: Already connected devices won't show up in the list.
Read Status from a Device
Use the status command to read temperature, humidity, and VPD:
vivosun-thermo status <device_address>
Options:
-u,--unit: Temperature unit (c for Celsius, f for Fahrenheit). Default: c.-f,--format: Output format (text or json). Default: text.--connect-timeout: Timeout for connecting to the device. Default: 15 seconds.--read-timeout: Timeout for reading data. Default: 0.5 seconds.--adapter: Bluetooth adapter name (e.g., hci0 on Linux).
NOTE: Enable pairing mode on device for initial connection.
Python API Usage
Example:
import asyncio
from vivosun_thermo import VivosunThermoClient, PROBE_MAIN, UNIT_CELSIUS
async def main():
async with VivosunThermoClient("device_address") as client:
temperature = await client.current_temperature(PROBE_MAIN, UNIT_CELSIUS)
humidity = await client.current_humidity(PROBE_MAIN)
vpd = await client.current_vpd(PROBE_MAIN)
print(f"Temperature: {temperature}°C")
print(f"Humidity: {humidity}%")
print(f"VPD: {vpd} kPa")
asyncio.run(main())
License
This project is licensed under the MIT License. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vivosun_thermo-1.0.0.tar.gz.
File metadata
- Download URL: vivosun_thermo-1.0.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36d23da4c2567c22b664293cb05aff21504a400fc1624281460186bec12e3153
|
|
| MD5 |
8b5dfe515fd6b972e188ef33126f625f
|
|
| BLAKE2b-256 |
fa867492224259160694bd807881b1c81204f79337859d39113222d5d5749be7
|
File details
Details for the file vivosun_thermo-1.0.0-py3-none-any.whl.
File metadata
- Download URL: vivosun_thermo-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e1f0943779cdb632be44aa55fa561327e722c75dcc22047fb6376ae822bcc4b
|
|
| MD5 |
7087263256059c00972317242c5c70d6
|
|
| BLAKE2b-256 |
6e0bd145c3329ad11d8696b7cae3f5c7547ffcb86b1a2030724d0200764c9164
|