Giter Club home page Giter Club logo

rburkholder / apparition Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 1.46 MB

Home/Office Automation/Monitoring - listens on MQTT topics, uses LuaJIT to decode and respond back via MQTT. Current examples work with ZWave, ZigBee, RTL433, UPS-NUT,... Metrics are emitted to Prometheus for display with Grafana

License: GNU General Public License v3.0

CMake 0.45% C++ 33.19% Lua 13.11% CSS 21.27% JavaScript 31.70% Shell 0.28%
home-automation mqtt yaml lua luajit cpp20

apparition's Introduction

Apparition - Home/Office Automation/Monitoring

an immaterial appearance that seems real, and is generally sudden or startling in its manifestation -- something akin to what a monitoring and automation solution may appear to be

The philosophy with Apparition is to compose an automation/monitoring/alert tool from a series of mature packages, all integrated under one roof. The tool should work in the background and only manifest itself when needed.

Functionality:

  • C++ core for coordinating the subsystems
  • Lua scripting to handle parsing, variable aggregation, and event handling
    • Scripts can be live edited without restarting the application
  • Current implementation sensors decoded & controlled via Lua:
    • zwave controller via Zooz & Z-Wave JS UI (MQTT)
      • Honeywell Thermostats
      • GIG Thermostats
      • Zooz Scene controllers controls lights
      • New-One metered smartplug
      • smoke alarm
    • zigbee controller via Sonoff & Zigbee2MQTT (MQTT)
      • Philips Hue lights
      • PIR sensors
    • RTLSDR 433Mhz & 915Mhz radios (MQTT)
      • EcoWitt WS90 Weather Station
      • DSC PIR, Door, Smoke alarm
      • Thermopro temperature/humidity
      • Neptune water meter
    • BeagleBoard BME 680 (MQTT)
      • temperature, humidity, pressure
  • Time series data sent to Prometheus for efficient recording
    • over 120 time series currently collected so storage efficiency is important
  • Grafana tied to Prometheus for dashboards and charting
  • A simple web dashboard with current values

Operation:

  • update the var/apparition.cfg with your specific requirements
  • start the application using ./var as your working directory

On the immediate todo list:

  • dashboard updates:
    • organize devices & sensors logically - defined by Lua config statements
    • control devices using widgets - triggering Lua control scripts
  • provide persistence via an attached database, probably sqlite
  • embed charts of prometheus data in dashboard
  • improved recovery from failed scripts
  • add time-of-day and recurring events

Order of install:

Proposed tooling:

  • C++20 as primary backend
    • boost - use my libs-build library to bulid and install
      • asio - signals, network
      • beast - REST, WebSocket
    • jwt-cpp, cpp-jwt - consideration for javascript websocket tokens
    • paho mqtt - simplified installation via Debian package repository
    • wt - server side REST/UI
    • yaml - YAML in/out for config files
    • Candidate embedded scripting language:
      • Duktape - embeddable ECMAScript® engine with a focus on portability and compact footprint
      • LuaJIT - Just-In-Time Compiler for Lua - currently in trials
  • Bootstrap - web page dynamics
  • Node-RED - visual event editor, used in addition to the embedded scripting language
  • Prometheus - time series open-source systems monitoring and alerting toolkit
  • Grafana - data visualization aka visibility stack
  • RabbitMQ / MQTT - event backbone
  • Rhasspy - Offline voice assistant docs
    • ESP32-Rhasspy-Satellite - esp32 standalone MQTT audio streamer. Is is desinged to work as a satellite for Rhasspy
    • Snips - a software solution powering Private-by-Design voice assistants

Thoughts influencing the design & implementation of this solution:

  • config is supplied through a series of yaml files, which are primarily used to load scripts and attach the scripts to mqtt events
    • system configuration is thus easily version controlled, replaceable, and reproducible
  • Prometheus supplies time series collection & management for historical review. It offers compaction, particularly needed for sensors, such as the Ecowitt WS90 which issues multiple variables every 8 seconds or so.
  • scripting language provides a rich set of interactive text based scripting capabilities for handling events, triggers, and logic
  • MQTT broker to act as a backbone for messaging between sub-systems
  • some draw backs of other solutions:
    • Home Assistant has a rather rigidily enforced installation if you want the base plus the store. Plus there are comments that breakage occurs frequently during release cylces.
    • Domoticz is totally self contained and fast. But it is missing certain signals such as the operational state of a thermstat. The charts, based upon my limited experience, are not very informative.

apparition's People

Contributors

rburkholder avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

zhouji0212

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.