This is my playground for home automation / smart home, whatever you want to call it.
My goal is to integrate the sensors I have and do something useful. There is no final plan, it evolves as I wade. Please note that the flows are tied to my environment and you might need to adjust them if you reuse them.
Run git clone --recurse-submodules https://github.com/dArignac/smarthome.git
.
- RaspberryPi 2
- an external 2,5 inch hard disk, I use Intenso Memory Board
- Jeelink
- La Crosse based temperature sensor: Technoline TX29DTH-IT
- Fritz!DECT 200 smart plug
- Xiaomi Mi Plant sensor
- Nodered
- I use a customized docker image that is build for
armv7
(Raspberry Pi) and has several prerequisites set up (like serial port support) - it additionally has my required node packages installed
- it is also published to dockerhub: https://hub.docker.com/r/darignac/node-red
- see nodered/README.md for further information
- I use a customized docker image that is build for
- Mosquitto
- influxdb
- Grafana
- Caddy as proxy for Grafana
- Discord bot for receiving notifications
- utilizing node-red-node-discord
See https://github.com/dArignac/smarthome/issues.
Follow SETUP.md.
Afterwards ramp the services up by running docker-compose up -d
.
If everything was alright, then you can access the services as follows (Note that my pi is named nodered
, yours probably has a different name):
- Nodered: http://nodered:1880
- import the flows from the
nodered
folder - they work out of the box
- import the flows from the
- Grafana (as Admin): http://nodered:3000
- the default credentials are
admin:admin
- first, create the datasource for the influxdb at http://nodered:3000/datasources/new
- URL:
http://influxdb:8086
- Database:
db0
- User:
user
- Password:
password
- click
Save & Test
- URL:
- import the dashboards from the
grafana
folder at http://nodered:3000/dashboard/import and choose the influxdb instance - create a new user named
viewer
and assign him theViewer
role
- the default credentials are
- Grafana (as viewer): http://nodered:8080
If you use PiCoolFAN4 for cooling the Raspberry Pi, check out PiCoolFAN4/README.md.
- Raspberry Pi Health to Influxdb
- La Crosse Temparatur/Humidity to Influxdb via Jeelink
- this is tied to my sensors, you need to adjust the flows
- Xiaomi Mi Plant sensor data to Influxdb
- Inkbird sensor data to Influxdb
- Fritz DECT plug values to Influxdb
- Fritz DECT inject AINs for above flow
# topics for all monitored raspberry pis
/home/pis/<pi-name>/health
# miflora
/home/bluetooth/miflora
# inkbird
/home/bluetooth/inkbird
If influxdb cannot be started with some error like influxdb | run: open server: open tsdb store: lstat /var/lib/influxdb/data/db0/autogen/320: bad message
then check the hard disk.
Stop all services beforehand.
umount /mnt/pi1
sudo fsck /mnt/pi1
mount /mnt/pi1
<start services again>
Run docker-compose exec influxdb influx -precision rfc3339 -database db0
Then query around, e.g.:
SELECT * FROM "raspberries"
SELECT * FROM "lacrosses"
SELECT * FROM "miflora"
SELECT * FROM "miflora" WHERE "sensor" = 'Jasmin'
DELETE FROM "miflora" WHERE "sensor" = 'Wayne'
DROP SERIES FROM "miflora" WHERE "sensor" = 'Jasmin'
- https://www.docker.com/blog/happy-pi-day-docker-raspberry-pi/
- https://nodered.org/docs/getting-started/docker
- https://hub.docker.com/_/eclipse-mosquitto
- https://www.raspberrypi.org/documentation/configuration/external-storage.md
- eclipse-mosquitto/mosquitto#1078 (comment)
- http://nilhcem.com/iot/home-monitoring-with-mqtt-influxdb-grafana
- https://hub.docker.com/_/influxdb
- https://docs.influxdata.com/influxdb/v1.8/concepts/key_concepts/
- https://grafana.com/docs/grafana/latest/installation/configure-docker/
- https://flows.nodered.org/flow/05a76b25495eb8fd8d3082343f56c645
- https://serialport.io/docs/guide-installation#alpine-linux
- https://github.com/sysstat/sysstat
- https://community.grafana.com/t/how-to-make-one-live-dashboard-public/12819