Skip to content

dan-cristian/haiot

Repository files navigation

haiot

Home Automation & Internet of Things

Overview

With Haiot you can control a huge number of sensors and devices in your house (and not only), setup automation rules and visualise sensors and control the system via Web and Mobile interfaces. It integrates with Openhab via Mqtt. The application currently covers the following automation scripts in my house:
- Heating control (with multiple sources: gas, solar)
- Ventilation systems (Interface with Atrea Duplex)
- Alarm sensors (PIR)
- Motion sensors (IP cameras via motion)
- Watering system
- Audio control via MPD (Interface with Yamaha RX-Vx700 via RS232)
- Gates opening/close control
- Electricity usage monitoring and grid export control function (Qubino, Shelly3M)
- Presence monitoring (wifi, bluetooth)
- Location tracking
- Solar production tracking (APS Microinverters / ECU, Sonoff POW)
- Solar excess export divert to water heater (via ESP8266 PWM and SSR relay)
- Solar excess divert to battery charger (via DROK 720W Buck Converter)
- Battery BMS monitoring integration via bluetooth (SmartBMS)
- TV control (LG RS232)
- Air quality monitoring (PM2.5, CO2, VOC, O3 sensors)
- Dashboards and UI control with OpenHab and Grafana/Influxdb
- and many more

System modules

Application is split in modules, each with a set of features. Modules can be enabled or disabled.

admin (mandatory)

This is a mandatory module that includes db setup, thread pool and events processing System configuration via a web interface, accessible usually at http://localhost:5000/admin/modules

mqtt_io (mandatory)

Module used for communication with other application modules

health_monitor

Monitors CPU , memory usage, hard drives temperature, disk health

webui

Web interface to manage the application

node

Cluster capability, multiple nodes can run at the same time with failover capability enabled

sensor

Monitors 1-wire sensors based on owserver and RFXCOM compatible sensors. RFXCOM device tested is RFXtrx433.

alarm

heat

Heat control

relay

Turns on and off relays

Target Platforms

- Linux (tested mostly with Debian) - Windows (tested with Windows 8.1

Application was tested on:

- Raspberry Pi (all versions) - Beaglebone Black - Debian (Openmediavault based install) - OpenWrt/Linaro GCC 4.8-2014.04 r42625 ( - Windows 8.1 64 bit

Supported sensors

ESP8266 with Tasmota: Sonoff, Wemos D1 Mini zWave (Qubino and other power meters) 1wire (temperature, humidity, etc)

How to setup the application

General prerequisites:
- python 2.7 - several python packages listed in requirements.txt - connection to a mqtt server, tested with mosquitto

Specific prerequisites for Windows 8.1

  • hdparm
  • smartmoontools
  • bash, nohup, sudo Ensure hdparm.exe and smartctl.exe are added in the PATH

Specific prerequisites for Linux

  • Enable sudo access for hdparm and smartctl
  • virtualenv usage recommended
  • for pyserial, set access rights to open /dev/ttyUSBx device: sudo usermod -a -G dialout $USER

On Linux, grant execute rights and run setup.sh.bat. This will install virtualenv and setup a python venv context with all required packages

How to start / stop the application

Run startserver.sh OR python run_all.py Run stopserver.sh to stop the application

Startup parameters

- db_disk or db_mem parameters specify where the database file will be created. for db_disk option, db is created in the current path. for db_mem option, db is created in /tmp folder, on constrained devices (PI, BBB) this is usually mapped to ramfs. Note that db content will be lost at restarts if db is created in ram - model_auto_update, automatically updates db schema if changes are detected (implies drop tables and default values)

Other packages used

https://github.com/woudt/pyRFXtrx

Many thanks @Jetbrains for providing a full license for PyCharm Professional!

About

Home Automation & Internet of Things

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages