Coder Social home page Coder Social logo

mqtt-alarm-server's Introduction

MQTT Alarm display - Server Component

This is the server side component of the esp8266 mqtt alarm display. It listens on a MQTT topic for authentication requests and adjusts the home assistant manual mqtt alarm panel accordingly.

If the UID and the passcode match a person in the yaml configuration file and this person is allowed to manage the alarm in the current timeslot, An certain action is triggered, depending on which request was performed on the mqtt alarm display.

Example

OK:

    DISPLAY: home/alarm/rfid {"hostname":"alarmdisplay1.home","uid":"12AB34","code":"1234","action":1}
    SERVER:  home/alarm/display/alarmdisplay1.home {"access": "GRANTED", "name": "Flip", "uid": "12AB34"}
    SERVER:  home/alarm/set DISARM
    HASS:    home/alarm disarmed
    SERVER:  home/alarm/display disarmed

NOK:

    DISPLAY: home/alarm/rfid {"hostname":"alarmdisplay1.home","uid":"12AB35","code":"1234","action":1}
    SERVER:  home/alarm/display/alarmdisplay1.home {"access": "DENIED", "name": "unknown", "uid": "12AB35"}

Setup

Install

Clone repo, create a virtualenv and install mqtt_alarm_server and its requirements:

    git clone https://github.com/fliphess/mqtt_alarm_server.git && cd mqtt_alarm_server
    mkvirtualenv -p "$( which python3 )" -a "$( pwd )" mqtt_alarm_server
    pip install .

Or in short:

    pip install git+https://github.com/fliphess/mqtt-alarm-server.git

Configure

Copy the config file and adjust the settings

    cp settings.yaml.example settings.yaml && vim settings.yaml

Run

Run the server:

    mqtt-alarm-server -c settings.yaml -vvvv

Concerns

As the passcode and the uuid of the card are send in plaintext from the display to the broker, most of the security concerns lie in that part of the setup. The server uses ssl to connect to the broker which should suffice.

As soon as there is a convenient, non-crashing ssl library for the esp8266, I will implement this on this side of the chain as well.

mqtt-alarm-server's People

Contributors

fliphess 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.