
How I automate my home - zcbenz
https://japaniot.github.io/2020/01/01/how-i-automate-my-home-en/
======
StavrosK
Whenever I read any post about home automation, it might as well be talking
about a completely different world from mine. I've automated a lot of my house
using pretty much just FOSS solutions. The Sonoff series of switches/devices
is fantastic and ESP8266-based, so you can flash it with any firmware you
want[1]. I wrote a small ad-hoc server to orchestrate things like "when
there's motion in that room and it's dark, turn on that lamp", but you can
just use Home Assistant.

I have a WiFi network that has no internet access where all these go, with
access to a local server running an autoupdater[2] so I can just put the new
firmware in a specific directory and all my devices autoupdate.

All of my devices are FOSS so I know they aren't talking to a mothership, and
even if they tried to, they can't get on the internet. I do have an Alexa,
which I should get rid of, since it's pretty much barely only useful for
playing music.

This way is much more secure, companies can't spy on your house, and you're
supporting user freedom.

[1]:
[https://github.com/xoseperez/espurna](https://github.com/xoseperez/espurna)

[2]: [https://gitlab.com/stavros/espota-
server](https://gitlab.com/stavros/espota-server)

~~~
mister_hn
Do you know any FOSS camera?

~~~
StavrosK
Yes, I got the Xiaomi Dafang something, there's a FOSS firmware you can flash
onto it that's quite good. Not great, but I haven't found any camera with
great firmware, open or not.

------
lurquer
I just have my kids do stuff.

"Water the yard!"

"Turn off that light!"

"Change the channel!"

"Go get the mail!"

Simple. Fairly reliable. Best DIY project the wife and I have ever done.

~~~
kingosticks
Really, really expensive solution.

~~~
jlgaddis
Not only that, you're forced to support it for (at least) 18 years after the
last version is released.

Requires a lot of maintenance the first few years especially!

~~~
Wistar
... with nearly continuous updates.

~~~
kohtatsu
Some not by you!

------
pickledish
I dunno, I find it pretty hard to get on board the home automation train. I
feel like, working in tech, we know better than anyone else how incomplete or
unreliable these systems can be, so why introduce it to your home? Why replace
your plain old metal kettle with a fancy smart-kettle that you can turn on
with your Alexa, but would easily crap out on you if your Internet goes down,
or some circuit breaks, or Amazon's API starts being flaky, or you lose
electricity in your home? Shouldn't we be a little more worried about
introducing this kind of extra complexity into our lives?

(^ these aren't meant to be sassy rhetorical questions, I'm genuinely curious
if everyone else just views this a different way than I do)

~~~
wayoutthere
There’s another part that people forget: analog tech is nigh bulletproof. Your
$50 smart light switch may last a decade or more, but a $0.50 analog light
switch will last a century. The extreme difference in cost often leaves you
with something that is worse in the long run.

Agree about the complexity as well. Analog circuits don’t have an API that
changes every few years — a modern 3-way light switch circuit would be easily
understood by an electrician from 1920 (and vice-versa). Good luck doing that
with Lutron gear from a decade ago.

I probably dropped $5k on home automation stuff. While I could afford it and
it was partially a research project, the main lesson I learned was that home
automation is generally more trouble than its worth at any price. Sure, it’s
great that I can tell Alexa to turn my lights off, but I also have to make
sure that the 3 services required to make that work remain talking to each
other. I would cumulatively save more time by just walking downstairs to turn
the lights off.

~~~
ghaff
I use Alexa for one light that never got connected to a light switch. I used
wireless X-10 for it previously :-)

I agree about reliability. It's one reason I won't get a Nest thermostat. I
live in snow country and I'm not going to do _anything_ that potentially
introduces a new failure mode into my heating system.

(I actually have a couple of the Nest smoke detectors. The internet connection
isn't required for them to function as dumb detectors and they work well in my
experience.)

~~~
jld
An internet connection isn’t required for the Nest thermostat to operate the
furnace either.

I can appreciate not wanting to allow Google the opportunity to brick your
thermostat (and hence your furnance) through some kind of software issue but
if you’re willing to extend that faith to their smoke detectors, why not your
furnace?

~~~
ghaff
I guess my feeling with the smoke/CO detectors is that I also have other
"dumb" models throughout the house. Furthermore, a thermostat needs to work
basically all the time at certain times of the year, whereas the detector only
needs to work when there's something to detect. I guess Google could silently
brick them and I'd never know about it but that seems to be getting into
paranoia territory. (And it's not like other detectors can't silently fail
too.)

It's probably paranoia about the thermostat too TBH. But other than looking
cooler than my old programmable Honeywell, a Nest thermostat also wouldn't
really do anything for me anyway.

~~~
wayoutthere
Yeah, the Nest was ahead of its time in 2010; but by 2012 the big players like
Honeywell and Carrier had caught up. At this point they beat Nest on both
price and features. A good friend of mine owns an HVAC company and would
recommend a dozen thermostats over a Nest on functionality alone.

------
ashleyn
As a security-conscious professional, and home automation enthusiast, I'm
profoundly disappointed that HA's ultimate commercial breakthrough was
accompanied by proprietary vendor lock-in and insecure "cloud" strings
attached (looking square at you, Alexa).

~~~
JshWright
While that's true, we've also seen huge growth in stuff like Home Assistant,
which goes a long way towards returning control to the user. Home Assistant
integrates with the locked-in systems where possible, but also makes it easy
to integrate local-only options.

It's definitely a small drop in the home automation ocean, but it's a healthy
ecosystem, available to anyone that wants to use it.

------
twblalock
In the past year I have probably spent no more than a couple of minutes
thinking about my light bulbs, my smoke alarms, my door locks, etc. They just
work.

It seems like home automation has a lot of advantages but it would also
require me to spend time on it (which products to buy, how to secure them,
dealing with malfunctions, upgrades, batteries...), which probably amounts to
an overall net loss of quality of life.

~~~
hnuser123456
I live in an apartment, so I can't install ceiling lights. I'd have to hit ~8
switches on walls and lamps to fully illuminate my place. If I had smart
bulbs, I could use one switch, or a voice command. I guess this isn't a
problem if you already have a house and are free to wire it up intelligently
to begin with.

~~~
fbernier
Precisely. I recently stripped out my apartment (that I own) completely and
redoing the electrical wiring and I have zero interest in installing smart
stuff. I just have 4 dimming switches all next to each other that control all
the zones, at both ends of the apartment. I can't understand how home
automation would improve my quality of life if you factor in the added
complexity.

~~~
rhinoceraptor
It's nice to have an automation to turn off all the lights for bedtime when
you live with people who routinely leave the basement lights on, for example.

------
brenden2
I really prefer using physical analog light switches that don't require
internet access, and don't send my data to big tech cos. Maybe I'm just old
fashioned.

~~~
spiderfarmer
Almost none of this stuff requires an internet connection and it goes way
further than simply turning your lights on/off.

~~~
thinkloop
Does Alexa et al work without internet as well? We need a local closed-circuit
voice recognition equivalent to be the brains

~~~
sjwright
Voice recognition isn’t automation, it’s an elaborate remote control. Real
automation is having the room lights react to stuff like motion, presence,
time of day, ambient brightness, and whether you’re watching TV.

Telling Alexa to turn the lights on is more of a Rube Goldberg hack.

~~~
thinkloop
Does home automation _require_ internet for anything?

~~~
sjwright
Not inherently, no. I'm building out my home automation with mostly ESP8266
based sensors, relays, modules etc. About half of those are NodeMCU, the other
half are commercial devices flashed with custom firmware. My biggest "win" so
far is taking over thermostat control of the whole house ducted AC. I now have
it automatically change which room it prioritises temperature stability based
on presence and time of day (when the child goes to bed).

My system "relies" on an internet connection for just one thing right now:
iPhone push notifications, which are merely informational and mostly for
debugging. It also uses the internet to keep my local NTP server in sync. When
I'm away from home I can manually check on stuff with a VPN.

In future I plan to expose a minimalist HTTPS api for triggering certain
actions remotely, like the garage door. But even that's not a big deal right
now because I've got a outdoor AP that covers a wide area outside my house—my
phone is generally already on wifi as I approach home by foot.

------
yitchelle
I don't think that ROI on home automation is positive, at least not for me.
While the automations mentioned are nice for the author, it seems to be too
much effort for too little gains.

For me, home automation suppose to free up your time for other activities.

Washing the dishes or clothes are great automation. I would look to other
automation like changing the bed sheets, folding clothes, cooking the evening
meals, grocery shopping etc. Let's talk again when these items become main
stream.

~~~
intpx
i have adhd and early in the morning and late at night (when my meds have worn
off) my brain just doesn't work right. home automation has been a major game-
changer for keeping me on schedule and not getting engrossed in something and
looking up only to realize i need to be getting up for work in 2 hours. I have
a whole bunch of time based and triggered automations for all sorts of
things.The time I save is not the extra 14 seconds to shutdown the house, its
the time I save keeping on a schedule so I can actually do the things I plan
to do rather than getting distracted and snapping out of it at 4AM to find
that I have taken apart my dishwasher.

~~~
yitchelle
That is great that the ROI is significant higher for you. Can you share the
specifics of a couple of your automations? I am genuinely curious.

------
ww520
Most of the auto-lighting cases can be handled with a motion sensor and/or a
timer. I've got two internet capable sockets and I've yet to found a use case
for them.

The only case I found useful is using an internet capable magnetic sensor on
the garage door to notice me when it's opened or closed, so that I have a
peace of mind after driving off.

~~~
bjacobt
Can you share the link to the magnetic sensor you use on your garage door? I
bought a MyQ[1] and it stopped working after the 11 months.

[1] [https://www.myq.com/smart-garage-hub](https://www.myq.com/smart-garage-
hub)

~~~
ww520
[https://www.amazon.com/gp/product/B07CWLZWHP](https://www.amazon.com/gp/product/B07CWLZWHP)

It's a cheap generic magnetic sensor, not specifically for garage door. I used
the small door hinge trick to adapt it to the garage door.
[https://www.youtube.com/watch?v=o49xC-
AXY9w](https://www.youtube.com/watch?v=o49xC-AXY9w)

------
manuelmagic
I'm surprised nobody mentioned Shelly smart switches since many people here
are worried about manufacturer cloud dependency, obsolescence and security.

I installed a bunch of Shelly 1 smart switches
([https://shelly.cloud/shelly1-open-
source/](https://shelly.cloud/shelly1-open-source/)), they work via WiFi in
LAN (even with the manufacturer's App) _or_ Cloud (it's optional).

There is the possibility to manage them via REST APIs, all the smart switches
serve a web page that can be reached via browser.

If you connect them to the Cloud you can optionally add Alexa or Google Home
on top. They do not support HomeKit natively[1] nor IFTT.

I choose this solution because I wanted to automate part of my appliances and
lights in my house _without losing_ the possibility to use the analog wall
switches that I already have installed: Philips Hue lights are nice but if you
switch them off via the analog switch in the wall the App or your favorite
voice assistant can't work anymore. Furthermore, they are very expensive; at
lest 20€ for a single 8W bulb (no other size available), while a single Shelly
1 costs half the price.

[1] but from the original link of the thread I found this
[https://www.npmjs.com/package/@kacepe/homebridge-
shelly](https://www.npmjs.com/package/@kacepe/homebridge-shelly)

------
anotherevan
If you are interested in DIY home automation, you should definitely follow Jon
Oxer at [https://www.superhouse.tv/](https://www.superhouse.tv/)

One of his biggest guiding principles which I strongly share is not needing an
Internet connection for your house to work - which rules out most commercial
home automation stuff that needs to talk back to home base.

He uses a lot of arduino and sonoff more recently. Also runs a lot of stuff
with power over ethernet. All interesting stuff.

Lately he has been working a lot on understanding assistive technology
hardware (e.g. wheelchair controller joysticks) and creating additional open
hardware and software that can interface with them.

Well worth going back through his many years of material if you want to get
into this sort of thing.

------
brachi
This is pretty cool. After a year experimenting I found that turning things
off/on in an if/then fashion doesn't add much value to me. The kind of
automation I want is for chores that take time and are not much fun, like
laundry. Turns out that doing that is much harder than turning things on/off
remotely :).

I'm thinking of an assistant where I show (or tell it) what I want, and it
just does it (it 'learns'), improving based on feedback from the users.

Hard-coding times in the day, for example, could be improved if the assistant
knew what would be the ideal time to sleep to me, based on all the data
collected for each profile of the people living in that home. It might ask me
or suggest me things to do, having more flexibility than static rules.

~~~
ip26
Roomba et al is probably the biggest recent advancement in chores, although it
doesn't work in every home.

~~~
ghaff
I periodically think of getting one, but it would only work for a section of
the house, albeit the section that could use the most regular vacuuming. But
that same section is also where there tends to be the most clutter/cords
laying about, etc.

In the end, my compromise was to get a good cordless vac which I can run for a
few minutes if the crumbs and other debris get too objectionable.

~~~
sjwright
Regular vacuuming makes carpet last longer because when grit gets between the
carpet fibres, it acts as an abrasive and literally wears your carpet away
with every footstep.

~~~
ghaff
The trafficked areas the Roomba would work for mostly don't have carpeting.
And where there are carpets, they're all decades old so I'm not too worried
about taking new steps to prolong their life.

~~~
sjwright
That's entirely reasonable. I mostly posted that as a PSA for anyone who
assumed that vacuuming was only about cleanliness, not carpet life.

------
georgeoliver
I'm curious what the state of the home automation installation/service market
is these days; I do home renovation professionally and have a programming
hobby so this seems like a fun area to get into.

~~~
OJFord
Extremely expensive proprietary kit, obsolete (or requiring expensive upgrade)
after a fairly short lifespan.

But of course the market for it doesn't care, and can pay for it.

I've thought about it similarly to you, but because of the labour cost of
installation, it's an expensive job whatever the cost of the
hardware/software, so there's not really a reason for installers to use
HomeAssistant, OpenHAB, and the like. The difference will be thousands for
hardware, on top of tens of thousands for the whole install job.

~~~
lgunsch
I work with Levven Controls, and what they offer to home builders is smart
home controls on every switch and light in the entire home during
construction, but for less cost than traditional wiring. There are no wires
going to switch boxes, so that labour and material cost savings is enough to
offset the cost of smart controls.

~~~
CrazyStat
I assume no wires means battery powered. How long do the batteries last? Will
I need to replace the batteries in all my light switches every couple years?

~~~
Symbiote
I have a similar system in my rented apartment, and there's no issue with
batteries after 4 years so far.

I wouldn't choose it. Every ten pushes of the switch, nothing happens, and
there's no visible / feelable state of the position of a switch.

~~~
lgunsch
The tactile feedback part of the switch is definitely an area we have tagged
for improvement.

------
Terretta
Love seeing this for HomeKit.

// Enjoy when we see HN thought leadership supporting use of security-minded
or privacy-minded mass market products, rather than endless bashing of
consumer products aimed at trust.

------
jonstewart
Turning lights off and on and adjusting speaker volume in most homes are such
simple things, it's hard to get excited about automating them. The home
automation tasks I'd like to see: \- cleaning gutters \- putting dishes away
\- sorting mail \- taking garbage cans down to the street \- unboxing packages
and breaking down boxes \- folding laundry

These drudgeries take time. They're obviously not as amenable to automation as
simple controls on existing electronics, but, in contrast to automated
lighting, they'd be worth the investment to solve.

~~~
ojkelly
Automating lights doesn’t seem super exciting, but as someone whose done it -
it’s been a surprising quality of life improvement.

The colours are cool. But the real power I’ve found is that every light is
dimmable. It doesn’t matter if you have a dimmer installed, which is not
something you can usually do in a rental.

So, my lights automatically stay at the ideal level of brightness for the time
of day. Later into the evening they only put out between 1-10%, and in some
cases are set to only red.

Compared to living with lights that are either 0 or 100%, having that range in
between has made a dimly lit house possible when it makes sense. And that’s
been so much more pleasant I’m never going back.

~~~
swsieber
So, are you using smart lightbulbs instead of smart lights?

~~~
swsieber
I mean, I'm asking because it's not entirely obvious to me, and smart light
switches would be my goto, but you mention color.

I'm not sure why my question was a bad one.

~~~
ojkelly
Smart light bulbs.

The value comes is automating more than just on off, though I have some non
light things I automate with switches.

Smart bulbs allow fallback with norma switches, and don’t require
modifications. Just swapping of a bulb.

------
stevekemp
That's a pretty nice writeup, but I suspect some of the use-cases could be
solved more easily with off-the-shelf parts.

For example I bought a couple of small LED-light boxes, they're about the size
of a match-box and contain 5 LED lights and a motion sensor.

I've stuck a couple inside cupboards, and low down on the walls of our
bathroom.

When it is dark and you walk past they come on for 30-seconds or so.
Additional movement keeps them on.

Getting up to use the toilet in the night is much nicer with these low-level
lights than turning on the proper lights and killing your night vision. (No
lights would be fine 90% of the time, but children's toys get everywhere!)

~~~
netsharc
> Additional movement keeps them on.

So it doesn't time out after those 30 seconds and you have to frantically wave
your arms to get them to switch back on? As the sibling commenter said, what's
the brand?

~~~
stevekemp
Linked a similar item below, these were just random finds at a local hardware
store.

They're low enough on my walls that I've never really had to jump around to
keep them alive though. I guess if you did literally walk out, then stand
still for 30 seconds or so they would time out on you.

If you need proper light then you can use one, these are just little helpers
if you need to get out of bed to deal with a child overnight, use the toilet,
or similar. In practice they work really well.

------
aaron695
How to automate a home over a 100 years -

Electricity (fire automation)

Washing machine

Vacuum

Microwave/Rice cooker

Dishwasher

\-----------------------------------------

Turing lights on and off with a super computer?

[Edit: The OPs post is interesting and cool as a hacker, it's just the actual
next big thing in automation that will change lives will be something boring
like an electric mop or duster. And if you want to automate your life, only
having dishwasher safe plates is a good first step]

------
dfc
The most intriguing feature for me was the automatic curtains. Does anyone
have any experience with them? Suggested vendors?

------
twoflower9
With the wardrobe light I'd prefer something simple like a relay that closes
the circuit when the door is closed. Invert that signal with a transistor and
buddabing buddaboom. Seems like more can go wrong once you start adding
programming and iPhone apps and all this sort of stuff.

~~~
escardin
That's already too complicated. You want a normally closed switch (i.e. on
when not pressed). When the door is closed, it's pressed, and the light is
off. When the door is open, the light is on.

------
novok
For the author: home assistant has had a native homekit plugin for a while, so
you could move to a %100 home assistant setup if your devices are not homekit
native.

------
Havoc
The ios app for home assistant works just fine.

~~~
robbiet480
Thanks! :-)

------
hello_asdf
For the author: any tips or recommendations for electric curtains? I'd love to
automate that.

------
raintrees
I would enjoy seeing a BOM for the hardware. I am looking for PoE circuit
designs to roll my own.

------
a254613e
I'm curious why not use home assistant, and all the integrations that come
with it, and then just expose them as homekit devices if you need/want to use
homekit? Seems like it would save you a lot of time and custom code.

~~~
KaiserPro
I suspect its because the native ios integration is far superior

------
anotherevan
My home automation efforts are pretty modest so far, but address definite pain
points in my house.

Not really automated at all, but there is a LED in the ceiling near the front
door that flashes when the garage door is open[1]. Seeing that light when
coming down the hall has saved us heaps of times from leaving the garage door
open all night.

I also have laser pointers hanging from the ceiling in the garage that are
positioned so when the laser dot reaches the dash you know the car is in far
enough.

Another not quite automated addition is using a Sonoff wifi touch light
switch[2] in the lounge room[3]. Reflashed with Tasmota it allows us to easily
turn the overhead lights on and off from the same remote control for the TV,
Amp and Kodi media player. (Works via a script in Kodi.)

Probably the handiest is using an ultrasonic distance sensor as a presence
sensor to tell the computer when I’m in front of it or not[5]. If music is
playing when I walk away from the computer, it pauses then resumes when I come
back. Also wakes sleeping screens when I return.

Just recently I wrote a little script that displays the number of minutes I've
been sitting at the computer in the corner of the screen. At thirty minutes it
turns from green to red and plays, "Move it! Move it!" sound, which it'll keep
doing every five minutes until I get up and leave the computer for a little
bit. (Although I think I'm going to have to change the sound to something that
doesn't startle the hell out of me every time.)

Also have an analogue modem on the phone line that lets me initiate calls from
my command line by just typing something like, "call dad" and it looks up
contact information in my centralised contacts list. It also cross-references
incoming caller ID info with the contact list and displays caller info on my
computer screen and the Kodi media player[6].

If I were to really get into more home automation in earnest, I think being
able to control the curtains in the house would be ahead of controlling
lights. Hate wandering around the house opening and closing them all.

Two things I dislike about current trends in home automation are:

1) The requirement for an active Internet connection for a lot of your stuff
to work. I want it self contained to the house and not sending information out
into the world.

2) The need to have your phone near to you to use half the stuff. E.g., with
the lounge room light switch mentioned above I can turn the light on or off at
the switch (as well as the remote). I don't have to go find my phone and swipe
back and forth five times just to toggle it.

One concept I find very interesting from the late 90's was the adaptive
house[7]. It would learn things like your hot water usage, preferred room
temperature and ambient light levels and used neural network reinforcement
learning to optimise. I wonder how far this could be taken now with advances
in machine learning.

[1] [https://www.michevan.id.au/posts/garage-door-
sensor/](https://www.michevan.id.au/posts/garage-door-sensor/)

[2] [https://www.itead.cc/sonoff-touch.html](https://www.itead.cc/sonoff-
touch.html)

[3] Aside: To my mind, in most cases it seems to make more sense to automate
the switch, than automate the light bulb itself. Changing a light bulb doesn't
need an electrician though, I guess.

[4] [https://github.com/arendst/Tasmota](https://github.com/arendst/Tasmota)

[5] [https://www.michevan.id.au/posts/are-you-
there/](https://www.michevan.id.au/posts/are-you-there/)

[6] [http://ncid.sourceforge.net/](http://ncid.sourceforge.net/)

[7]
[https://www.cs.colorado.edu/~mozer/index.php?dir=/Research/P...](https://www.cs.colorado.edu/~mozer/index.php?dir=/Research/Projects/Adaptive%20house/)

------
gswdh
Is anyone else conflicted by the desire for something better than a light
switch in the home and the idea of bringing more tech into home. The negative
of tech in the home being compromising privacy?

~~~
beatgammit
Yup, which is why I'm interested in privacy-oriented solutions like
HomeAssistant. I think the main things I want are:

\- control temperature remotely (e.g. set furnace to turn on when I'm coming
home from a trip) \- turn on/off power outlets to save electricity from
"vampire" devices \- check for open doors/windows \- adjust airflow to make
sure rooms are heated sufficiently

None of this requires sending data outside my home, yet the main smart home
devices do. Also, I'm worried about security, and I don't trust these devices
to update firmware appropriately.

So, until I get time to do it myself, I just do without.

