Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vivosun_thermo-1.0.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vivosun_thermo-1.0.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

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

Hashes for vivosun_thermo-1.0.0.tar.gz
Algorithm Hash digest
SHA256 36d23da4c2567c22b664293cb05aff21504a400fc1624281460186bec12e3153
MD5 8b5dfe515fd6b972e188ef33126f625f
BLAKE2b-256 fa867492224259160694bd807881b1c81204f79337859d39113222d5d5749be7

See more details on using hashes here.

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

Hashes for vivosun_thermo-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e1f0943779cdb632be44aa55fa561327e722c75dcc22047fb6376ae822bcc4b
MD5 7087263256059c00972317242c5c70d6
BLAKE2b-256 6e0bd145c3329ad11d8696b7cae3f5c7547ffcb86b1a2030724d0200764c9164

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page