Featured post

Welcome!

Quote-Open
Welcome to my site. I purchased a Raspberry Pi in the middle of 2012 when it came out. At first, I really bought it as a gadget, not really knowing what I’d do with it, but it really grew on me so I decided to keep a blog of my experiences with it.

The ultimate goal was for the Raspberry Pi to be the brain of an home automation setup. A lot has changed since then, with many components added or replaced, but the beloved Raspberry Pi still holds a central role and importance in my ever changing setup.

I’ll try and update this blog with any major update or addition, with as many details and references as possible, but feel free to poke me if you need any more details on a specific iteration.

I hope you enjoy reading this as much as I enjoyed writing it.
Happy reading!

Xiaomi Dafang Camera

I’ve recently purchased a Xiaomi Dafang Camera from GearBest. Why? Well it was cheap, 1080p resolution and has Pan-Tilt functionality as well as audio recording.

Xiaomi Dafang

Xiaomi Dafang

A couple of let downs however:

  1. The camera did not offer any RTSP streaming functionality (so not possible to use motion)
  2. The camera uploads the video feed to some server in China for the Xiaomi Mi app to retrieve

Not happy with either of the above, I started to look around for a solution and Elias Kotlyar managed to hack it to provide exactly what I was after.

I now have a camera that behaves like a “normal” CCTV camera via motion. I’ve also created a switch in Home-Assistant so as to enable motion detection video recording only when nobody’s home. Check my github page for more details.

In addition to the aforementioned standard features, Elias offered manual control of the LED so I can use this as a quick way of showing the camera status (on, off, motion recording enabled) My short term goal is to add MQTT to the camera to make it easier to control the LED and potentially the motors to pan & tilt. Longer term goal would be to get motion to control the pan-tilt functionality automatically. But that is likely to be a much more complex problem to solve, especially since motion documented that feature as “permanently at the experimental stage“…

The camera is however so good and cheap that I already bought another one 🙂

Watch this space…

Smart Christmas Baubles

Thanks to Gosse Adema and his instructable, I’ve also created smart Christmas baubles.

I currently have 3 baubles that I’ve connected to Home-Assistant, and I made some amendments to Gosse’s code to add MQTT Support (inspiration and code taken from corbanmailloux.)

You can get a copy of my code on my github page.

Here are some pics of my baubles:

Bauble1

Bauble1

Bauble2

Bauble2

Bauble3

Bauble3

Merry Christmas 🙂

Back-lit House Number

After the TV cabinet and the staircase, I got a new house number an LED treatment. Using the same H801, I glued a small piece of LED strip on the back of each number and set it in Home-Assistant to come up at dusk and switch off at midnight. I also set the colour to change through the colour spectrum so it’s less boring 😉

LED House Number

LED House Number

Since the picture was taken I’ve removed the “old” number 40 beside the doorbell…

CurrentCost Script

Until now I used DomotiGa to get the date off my CurrentCost EnviR energy sensor.

Since I’ve moved all my automations to Home-Assistant, the only bit that was not supported by HA was the CurrentCost device. I didn’t want to run DomotiGa just to get the data off the EnviR and then send it to HA via MQTT.

I’ve finally finished a script thanks to Robin Wilson that gets the EnviR data from the serial port and sends it to HA. DomotiGa can now truly rest in peace.

The final script is this one:

 

H801 LED Strip Controller Upgrade

While I’m perfectly happy with the H801 LED Strip controller’s abilities, there were a few niggles that I didn’t like:

  • The controller would always advertise as an access point, allowing “anyone” to connect as long as they knew the default SSID password (88888888)
  • Communication is 1 way with no feedback
  • The script I wrote to go through the colour spectrum was ran off the server and basically sending a command to the H801 over the WiFi network every 0.1 sec
  • I had to create an on/off switch as well as 3 sliders to select the (RGB) LED colour

Knowing the H801 is based on the ESP8266 chip and programmable, I looked for a better solution and finally settled on corbanmailloux solution for the following reasons:

  • The H801 is no longer an access point, making it more difficult to hack
  • it’s MQTT “enabled” and offers 2 way communication
  • It’s Home-Assistant compatible, and already includes support for RGB attributes via a colour picker and other effects
  • It already has the function to loop through the colour spectrum; actually it has 2 of them at different speeds, plus the possibility to time colour transitions and a flash feature, for notifications for example
MQTT JSON Light on Home-Assistant

MQTT JSON Light on Home-Assistant

I used the code off the mqtt_esp8266_rgb folder. The only things I had to change in config.h were:

  • LED colour pins to be compatible with the H801:
  • change the WiFi settings and the MQTT settings

Because I use cloudmqtt, I also changed the MQTT port in the main mqtt_esp8266_rgb.ino file:

I followed the instructions on corbanmailloux git page to install Arduino and the relevant libraries, and I used the esptool from micropython to upload the firmware

Goodbye DomotiGa, Long Live Home-Assistant

Following what I think is due to a general OS update, SmartVISU no longer connects to DomotiGa. I’ve tried to fix it, but I’ve thought for a while now to transfer everything over to Home-Assistant since support for IoT devices is much better and update are a lot more frequent

So I’ve finally taken the plunge. One of the main hubs that was used in DomotiGa was the RFXTrx433 Transceiver. I’ve disconnected it from DomotiGa and added it to Home-Assistant. I’ve spend the best part of 2 weekends and several weekday evenings recreating the devices and events that were in DomotiGa.

Home-Assistant Main Page

Home-Assistant Main Page

There’s still a lot of work to be done, but I’ve done the most important bits. I’ve also broken down the content on several pages unlike cramming almost everything in one page like I did in SmartVISU.

I’ve also used this an opportunity to save my config to GitHub for back up and in case it helps someone else.

The only thing I’ll be missing as not built-in is the data from my CurrentCost Sensors, but I’ll be running a light version of DomotiGa to send that data to my Home-Assistant setup.

Kello Smart Alarm Clock, Part 2

I’ve now had enough time to play with my Kello and I’ve done enough integrations to share some updates.

Now Kello doesn’t have an API per se, but there are a few commands that can be used to communicate with it.

This enabled me to created a Kello interface on Home-Assistant so I can control my Kello remotely. Bonus: I can even do this when I’m not home.

The main interface is this one:

Kello on Home-Assistant

Kello on Home-Assistant

And here are some of the functions that I’ve achieved:

  • When I stop the alarm, I then get greeted with the weather forecast for the day as well as estimated time to go to work
  • I can play various radio stations, change the volume
  • If for any reason the Kello loses WiFi connection, I get a notification email
  • When I leave home, or when I set the house mode to “Holidays”, all alarms get deactivated
  • When I reach home or when the house mode is no longer set to “Holidays”, all alarms are enabled

 

Here is a list of the commands I used to achieve the above:

Volume:

Where xx is the volume in hex (Dec from 0 to 100, so 0x00 to 0x64 in hex)

 

Muting all Alarms:

 

Unmuting all Alarms:

 

Play (online) Media:

 

Stop Media:

 

And don’t forget the IFTTT Integration for more automation, check my previous post on how do to this.