homebridge-aranet4-py
v0.0.47
Published
An Homebridge plugin to get data from an Aranet4 via Py library.
Downloads
23
Readme
Homebridge-Aranet4-Py
A Homebridge plugin for Aranet4 devices using external Python library to fetch data.
The Python library uses Bluetooth 4 (Low Energy) to connect to the Aranet and reports the CO2 level, humidity and temperature and the device's battery into HomeKit.
There is python script, which will have to be run in a loop that will output a txt file containing the sensor data. This file is read by the plugin. The output file must be specified in plugin config - via local file name or URL. The output file must have exact 10 lines:
manufacturer
modelNumber
serialNumber
hardwareRevision
firmwareRevision
temperature
humidity
co2
pressure
battery
Example python script to produce the output file
#!/usr/bin/python
from pyaranet4 import Aranet4
import sys
a4 = Aranet4()
#print(a4.current_readings.co2)
#print(a4.current_readings.temperature)
#print(a4.current_readings.humidity)
file_path = './aranet4_output.txt'
sys.stdout = open(file_path, "w")
print("%s" % a4.manufacturer_name )
print("%s" % a4.model_name)
print("111111")
print("%s" % a4.hardware_revision )
print("%s" % a4.software_revision )
print("%s" % a4.current_readings.temperature )
print("%s" % a4.current_readings.humidity)
print("%i" % a4.current_readings.co2)
print("%s" % a4.current_readings.pressure)
print("%s%%" % a4.battery_level)