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.

Files for aranet4, version 1.1.3.post1
Filename, size File type Python version Upload date Hashes
Filename, size aranet4-1.1.3.post1-py2-none-any.whl (5.4 kB) File type Wheel Python version py2 Upload date Hashes View hashes
Filename, size aranet4-1.1.3.post1-py3-none-any.whl (5.4 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size aranet4-1.1.3.post1.tar.gz (5.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page