I thought I’d document some stuff here on my openHAB setup, to help future guys, and also get some tips or suggestions from the community.
My name is Carel. I live in South Africa. I’m really interested in IoT and home automation, and thus I’m slowly automating and smartifying my existing house as I go.
So I’m running openHAB on a Raspberry Pi 2. I used the Openhabian installer, and it was a fairly straight forward installation.
For sensors I use Xiaomi Smarthome devices. Although they are very chinese, the sensors are of high quality, and I’ve not yet had issues with them.
For smart lights I’m using Xiaomi Phillips Bulbs.
I actually started out my beginner journey with smart home devices with a Xiaomi sensor set. It consisted of a Gateway device, which doubles as a small light, a smart plug, a motion sensor, an open/close sensor and a wireless switch.
This was my first real step into an actual smart home, and I had lots of fun playing around with the motion sensors, the wireless switch and the smart plug, turning things on and off.
I found openHAB when I started searching for a more customizable control centre. The Xiaomi devices does come with a surprisingly well-designed app on my devices, and the connecting of devices works well. But there were many commands, such as changing colors or brightness on the gateway light, or other timer-based events that I couldn’t do on the automation part of the Mi App.
I chose openHAB, because it already have working integration with the Xiaomi devices I had.
When I started using openHAB, I found it super nice to have a way to manually program rules. I am a programmer by profession, so having rules items set out in code actually makes it almost easier for me to understand what my system does.
Xiaomi and Aqara Smart Home
I won’t lie. I’m a big fan of Xiaomi’s home products. They are very well designed, looks very professional, and works out of the box as expected on most fronts. It feels a bit like a cheap version of Apple. All the packaging they use are very fancy, and it really is great to receive your set of sensors in a nice fancy box, everything packed neatly, with small instruction manuals (in chinese. =P) for each.
Since my first buy, I’ve bought several motion sensors, switches, door sensors, and another Gateway to cover more of my house. I haven’t regretted it, it really is cheap vs the prices of similar sensors that I can buy here in my country.
How everything works together
- Rasberry Pi 2 running openHAB 2.
- 2 Xiaomi Smart Home Gateways, both in the hallway of my house on two opposite ends, to cover most of the house.
- Many motion sensors, for both automatic lights, as well as alarm triggers.
- A few door and window sensors, mostly at doors and windows we open often.
- A few switches to control the smart lights
- One smartplug for my ‘clock radio’.
- 5 Xiaomi Phillips smart lights at this point.
- My hallway pretty much connects all the rooms in the house together, so the lights are always on at night until I go to bed. So I have two smart lights in hallway, that currently turns on at a specific time in the early evening.
- I have a smart light in my bathroom, and two motion sensors to cover the shower, as well as the main part of the bathroom. At night, if motion is detected, the light automatically turns on, and stays on as long as it detects motion. Numerous test found this to work flawlessly, and I haven’t had to switch the light on manually since. It detects me in the shower, and also if I just use the sink to wash my hands or something.
- A smart light in my toilet (which is separate from the bathroom). It is a small room, so one sensor easily detects motion, and keeps the light on until no motion is detected.
- My living room, which is essentially a ‘recreation room’ now, has a smart light as well. Motion sensors detect motion in the room, and turns on the light when motion is detected after a certain time in the evening. They then stay on until turned off. So if nobody enters the room at night, they stay off, saving me some power.
- I have a radio in my bedroom, that’s on a smart plug. It turns off at night when I go to bed, and turns on in the morning to wake me up. Its a over-complicated clock radio!
- Our 2 cats are kept inside at night, because otherwise they fight with other cats in our garden. To that end, we sometimes forget a window or a door open, and they escape again. Using open close sensors on doors and windows that we often open, I have a timed script that checks in the early evening if any doors are open, and alerts me on my phone which ones are open.
- Although not smart in itself, I have currently a wireless IP cam that points to my gate. I use the sitemap to display this camera in openHAB, allowing me access to the view of the camera through the app, saving me the trouble of having to use a different app in conjunction.
- I have a old tablet, which sits against my wall in a mount. It is permanently open on the openHAB app’s sitemap, essentially giving me control of my house and stuff even if my phone isn’t with me.
- I also have a single Google Home Mini device. Recently openHAB has been integrated directly with Google Home, allowing me now to control the lights in my house by voice, which is pretty awesome. Later I’ll have it arm and disarm my alarm, and other nifty stuff.
Stuff that isn’t working right
So there is a few stuff I’m trying that isn’t working correctly yet, and I’m working on it. =P
- I have ‘presence detection’ for me and other people that live and visit my house, using static ip addresses on my wifi using our phones, and the ping binding on openHAB. But sadly, this isn’t working as intended. My phone often disconnects from WiFi, presumably to save battery, which causes false positives to occur on presence detection. So I’m still trying to figure out how to reliably tell openHAB if specific people are present in the house.
- The Xiaomi motion sensors have a 1 minute delay after detecting motion to save on battery. This delay means that is the minimum amount of time a light needs to stay on, because I only know after one minute whether there is still someone in the bathroom. This delay is causing me some false positives, causing the light to stay on for 2 minutes+ even when I just enter to wash my hands, and exit within 30 seconds. I’m still working on some form of timer work-around for it.
- Logging persistance in charts. I can’t seem to get it to work, so still need to do some research…
These stuff is what I’m working on, as I buy more sensors and stuff each month.
- I found that using IFTTT and openhab’s mail feature, I can ‘take a photo’ from my ip camera, and essentially display it as a notification on my phone. My idea is to use a Xiaomi switch or other wireless doorbell to trigger a rule on openHAB that rings the bell on my Xiaomi Gateway’s speakers, as well as send me a notification of someone at the gate, with a picture of who it is. This of course means I can see people ringing my bell, even when I’m not there, which is pretty cool.
- My country’s crime rate is pretty high, so my next plan is to add many more motion sensors throughout the house, as well as more door and window sensors, and create a home alarm.
- When armed, the alarm will trigger on any movement or changes in the sensors, When triggered, I’ll have the alarm sounds from the gateway speakers (and hopefully later on an external speaker of some kind), turn on all the lights in the house, and also send a notification to my phone and all other devices connected in the house that indicates where the alarm triggered. I think this will be very useful in determining where the threat is, and act accordingly. Turning on the lights and sounding the alarm will hopefully scare off more adamant would-be robbers.
- Later I can also add some indoor cameras, and send a photo with the trigger notification to my phone.
- In South Africa, we generally have high walls and fences, as crime is somewhat of an issue here. Our gate is automated, and generally secure, but there are ways to lift it over the motor or open it by force. I’m thinking of adding a open sensor to the gate as well, that also triggers the alarm. This is much earlier than robber already being inside the house, and should give me ample time to react to any threat, if I am already alerted when they’ve just entered the gate.
Other fancy future possibilities:
- An automated voice intercom AI, that responds to people that rings the bell, asking them what their business is, and relaying the information to me via my phone or maybe through the Gateway Speakers or Google Home mini speaker.
- Add the ability for me to open my automated garage and gate through openHAB.
- Use image recognition software and a small camera on my gate, to allow me to ‘recognize’ number plates and notify me when specific owners of the vehicles stop at my gate.
- Use a smart mini weather station to give me realtime info about the weather, and send alerts if it is cold enough for a jacket, or if it is raining hard at my house.
I’m sure there are tons of other cool stuff one could do, I’m always reading up on what other people do in their homes.
Thanks for reading… =P