Skip to main content

Aranet4 Python client

Project description

Aranet4 Python client

Usage

import aranet4

device_mac = "XX:XX:XX:XX:XX:XX"

ar4 = aranet4.Aranet4(device_mac)

Functions

currentReadings(details=False)

Get current readings

Parameters:

  • details: Include interval and last update time values. Works only with firmware 0.3.x+

Returns dictionary object:

Key Value type Notes
temperature float
pressure float
humidity int
co2 int
battery int
interval int details=True
ago int details=True

getInterval()

Returns refresh interval in seconds

getName()

Returns device name

getVersion()

Returns device firmware version

getSecondsSinceUpdate()

Returns time since last refresh in seconds

getTotalReadings()

Returns total readings in memory

getLastMeasurementDate(epoch)

Returns last measurement date

Parameters:

  • epoch - If set to true, returns seconds as float. Otherwise datetime object is returned.

pullHistory(param, start=0x0001, end=0xFFFF)

Get history for single parameter

Parameters:

  • param - parameter id to pull (see Constants - > Parameters)
  • start - index of first log point (starts with 1)
  • end - index of last log point

Returns indexed array of data points. Index 0 is oldest record.

pullTimedHistory(start=0x0001, end=0xFFFF, params="thpc")

Get history for multiple parameters with calculated UTC time

Parameters:

  • start - index of first log point (starts with 1)
  • end - index of last log point
  • params - parameters to read. Default: "thpc". t - Temperature, h - Humidity, p - Pressure, c - CO2

Returns array with data points.

pullTimedInRange(start, end, params="thpc")

Get history for multiple parameters with calculated UTC time in specified datetime range

Parameters:

  • start - Range start datetime (UTC Time), formating example: 2019-10-01T20:00:00Z
  • end - Range end datetime (UTC Time), formating example: 2019-10-02T20:00:00Z
  • params - parameters to read. Default: "thpc". t - Temperature, h - Humidity, p - Pressure, c - CO2

Returns array with data points.

Constants

Parameters (for history)

PARAM_TEMPERATURE = 1
PARAM_HUMIDITY = 2
PARAM_PRESSURE = 3
PARAM_CO2 = 4

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

aranet4-1.1.3-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

aranet4-1.1.3-py2-none-any.whl (5.3 kB view details)

Uploaded Python 2

File details

Details for the file aranet4-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: aranet4-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.3

File hashes

Hashes for aranet4-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 253df398d75741de4a8d625c5a621b5d19f3a082a7869a3b472ed907b870811f
MD5 f0bb9079ef4d1bb2435ce8e7e2bcdc85
BLAKE2b-256 e74c217305cfa13d3e41fa1f05d1dbb5ee062438c718af6bed91c8238031b0f7

See more details on using hashes here.

File details

Details for the file aranet4-1.1.3-py2-none-any.whl.

File metadata

  • Download URL: aranet4-1.1.3-py2-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/2.7.16

File hashes

Hashes for aranet4-1.1.3-py2-none-any.whl
Algorithm Hash digest
SHA256 dbd2f6d28bb8abe4ff8269eadf178c3823b3abc81c2a1fd9e6176af92cf1b405
MD5 a3d3166362fe1bbb4e08170543d8cf90
BLAKE2b-256 c3a92012797a54b996a99009a16b6d547c97ad808fa989f6cc11fa285af94adc

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