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

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

Uploaded Python 3

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

Uploaded Python 2

Supported by

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