Configuring a Raspberry Pi

Configuring a Raspberry Pi

Supported Hardware

Supported Features

graph TB subgraph Home Network hubitat[Hubitat Elevation] bridge[Hue Bridge] hue[Hue Devices] zwave[Z-Wave Devices] subgraph Raspberry Pi nodered[Node-RED] zstick[Aeotec Z-Stick] mosquitto[Mosquitto] nodered == OpenZWave === zstick nodered == MQTT === mosquitto end more[more devices] hubitat == "MQTT" === mosquitto nodered == "Hue API" === bridge bridge -. Zigbee ..- hue zstick -. Z-Wave ..- zwave hubitat -.- more end subgraph Phone 1 dashboard1[MQTT Dash App] location1[Life360 App] end subgraph Phone 2 dashboard2[MQTT Dash App] location2[Life360 App] end life360[Life360 Service] dashboard1 == MQTT === mosquitto mosquitto == MQTT === dashboard2 life360 -. "presence API" ..- hubitat life360 -. "mobile location services" ..- location1 life360 -. "mobile location services" ..- location2 classDef feature fill:#ffaaff,stroke:#000000,stroke-width:1px class nodered,mosquitto,zstick feature

  • Secure remote access over the Internet
    • Public DNS name
    • Encrypted communications
    • Password protected
  • Web server
  • MQTT broker
  • Home automation server (i.e. Node-RED which is one of Raspberry Pi’s recommended software applications, i.e. installed by default in the “full” version of Raspbian)
  • Z-Wave controller
  • DLNA media server
  • SMB file server
    • exfat filesystem support

Configuration Scripts

Script Usage Description
config-duckdns.sh ./config-duckdns.sh -d DOMAIN -t TOKEN Set up dynamic DNS using domain name and access token from Duck DNS
config-apache2.sh ./config-apache2.sh Install Apache server
config-certbot.sh ./config-certbot.sh Install certbot certificate into Apache web server
config-mosquitto.sh ./config-mosquitto.sh Install mosquitto MQTT broker
config-openzwave.sh ./config-openzwave.sh Install the OpenZWave driver library
zstick-configtty.sh ./zstick-configtty.sh -v VENDOR -p PRODUCT -n NAME Configure udev to give a predictable name to a USB Z-Wave controller using information obtained via lsusb
config-dlna.sh ./config-dlna.sh Install and configure minidlna media server
config-samba.sh ./config-samba.sh -u USER -p PASSWORD Install and configure samba file server
config-exfat.sh ./config-exfat.sh Install exfat file system support via exfat-fuse
automount-exfat.sh ./automount-exfat.sh -d DIRECTORY -u UUID Mount an exfat drive automatically using the UUID displayed by blkid
config-docker.sh ./config-docker.sh Install and configure Docker container engine
config-emacs.sh ./config-emacs.sh Install and configure emacs, markdown-mode and pandoc

Note that the same techniques illustrated by these scripts can be extended to support other dedicated home automation services such as OpenHAB, Home Assistant etc. This is the main purpose of installing Docker

Additional Information

Minimum requirements for a home automation (or any other kind of) server with out-of-home access are:

  1. Enable remote access over the Internet using dynamic DNS
  2. Secure access using TLS (“https”)
    • See Apache to install the Apache web server software
    • See certbot to obtain a free, automatically renewing certificate and install it

Additional features for common home automation scenarios:

  1. See Mosquitto to install a MQTT broker
  2. See Node-RED for securing your Node-RED instance for remote access of the Internet
  3. See OpenZWave to use your Pi as a Z-Wave controller hub

Obviously, a Z-Wave controller is only necessary if you want to control Z-Wave devices. Similarly, the OpenZWave library is only required when using your Pi as a native hub by way of, for example, node-red-contrib-openzwave-am or via native support for OpenZWave in a product like OpenHAB. If you don’t care about Z-Wave or have a dedicated Z-Wave hub like Hubitat Elevation or Samsung SmartThings then there is no point to having a Z-Wave controller device attached to your Pi but you may still find Node-RED useful as a better automation engine than those built into stand-alone hubs. See https://gitlab.com/kirkrader/nodered for information on such scenarios.