Skip to content

spatie/dashboard.spatie.be-external-sensors

Repository files navigation

WIP: This repo is a wip - indoor air quality data is not working yet

External sensors for dashboard.spatie.be

Small Node.js script to report office temperatures and indoor air quality to the Spatie dashboard. Uses the 1-wire bus and IC2 on a Raspberry Pi to read data from external sensors.

  • office temperature: DS18B20 sensor over 1-wire bus
  • indoor air quality (IAQ): BME680 over IC2

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Install

You can install the reporter on your Raspberry Pi by cloning the repository and installing its dependencies.

git clone git@github.com:spatie/raspberrypi-temperature-reporter.git
yarn install

Copy or rename the .env.example file to .env and update the values in there with your dashboard's URL, basic auth username and password.

cp .env.example .env

Run the script to make sure a temperature is being reported and broadcasted:

node report-temperature.js
# expected output: temperature=21.312

Finally add the script to your Raspberry's cronjobs using crontab -e to run once per minute.

* * * * * sudo /bin/bash -c "cd /home/pi/raspberrypi-temperature-reporter/ && node ./report-temperature.js" >> /home/pi/temperature.log 2>&1

Deploying code changes to the Raspberry Pi

If you're running a fork of this script you can use the Envoy.blade.php file to deploy changes to your pi after pushing. The deploy script will SSH to your pi and pull in new changes from the git repository.

envoy run deploy

Contributing

Since this is an internal project, we don't accept pull requests at this time. If you have discovered a bug or have an idea to improve the code, open an issue first before you start coding.

Security

If you discover any security related issues, please contact freek@spatie.be instead of using the issue tracker.

License

The MIT License (MIT). Please see License File for more information.

Credits

About Spatie

Spatie is a webdesign agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published