GithubHelp home page GithubHelp logo

home-monitoring-stack's Introduction

home-monitoring-stack

Home Monitoring and Automation

Home Monitoring and Automation is an ansible provisioned, docker-compose run stack of images for monitoring and automation.

Monitoring and Visualization

  • House Monitor Sub is used to subscribe to an MQTT with Tasmota sensor devices and publish them to Timescale.
  • Grafana is used to visualize data within Timescale

Automation

  • Node Red is used for automation, typically via MQTT

Required Tools

  • terraform

Deployment Targets

This has been run and tested against on a Raspberry Pi 4B running Ubuntu Server 22.04. In theory, this should run against any target with comparable specs and configuration. If run against a "cloud" target, it might be worth refactoring to make setup.sh run as part of cloud-init.

Configuration and Deployment

This stack is designed to run locally but with some changes can likely be made to run a remote, cloud based solution (e.g., AWS EC2 or DigitalOcean droplet).

Preqrequisite

home-monitoring-stack is designed to be deployed by terraform and remotely run ansible to provision the machine. All configuration files are copied over via a ssh terraform provider. As such, if running locally, it is necessary to do minor configuration ahead of time.

These prerequisite steps must be performed before attempting deployment

Machine Hostname and User

  • Set hostname and user of machine being provisioned in main.tf locals block
    • local_hostname
    • local_user

Local Machine Configuration

  • Generate a new ssh key for use with terraform and install on the remote machine. See ssh-copy-id for more information.

    • It is imperative you keep the remote key for now; this is used for all future deployment
  • Configure the user for passwordless sudo. See this for more information

Terraform Configuration

It is necessary to change the terraform backend (in backend.tf) to reflect your terraform backend; home-monitoring-stack by default uses Terraform Cloud but any backend should work.

Terraform Cloud

Login via terraform login and follow the directions prior to initial deployment.

Terraform Variables

The following terraform variables are required for deployment:

  • local_private_key - This must be the contents of the private key generated in the earlier prerequisite configuration. This can be stored in an environment variable.

  • postgres_password - Postgres password used by Timescale database.

It is recommended these values be stored in a .env file to be sourced and provided by environment variables prior to deployment. This can be done by prefixing TF_VAR_ to the terraform.

Example:

export TF_VAR_local_private_key=""
export TF_VAR_postgres_password=""

Stack Configuration

Some aspects of the deployed configuration can be configured via the locals block in main.tf:

  • ports
  • directories (both for mounted volumes and for configuration directory)
  • docker image versions

Deployment

Once the prerequisite configuration, terraform configuration configuration and terraform variables are available and any optional changes made to the stack configuration, terraform deploy can occur

terraform init
terraform deploy

home-monitoring-stack's People

Contributors

jspaulsen avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.