Hacker News new | past | comments | ask | show | jobs | submit login
Home automation with Raspberry Pi, Node and React (viktorkirilov.me)
171 points by deepsy on June 30, 2017 | hide | past | favorite | 43 comments



There is a really popular project (disclaimer: I'm an occasional contributor) that also has an excellent Raspberry Pi story named Home Assistant:

https://home-assistant.io/

https://github.com/home-assistant/home-assistant

They also have a full Pi distro named Hassbian:

https://home-assistant.io/docs/hassbian/


I can vouch that it is freaking amazing too. My whole apartment is automated with it. Jungle noises play when I wake up, a northern loon calls precisely at sundown every night, I have motion- and door-triggered alarms that email me photos of the action and can be deactivated with a repurposed TV remote. I can activate dings when people visit my small website. It can turn on my portable air-conditioner when I leave work if the temperature is high. It can tell me if my mom's house across the country loses power or drops below a threshold temperature. It reminds me to do pushups at 8:30 and puts on a techno pandora station to inspire me. It sends live traffic and weather data to a matrix screen on my fridge to help me plan my commute. It can turn on/off all my lights, stereo, and TV. All self-hosted but accessible remotely through a personal VPN. And it uses 0.01 long-term load on my Raspberry Pi 2. Oh! and when I want to change or add a feature, I can because it's all in Python 3 hosted on github. Man, I love home-assistant.


Glad you like it! And now I've been listening to Northern loon calls for the last 10 minutes..


Founder Home Assistant here. Besides Hassbian we'll soon launch Hass.io: an OS for RPi + Intel NUC that runs Home Assistant and other apps inside Docker. All management of OS/containers is done from inside Home Assistant: https://home-assistant.io/hassio/

YouTube video showing a user installing Homebridge in 30 seconds on Hass.io https://youtu.be/A_LmQ5OlofY?t=61


just wanted to say, your page load time is amazing.


Thanks! Made possible by CloudFlare + static website (using Jekyll) and no JavaScript in critical rendering path :-).


This is very cool, and I'm a co-founder of Snips we are building a 100% on-device and private-by-design Voice AI assistant and we bind with HomeAssistant https://medium.com/snips-ai/integrating-snips-with-home-assi...

In 10 lines of code, you can have your own private Voice AI at home!


Can you recommend a beam forming microphone to implement a voice assistant on an rpi?


There's maybe a chance that Amazon might make their Amazon Alexa 7-Mic Far Field Dev Kit [1] more broadly available (currently only available to qualified OEMs).

There is also the 4-Mic Dev Kit [2] which might be broadly available by the look of it.

Or you could consider one of Acousticmagic's [3] solutions.

[1] https://developer.amazon.com/alexa-voice-service/dev-kits/am...

[2] https://developer.amazon.com/alexa-voice-service/dev-kits/co...

[3] https://www.acousticmagic.com/


Another happy install of Home Assistant here...

I'm using it to control my Z-Wave network at home. The number of other plugins that Home Assistant supports is really impressive (https://home-assistant.io/components/).


I mentioned this on the previous HN topic, the way the heating temperature is being controlled doesn't look correct to me. In all the boilers I've used the dial the servo is turning adjusts the temperature of the water being sent through the heating loop (to a blower or radiators) - this is not the heating thermostat. Generally you set this once and don't need to adjust it again, the thermostat does the work of turning the boiler on and off depending on when heat is required.

Similarly the dial above adjusts the domestic hot water temperature, while the system is running. Again, you rarely need to change it once its set to a temperature you are happy with.

Maybe I'm not understanding how this boiler works?


There are circumstances where varying the closed-loop temperature might be useful. (Of course I have no idea whether this applies to the article.) In my system you get better efficiency by operating at lower temperatures (more of the heat in the flue gas can be extracted), but this (along with radiator surface area) limits the total rate at which heat can be transfered into the rooms. If you're allowing the house to get cold during the day when no one's in, having the water temperature at its most efficient setting might mean it takes several hours to warm the house back up. So it might be preferable to briefly run the system at a higher water temperature to more rapidly bring the room temperature up, then back off the water temperature to allow more efficient operation.


Talked to the heating technician this week. Here in Germany heaters are set to 55-60 degree by default and it's advised to not increase the temperature or the minerals buildup will ruin the system very quickly.

Water hardness here is high, around 20 degrees, so your mileage may vary.


Are you mistaking different for correct? Generally the thermostat just turns the pump on, but is there actually anything wrong with leaving the pump on and changing the temperature?


