Skip to content

Get Homebridge air quality values from file

License

Notifications You must be signed in to change notification settings

lwitzani/homebridge-air-quality-file

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

homebridge-air-quality-file

This is a plugin for Homebridge which shows up as an air quality sensor. The values are read from a file. Based on homebridge-temperature-file.

File format

The plugin expects to get a list of readings in JSON form:

[
  {"pm25": 1.3, "pm10": 2.9, "time": "12.03.2020 21:23:32"},
  {"pm10": 2.1, "pm25": 1.1, "time": "12.03.2020 22:47:28"}
]

You can use this guide to setup a Python script to read values from a SDS011 sensor to a file.

For American users, make sure to change line 137 (jsonrow) of aqi.py (from the guide above). The date format must be changed from %d.%m.%Y to %m.%d.%Y for the plugin to work.

Installation and configuration

Run npm install homebridge-air-quality-file

Add an acceessory configuration into your Homebridge config.json:

{
  "accessory": "AirQualityFile",
  "name": "Air-quality-sensor",
  "description": "Air quality sensor",
  "file_path": "/home/pi/air-quality/aqi.json"
}

Point the file_path to a file containing the readings.

About

Get Homebridge air quality values from file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 93.8%
  • JavaScript 6.2%