mkluge / iot_control

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Connect your IoT devices

This project provides a framework to easily connect IoT devices (sensors and switches) with different backends. It allows to include more backends and devices.

Supported devices:

  • BME280 sensor: humidity, air pressure, temperature
  • ADS1115 sensor: analog digital converter
  • BH1750: illuminance
  • Raspberry PI GPIO switches: drive GPIO pins on the raspberry pi. To actually drive the pins you need to use the mqtt-hass backend.
  • Shell command switches: run shell commands when a switch is clicked in Home Assistant. Has an 'on' and an 'off' command.
  • Raspberry PI cover for garage doors or covers as defined by Home Assistant. It uses two input pins to detect the closed or opened state of the cover and one output pin which triggers a pulse so that the garage door motor is put into action.

Supported backends:

Backends can set and read states if the functionality of the software used provides this. Pure database backends like influx will only store the values from the sensors.

Prerequisites

  • Install .deb packages: 'sudo apt install python3-yaml'
  • Install PIP packages: 'pip3 install smbus2 RPi.GPIO rpi.bme280 paho-mqtt influxdb'

Hint: On Raspbian GNU/Linux 9.13 (stretch) don't use the .deb package 'python3-influxdb' but the much newer pip3 package 'influxdb'

How to get started:

  1. Get some sensors and a small device to run the sensors on. The device should be able to run python.
  2. Make sure you habe a suitable backend that will store the data or interact with the sensors. That's why you are here, right? So maybe you have an Home Assistant installation already. Then please check that mqtt is enabled. Otherwise: get one or get an InfluxDB instance.
  3. Clone this project at the device and copy the example setup to a setup.yaml and edit the content of the setup file according to your needs.
  4. Run rooftop.py. Maybe with a screen session, but much better as a service (via systemd).

I need support for more backends and more sensors

Send me a message, I'll write this when its needed. It should be easy to add more of both kinds.

About

License:GNU General Public License v3.0


Languages

Language:Python 99.9%Language:Shell 0.1%