Skip to main content

Smart Home Project (Updates)

The project has reached an operational stage with the following milestones.

The original posts can be found at
Starting a smart home project
Smart Home Design V1

The Smart Home is controlled by Openhab2 using a Raspberry PI. After some initial instability, the system finally is able to be functioned smoothly. The main control panel is Habpanel and a sample of the main dashboard is as shown.


Habpanel is one of the official UI supported by Openhab. It comes with some pre-defined widgets such as buttons, frames etc. For the pictures above, some of the widgets are custom widgets created by third parties such as the column of sliding switches, presence detection panel and the fan control panel. User can easily extend habpanel widgets because the widgets are written in AngularJS.

There are 5 main types of communications protocols:

1. WIFI
This is the main backbone used by all the devices.
2. Zigbee
This is mainly used by Xiaomi sensors.
3. RF 433 MHz
This is used by the ceiling fans, doorbell and remote switch.
4. Infrared Red
This is mainly used by Air Conditioning control.
5. Bluetooth Low Energy (BLE)
This is used by Xiaomi plant care, switch bot and Xiaomi temperature sensor.

MQTT is the main communication protocol used for the switches. I am using Xiaomi sensors such as temperature/humidity, PIR motion sensor and Door Switch (to detect door opening).

The following are the home appliances which integrated with Openhab2.

Google Home

Some of the switches can be controlled using the Google Home Assistant. To set this up, I have to first sign up an account with myopenhab.org and then linked up my Google account with Google Home Assistant.

The details on how to set up can be found at Openhab forum. For the future phase of the project, I will plan to have my personal myopenhab server that connects to my Google Home assistant.

Sonoff Switches and Power Plugs flashed with Tasmota firmware

This is the main portion of the Home Automation controls. All the light switches are controlled using Openhab2. There are 1,2 and 3 gang switches and all the switches are flashed with Tasmota firmware.

RF Fan

The Sonoff RF bridge can decode the signals for the RF fan. The RF ceiling fans are controller via the Sonoff RF 433 bridge.

Panasonic TV

Panasonic TV control is one of the bindings provided by Openhab. The binding is unable to turn-on the TV so I have using WOL (wake-on-lan).

miIO using Aqara aircon companion for Mitsubishi Aircon

The binding officially did not support this control. For all the IR key,  I will need to manually learn the IR command. This is not very efficient and unstable. I have changed this to use Aqara aircon companion. This is still not supported by Openhab binding. I have downloaded the source code from rytilahti python-miio.

miIO Binding for Xiaomi Air Purifier

The official binding can support this device. Besides turning on/off, I can obtain the purifier's temperature, humidity and PMI sensors values.

Xiaomi Plant Care

This is plant care from Xiaomi which can measure soil moisture, fertility, ambience light and temperature. I have written a blog post comparing the International and Chinese version. This sensor communicates via bluetooth and I installed on a small Raspberry PI zero this software to obtain the sensor data to send via MQTT.

Xiaomi Multifunction Gateway

This gateway is used to control all the Xiaomi sensors and switches that work on Zigbee protocol. Openhab has native support for this 

Comments

Popular posts from this blog

Using ESP-Link transparent bridge (ESP-01 and Arduino Pro Mini)

Recently stumbled across an interesting open source project ESP-Link. Its main purpose is to network-enable a non-network microcontroller (MCU) such as Arduino Uno, Pro mini or Nano using ESP8266. The author termed it as "Transparent Bridge". The ESP and MCU  communicate via the serial link and there is a companion Arduino library EL-Client for the MCU to connect up the network using MQTT, REST, TCP and UDP.
Setup I have put together an ESP-01 and an Arduino Pro Mini for this experiment. I have chosen a 3.3 version Pro mini so that I do not need to do any voltage level shifting between the I/O pins. In order to have a stable voltage source, the ESP8266 is powered by Pro Mini and the Pro Mini "RAW" pin is connected to a 5v USB power source. The RAW pin can take voltage up to 12V. The reset pin of Pro Mini is connected to GPIO 0 of ESP-01. This enables the ESP-01 to reset the Pro Mini.




I have linked up an APDS 9960 sensor to it and periodically send the luminosity a…

DIY Sonoff RF Bridge

Tasmota recently supported the RF bridge by iTead which allowed for RF 433 remote devices to be controlled/controlling using Sonoff products. e.g A handphone can be used to control a remote RF device or an RF remote control can use to control a WIFI enabled device.

By using Tasmota, I can control the device using MQTT. This idea fits exactly to my smart home plan. Here is the schematic:



I cheated a bit by having ESP01 mounted on a breakout board. This breakout board converts all the external pins to 5v which simplified the wiring and I do not need to use a voltage level shifter. Moreover, the Arduino 3.3v power does not have enough current to power the ESP reliably and I have to power it via the 5V from Arduino Uno. Next, I used an Arduino Uno prototype shield with a tiny breadboard to hold all the components together. For the RF 433 transmitter/receiver, I am using the development kits when I purchased the all-in-one Arduino development kits. An antenna is added for more sensitivity.



Using ESP-Link transparent bridge (ATmega2560+ESP8266 board)

[Update: I have created a touch control panel to control my smart home using this board and ESP-Link.[

I have found this interesting board selling on Aliexpress website. It is an Arduino Mega 2650 with a built-in ESP8266 which allows the Mega to connect to wifi. This board has cut down a lot of wiring and bring out interesting possibilities. One of this is to connect up both the microcontrollers using ESP-link firmware. I have an earlier blog post that described how to wire up an ESP-01 and Arduino Pro Mini.



One of the tricky parts in this setup is the sequence of flashing the ESP firmware. Flashing the onboard ESP8266 requires some setting changes to the dip switches. The following are the sequences which I get both the microcontrollers to talk to each other.
Set the jumper 5,6,7 to ON and the rest OFF. This will set the ESP to update mode.I am using version 3.0.14 and flashed the ESP using the following parameters:
esptool --port com26 --baud 230400 write_flash -fm dio -fs 4MB -ff 80…