Yes: efficiency and keepimg temperature stable at a certain point (ie, with a small hysteresis).

Ad 1: the gist is that it takes less fuel to heat a liter of water from 30 to 31 degrees, than it does to heat it from 60 to 61 degrees.

Ad 2: with a lower temperature, it becomes easier to control your overshoot. Actually this is related to 1, but what you want in the end is to have a system that runs at as low a temperature as possible, all of the time.


I'm not entirely sure, however running the pump without actually heating the water seems like a waste of energy. Maybe that's how this boiler works though, I'd be interested to know more from the OP.


The total absence of fault detection and shutdown is kind of scary. Fortunately it doesn't have the authority to do anything important. The worst it can do is turn the heat all the way up, down, or off.


> Fortunately it doesn't have the authority to do anything important.

Anyone who lives in a northern climate might disagree with that.


Yeah is is the reason the only IOT product I own are light bulbs. If they fail it's not that bad.

I definitely wouldn't trust a smart fridge, lock, thermostat, etc...


With maybe the exception of a lock, I wonder if that fear is justified without knowing the catastrophic failure rate of the "smart" functionality. There are plenty of ways that these devices can save you from the failure of "dumb" devices by keeping you aware of the status of your home.

For example which scenario is more common:

-A smart thermostat mistakenly turns off your heat in the dead of winter while you are on vacation causing your pipes to burst.

-A smart thermostat lets you know that the heat is not working in the dead of winter while you are on vacation because the furnace died which allows you to fix the problem before your pipes burst.

I don't know the answer to that, but I am not sure why we should assume the first scenario is more common without any real evidence.


Which is why I have a dumb thermostat (well, not totally dumb, but an old Honeywell manually programmable thing) plus a little homebrew Raspberry Pi project that tweets some basic information and will send me an email alert if the temperature drops below a certain threshold.

I'd rather have the IoT device just be a sensor while the thermostat itself is more or less as dumb/reliable as possible. As you suggest, there are still failure modes but at least the thermostat isn't adding to them any more than necessary.


> A smart thermostat mistakenly

I disagree with your use of the word mistakenly here. With IoT we need to worry about intentional remote attacks. This is not a mistake.

If we are not dealing with a malicious attacks then I would suspect that the second problem (system failure) is more likely.


