Skip to content

Instantly share code, notes, and snippets.

@HarvsG
Last active January 28, 2020 12:39
Show Gist options
  • Save HarvsG/73a20ad519077e771927306fa4675833 to your computer and use it in GitHub Desktop.
Save HarvsG/73a20ad519077e771927306fa4675833 to your computer and use it in GitHub Desktop.
An untested ideas list for how to set up a raspberry pi as a hub for home automation.

Home Automation

Install the required software

As per this tutorial or this one

Install the IOTstack: git clone https://github.com/gcgarner/IOTstack.git ~/IOTstack

To start the Menu cd ~/IOTstack ./menu.sh

After you install Docker and you have chosen anything from the Menu - type: docker-compose up -d

This will download the Docker images from Internet and will install them on your Raspberry Pi. Depending on how many containers you selected and your internet connection speed this can take a while.

Big shoutout to Graham Garner and his great work on Docker IOTstack which is just perfect for getting started with IoT and Smart Home on Raspberry Pi. All the credits for the menu creation goes to him. This is the link to his Github repo - https://github.com/gcgarner/IOTstack

Portainer URL: YOUR_RASPBERRY_IP:9000

Node RED URL: YOUR_RASPBERRY_IP:1880

Grafana URL: YOUR_RASPBERRY_IP:3000 Default Credentials: username: admin password: admin Then you have to change your password

Mosquitto To enter inside the Mosquitto container execute:

docker exec -it mosquitto /bin/sh

or

./services/mosquitto/terminal.sh

Then run the following command:

mosquitto_passwd -c /mosquitto/config/pwfile MYUSER replacing MYUSER with your username.

It will then ask you to type your password and confirm it. To exit the container’s shell type:
exit Edit the file below and remove the comment in front of password_file

services/mosquitto/mosquitto.conf

Restart the container either from Portainer or with the command:

docker-compose restart mosquitto

Then you can use these credentials in Tasmota, Node-RED, Home Assistant etc.

Home Assistant (HASSIO) URL: YOUR_RASPBERRY_IP:8123

InfluxDb Default Credentials:

  username: nodered
  password: nodered

To enter inside the InfluxDB container execute: docker exec -it influxdb /bin/bash or

./services/influxdb/terminal.sh

Using the CLI inside container you can type the following To create mydb Database: CREATE DATABASE mydb

To show all available Databases:

SHOW DATABASES

To connect to mydb Database:

USE mydb

To insert a single time series data point into InfluxDB, enter:

INSERT cpu,host=serverA,region=us_west value=0.64

To retrieve data from the database

SELECT "host", "region", "value" FROM "cpu"

Pi-Hole URL: YOUR_RASPBERRY_IP:8089/admin Default Credentials: password: pihole Then you can change the password by editing the following file:

~/IOTstack/services/pihole/pihole.env

Portainer URL: YOUR_RASPBERRY_IP:9000 Default Credentials: You will be asked to choose a password

OpenHAB URL: YOUR_RASPBERRY_IP:8080 YOUR_RASPBERRY_IP:8443 for HTTPS.

Plex media server URL: YOUR_RASPBERRY_IP:32400/web Info: Follow the instruction from rasp pi docs to mount your external drive to /home/pi/mnt/HDD in you fstab. Edit your docker-compose.yml file under plex and uncomment the volumes for tv series and movies Run docker-compose up -d to rebuild plex with the new volumes

Log2Ram Execute the following commands to ensure that this is working. They have to return some lines

df -h | grep log2ram
mount | grep log2ram

TasmoAdmin URL: YOUR_RASPBERRY_IP:8088

Intergrate services

Use the home assistant --> google assistant intergration found here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment