Smart Lights
So since most people start automation in the home with the most used thing - LIGHTS. My first automation post will be about my lights. So in my previous house, I did not want to fiddle with the house wiring, so I added 12 volt LED strip in every room, neatly in the corner with a wire running in the ceiling to an 8 channel relay board connected to a Raspberry PI. In the new house however, I have opted for smart switches instead. I am using the ITEAD Sonoff T1 US switches. I don't like the idea of my smart devices communicating with foreign cloud services. So I removed the Chinese branded eWeLink firmware and replaced it with open source firmware called TASMOTA.
All my devices in the house talk to a central system, again open source. My choice of system is OpenHAB. For all light switches that I replaced, there was a requirement for a neutral wire to be pulled down to each switch. This took some time to do, for a total of about 14 switches, but got it done after a few days.
Before installing any of the switches as mentioned above I removed the standard firmware and replaced it with an opensource firmware which is locally controlled. In order to change the firmware you will need a USB to Serial Flasher, make sure to use one that works on 3 volts, some of them can do 3 and 5 volts. Connecting 5 volts to these microcontrollers will give you a puff of the magic blue smoke out of your controller.
You will also need something like tasmotizer or now even an online flasher to flash the firmware. Unlucky for me, these tools did not exist yet, but the old school way still exists and you can also flash this using python commands in a terminal.
Once you have installed your lights, you need to create them as 'things' and 'items' in openHAB and then add them to a sitemap file which is the building blocks of the graphical interface. At this point your lights are controllable from an app or web interface. The automated part comes in once you start adding rules/automation either inside openHAB or a external system like Node RED. Some simple rules could be to turn certain lights on and off based on your geolocation sunset and sunrise times. Or room presense, if you enter a room turn the lights on or if you hade led strips that have a dimmer feature you can fade the lights out slowly around bed time. The automations are endless, its all up to your imagination.