aht20

command module
v0.0.0-...-079e598 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2025 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

AHT20 Client

A small client utility for reading and resetting the AHT20 or AM2301B sensor.

Tested on a Raspberry PI with Go 1.22

Usage?

Basic usage information:

$ aht --help
usage: aht20 [<flags>] <command> [<args> ...]

Client for the AHT20

Commands:
  read   Reads from the sensor
  reset  Resets the sensor

Global Flags:
  --help   Show context-sensitive help
  --bus=1  i2c bus number to use
  --debug  Enable debug logging

Reading the device:

$ aht read
Temperature: 24.75C
Relative Humidity: 49.05%

It supports JSON output:

$ aht read --json
{
  "humidity": 49.737072,
  "raw_humidity": 521531,
  "raw_temperature": 391857,
  "temperature": 24.740791
}

And also the format required by Choria Metric watchers:

$ aht20  read --choria --label location:home
{
  "labels": {
    "location": "home"
  },
  "metrics": {
    "humidity": 49.845886,
    "humidity_raw": 522672,
    "temperature": 24.757957,
    "temperature_raw": 391947
  }
}

Contact?

R.I. Pienaar / rip@devco.net / devco.net

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址