DEV Community

Cover image for Monitoring Apartment temperature & humidity with Raspberry Pi, Prometheus & Grafana

Monitoring Apartment temperature & humidity with Raspberry Pi, Prometheus & Grafana

Paulius on February 29, 2020

For quite some time, I had a spare Raspberry Pi lying around in my place. And one weekend I came up with idea to make my apartment "smarter". What ...
Collapse
 
idriss_neumann profile image
Idriss Neumann ∞ 🐧 🐳 🦊 • Edited

Great article :) We did use the same sensor couple weeks ago (and bunch of other sensors) but with AdaFruit and ElasticSearch and Kibana instead that are directly hosted on the raspberry and run on docker arm based containers. It worked like a charm.

xt9ms2slxuqe2klmf9nc

ulmijv7ijggksiy6jskc

Collapse
 
ewoks profile image
Beeblebrox

Cool... Would you consider writing more about those containers running on RPi?

Collapse
 
idriss_neumann profile image
Idriss Neumann ∞ 🐧 🐳 🦊

Yeah I think to write a complete article about that (docker+ElasticStack+elastalertΒ±gitlab-runner and one sensor on a raspberry pi 4).

Maybe I'll choose the same sensor that work directly with the raspberry gpio inputs whereas we had to use an arduino for the others (which send the data to the rpi after reading the analog inputs) as you can see it on my previous pictures.

Thread Thread
 
ewoks profile image
Beeblebrox

Hi Idriss,

did you manage to publish it already? Let me know.. :)

Thread Thread
 
idriss_neumann profile image
Idriss Neumann ∞ 🐧 🐳 🦊

Hi Vladi Beeblebrox.

Yes and no ^^

1) I did not published an article on how I handle to convert analogical sensor data using arduino or esp32 and read numerical data using AdaFruit library with Pyhton in order to push those data on ElasticSearch. The veggiepi.com project has been paused since the COVID19.

2) I did published, on apache 2.0 opensource licence, ARM-based docker images for Elasticsearch, Kibana and Elastalert on dockerhub in order to provide freely, images that can be easily used by everyone on their raspberrypi projects.

The Dockerfiles are here: gitlab.comwork.io/oss/elasticstack...

You'll find the dockerhub links and docker pull commands on the README.

Those images are built using raspberrypi as gitlab runners and are successfully used by the veggiepi.com prototype.

3) I also published, again on apache 2.0 opensource licence, an example of project that use those images with docker-compose here: gitlab.comwork.io/oss/covid19

This project aims to provide a docker container that handle to get the covid19 worldwide opendata (on multiple datasources) and push them on Elasticsearch in order to be able to make some graphs, timeseries visualizations and dashboards on Kibana (or Grafana instead if you like).

The "covid-stat" image is built for x86 servers and raspberrypi and you'll find docker-compose files for both architectures (the ARM one is using the sames Elasticsearch and Kibana that I was talking about before).

I also use gitlab-runner both on a x86 dedicated server and a raspberrypi in order to build the "covid-stat" image and deliver to dockerhub.

4) I will give a talk on this project in the next Elastic FR Meetup: community.elastic.co/events/detail...

This talk will probably be recorded and published on youtube and I'll push the slides on the repo after this session.

Unfortunately it will be in French because this meetup is french-speakers oriented but It's possible that I will give others online talks somewhere else about that. And I'll translate the slides before pushing it on the repository.

Thread Thread
 
ewoks profile image
Beeblebrox

wow, great stuff here... My french got pretty rusty but I will for sure take a look at docker images and the project. Thanks for sharing and contributing to the open source man πŸ‘πŸ‘πŸ‘

Thread Thread
 
idriss_neumann profile image
Idriss Neumann ∞ 🐧 🐳 🦊

Anyway I give the youtube link just in case for french speakers ^^

=> youtu.be/BC1iSnoe15k

Collapse
 
idriss_neumann profile image
Idriss Neumann ∞ 🐧 🐳 🦊

Hi.

Finally I managed to make a ready to use image for the DHT22 (temperature and humidity sensor) here: gitlab.comwork.io/oss/veggiepi/hum...

You can directly use the docker-compose here (the images are available on docker hub and distributed in OpenSource). In this repo, there is a README.md file that will explain everything about how to run all the stack on your raspberrypi.

Collapse
 
pdambrauskas profile image
Paulius

Nice setup! I'm thinking about connecting some kind of noice sensor to measure sound levels, maybe you have some recommendations on that?

Collapse
 
idriss_neumann profile image
Idriss Neumann ∞ 🐧 🐳 🦊 • Edited

No sorry. For now I only focus on sensors that are used for monitoring hydroponic and aquaponic systems (electrical conductivity, ph, temperature and humidity, water temperature, etc) wich doesn't require to monitor the noise. But it can be interesting for other projects so let's keep in touch :)

Collapse
 
daviddalbusco profile image
David Dal Busco

A nice read for my Sunday's morning breakfast πŸ˜‰

Thanks for the share and congratulations for the cool pet project πŸ‘

Collapse
 
ewoks profile image
Beeblebrox

Looks nice.. maybe you could add CO2 sensor too?

Collapse
 
pdambrauskas profile image
Paulius

Yes, CO2 senor addition would be nice, also I'm thinking about some kind of movement sensor.

Collapse
 
ben profile image
Ben Halpern

Very cool!