Hacking of IoT devices in another fear that has questionable justification (don't get me wrong, many IoT manufactures are verging on negligent with the level of security on their devices). Most hackers aren't chaotic evil caricatures raining down destruction just for the lolz. They are usually trying to gain money or power. What is the goal of taking over my smart thermostat and turning off the heat? What is the likelihood of that actually happening?


> What is the goal of taking over my smart thermostat and turning off the heat?

While it might seem an extreme example, in many parts of the world when AC or heat fails, it can be a really big deal, especially for the very young and very old. A great example is the 1995 Chicago heatwave, which killed ~800 people. If IoT thermostats become more widespread and tightly coupled to the actual heating systems, it's not unreasonable to think they could become an attractive target. Even ignoring the incidents of deaths, the inconvenience alone of losing AC or heat can be substantial in many climates.

https://en.wikipedia.org/wiki/1995_Chicago_heat_wave

Without a source I personally wouldn't feel comfortable assuming that "money or power" alone account for a vast majority of these attacks. I don't think it's an unreasonable hypothesis that some are the result of plain nastiness, stupidity, or doing it simply because they can.


Humans aren't frogs in a boiling pot. If an IoT device shuts off the AC or heat, someone will notice before it gets to the level in which it will kill them. That would certainly be an inconvenience but I can't imagine a scenario in which it would be deadly.


Only if someone is home. I've gone on long vacations before in the middle of winter. There is always the risk I will come home to find something broke and my pipes are frozen. I don't personally know anyone who has had this happen, but it is a real risk. Real enough that the local Home Depot has devices to warn you about this (often dial a specific phone number).


Inconvenience can be damaging enough. Just crank up the heat in an office building and watch a company lose man-months of productivity by the hour. Do that on a hospital, and there might actually be loss of life involved.


I think the evidence of incidents of old people dying when AC/heat fails is difficult to ignore, but to each their own. As I said, the threat is greatest to the very old and very young, simply because they are far more likely to be in the sorry position of being unable to do anything about the failure. In the case of Chicago, they largely were "frogs in a boiling pot".

Heat is one of the largest causes of weather based fatalities in the US.

http://www.nws.noaa.gov/om/hazstats.shtml

Similarly, just google "AC failure Texas" - it's a very real problem in hot climates.


> Humans aren't frogs in a boiling pot. If an IoT device shuts off the AC or heat, someone will notice before it gets to the level in which it will kill them.

Just like frogs.

https://en.m.wikipedia.org/wiki/Boiling_frog#The_science


> What is the goal of taking over my smart thermostat and turning off the heat?

There are several

1: Look what I can do. If it is easy enough expect some kids (think 13 years old) doing it and laughing at the possible chaos they have caused.

2: lets rain chaos on those evil [insert any other country that you are at war with]. If I were to do this I'd change things so the average temperature was about right, but the heat and cooling would take turns changing the temperature by half a degree. Most people won't even notice right away, but their utility bill will be more than their monthly income and on a national scale the country is forced to dip into energy reserves.

> What is the likelihood of that actually happening?

1: Very high. For any individual kid it is low, and like for an individual thermostat, but if you are the exception it doesn't matter that only 10 people were hit worldwide, what matters is you have to replace all your plumbing

2: somewhat unlikely, but if anyone can pull it off they can cause a lot of problems for the target country.


Are we really at the stage that a country declaring cyber war on my thermostat has a higher likelihood than my furnace breaking?

I am not saying that your example aren't possible. I am saying it is a game of odds. I have no reason to believe the odds of a catastrophic failure are increased by the introduction of a smart appliance to a greater extent than other catastrophic failures are decreased by said appliance.


The reason your dumb thermostat isn't a risk, but an Internet-connected one can be is that Internet attacks scale. It takes one random person anywhere with a single exploit to affect millions of devices simultaneously. And while people are pretty decent in general, there are always those individuals who would happily watch the world burn. You can base the security of your system on the assumption that people are generally OK, but you can't base it on assumption that every single person is nice.

See also recent ransomware attacks - it's hard to believe this is something else that some individuals trying to piss off the planet (and make some money on the side).

See also PoC of a Philips Hue attack (with added fun of it spreading through ZigBee mesh): https://www.theregister.co.uk/2016/11/10/iot_worm_can_hack_p.... If people do that for fun (er, for Science!) to smart lightbulbs, you can bet someone will do it to a smart thermostat.


A smart thermostat can cycle a furnace on & off at high frequency and cause it to break down. Same with smart light controls. If there are specific models that burst into flames when you do this, then you can cause half a town to catch on fire at once.

You could also hack all the smart thermostats at once and cause annoying brownouts due to crazy simultaneous demand happening all at once. You can also cause peaker plants to go on and off at an annoying unpredictable frequencies by making these spikes short.

But to be honest, I doubt anyone will do this, since most vital infrastructure is relatively easy to sabotage and nobody has done it. A group of 100 organized assholes could do horrible damage to the US power grid today by going out to the middle of nowhere and blowing up a bunch of high voltage power transmission towers.


> What is the likelihood of that actually happening?

Probably comparable to the likelihood of an IP camera [0,1] being used as a botnet.

[0] https://www.wired.com/2016/12/botnet-broke-internet-isnt-goi...

[1] http://www.darkreading.com/iot/move-over-mirai-persirai-now-...


A botnet is a different problem. If a device is taken over as part of a botnet, the person controlling the botnet has an invested interest in the device not being discovered. The smartest move is to therefore keep the devices functionality as close to normal as possible.


Let's split this into two problems:

1) Access and control: I'd argue the likelihood here is comparable between IoT cameras and IoT thermostats.

2) Malicious application: You're correct that botnets favor no visible change in the host's functionality. However, there are ransomware applications of disrupting a home's physical systems that I submit should be considered before dismissing the idea out of hand. Coupled with problem #1, I think it could be an issue. Five years from now, we'll see where things stand.


It's still easier to break a window or kick in a door than to hack a smart lock. (I don't have one though)


It is easier to break one physical door. You want to break millions of virtual doors you need IoT devices.


I got too comfortable with my smart lock and got locked out of my apartment once. It was not fun.


Definitely take the same precautions with respect to having a spare key somewhere that you'd presumably take with a dumb lock. (Not that I haven't burned myself a couple of times in the past, pre-smart lock, by locking myself out without a spare.)


This is very cool! You can bind your Raspberry Pi and Node with Snips to add a 100% on-device Voice AI, take a look at our website at https://snips.ai, and we would love to feature what you build with our platform on the website!


Nice, time to buy some perfboard and ditch the breadboard so it stays together.


Lost me at Javascript




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: