Skip to main content

Envirohat

Enviro+ sensors in one place

Installation

Before installing the package, the pyaudio package needs to be installed with apt:

sudo apt install python3-pyaudio

Then the Envirohat package can be installed using pip:

pip intall envirohat

Reference

get_temperature() - get current temperature

get_humidity() - get current humidity

get_pressure() - get current pressure

get_altitude(qnh=1013.25) - get altitude

get_lux(passive=False) - get ambient light in lux

get_proximity(passive=False) - get raw proximity value, closer object produce larger value

gas_read_all() - get gas resistance for oxidising, reducing and NH3

gas_read_oxidising() - get gas resistance for oxidising (calls read_all)

gas_read_reducing() - get gas resistance for reducing (calls read_all)

gas_read_nh3() - get gas resistance for NH3 (calls read_all)

get_amplitudes_at_frequency_ranges(ranges) - get the mean amplitude of frequencies in the given ranges

  • ranges: List of ranges including a start and end range

get_amplitude_at_frequency_range(start, stop) - get the mean amplitude of frequencies in the specified range

  • start: Start frequency (in Hz)
  • end: End frequency (in Hz)

get_noise_profile(noise_floor=100, low=0.12, mid=0.36, high=None) - get a noise characteristic profile

  • noise_floor: "High-pass" frequency, exclude frequencies below this value
  • low: Percentage of frequency ranges to count in the low bin (as a float, 0.5 = 50%)
  • mid: Percentage of frequency ranges to count in the mid bin (as a float, 0.5 = 50%)
  • high: Optional percentage for high bin, effectively creates a "Low-pass" if total percentage is less than 100%

bme - the BME280 sensor

ltr - the LTR559 sensor

noise - the noise sensor

All functions support reading a time averaged value. For example get_temperature(num=5, delay=0.3) returns average of 5 temperature readings, delay is time between each reading in seconds. The default values are: num=1 and delay=0.

Example

from envirohat import EnviroHAT
    
hat = EnviroHAT()
    
print("Tepmerature:", hat.get_temperature(), "°C")
print("Humidity:", hat.get_humidity(num=5, delay=0.3), "%")
print("Raw ALS:", hat.ltr.get_raw_als())

Metadata

Release files for envirohat 1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for envirohat 1.1
File Size Uploaded Provenance Actions
envirohat-1.1.tar.gz 3.6 kB Without provenance Details for envirohat-1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for envirohat 1.1
File Interpreter ABI Platform Actions
envirohat-1.1-py3-none-any.whl Python 3 none any Details for envirohat-1.1-py3-none-any.whl

Total release size: 7.4 kB

Release files / envirohat-1.1.tar.gz

Download URL envirohat-1.1.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
91e34ccb522b67479dab23fd8cb4a6852906ad9d9325c507b721031dc3fb2b96
BLAKE2b-256 checksum
How to use checksums
a1282f8efe5afadbe4b0596ca5cf98fb8498b8406617dd76f093d745d2c98a12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / envirohat-1.1-py3-none-any.whl

Download URL envirohat-1.1-py3-none-any.whl
Size 3.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cae2702a3d1d3eb047e6bf177fb701beacd6a45e5e200cd36045dbbcceb77d4d
BLAKE2b-256 checksum
How to use checksums
86a6ecefdcac0d362f052ca82dcc367c108f3ac776c02f052413f2ebc0d3795f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for envirohat 1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page