The Cheapest WiFi Smart Switch: Flashing the Sonoff Basic

Setting up a smart home can be a costly affair, if every device needed an expensive proprietary smart switch you would spend quite a bit of money. With a very tiny amount of soldering and some custom firmware, the Sonoff Basic model can be turned into a locally controlled MQTT enabled WiFi smart switch for about $7 each. These tiny little esp8266 based boards can be spliced into a power cord to add WiFi control to anything.

I have about a dozen of these and they work great. Because of how cheap they are, I have started adding them to some ridiculous devices. Today’s DIY WiFi retrofit: my coffee mug warmer.

I want my mug warmer to come on automatically when I enter my office in the morning, but only if I’ve made coffee already. But first, I need to flash some new firmware onto my Sonoff.

Continue reading →

Location Aware Notification Lights with Node-Red and IFTTT

I am in the habit of going on cooking sprees while listening to music… loudly. I only share one wall with a neighbor here in the loft, and that neighbor is very tolerant. On a Sunday afternoon, with multiple dishes going at a time, my most used smart home feature is “Alexa, set a meatball timer for 25 minutes”. Having Alexa keep track of all my timers is really helpful when my hands are full. The problem is that I rarely hear the timer, and have burned a few things not paying attention.

Using IFTTT, Node-Red, and Home Assistant I can blink the lights in the room when the Alexa timer goes off – even if I wander off to a different room.

Continue reading →

Let's Encrypt

Setting Up Let’s Encrypt with Node-Red & Home Assistant

Privacy is important in the smart home, and one of the primary reasons to use Home Assistant is because it is totally under control of the user, on your own network. Since writing these posts, setting up encryption with Hass & Node-Red has been the number one question I’ve been asked about my setup. So after being lazy and just leaving my software behind a VPN and firewall, I finally git around to setting up SSL support for both Home Assistant and Node-Red.

Read below for a guide to securing your smart home with Let’s Encrypt.

Continue reading →

More Nodes for Home Automation: state-machine, actionflows, dashboard, statistics

I’m keeping a running list of useful nodes I’ve found for home automation. Here’s a couple of more I came across recently in the Node-Red library.

  • dashboard – Create an entirely custom, live dashboard. Amazing!
  • statistics – Some useful statistical functions, based on Simple Statistics
  • state-machine – Manage a state machine with your own parameters
  • actionflows – This one seems extremely promising. Package flows as reusable functions that can be looped, prioritized, and benchmarked.

I think making a dashboard is my next project, which I will certainly document here on the blog.

I am wondering if state-machine could be used to manage the state of a finicky IR controlled fan I have. I was never able to find a way to do this in Home Assistant accurately. Since Node-Red can do more complicated logic, it could monitor my fan related sensors and output in the format for the MQTT Fan component. Interesting!

Morning Radio

Going Further with Home Automations in Node-Red

In my last post about using Node-Red to make automations with Home Assistant, I showed some very simple flows for turning lights on and off. While it is important to get used to the Node-Red way of doing things and it’s interface, none of the examples in my post are very compelling. All of that can easily be accomplished in Home Assistant already, so what makes Node-Red so awesome?

Let’s examine some of Node-Red’s features a little closer to get a better idea of what’s going on, how we can use that to create dynamic automations with Home Assistant, and an example of an alarm clock radio flow that uses some advanced logic nodes.

Continue reading →

Basic Node-Red Flows for Automating Lighting with Home Assistant

Smart light bulbs are probably the first thing everyone getting into home automation buys. It is easy to see the applications for them – have the lights come on at night, turn off when you’re home, etc. It’s very satisfying to have the lights react to the day and your activities, and my goal with automating lighting has always been to not have to think about it, for it to work in the background.

In my initial post about Home Assistant and Node-Red, I explained the initial hoops you have to jump through to get both pieces of software up and running and talking to each other. Now we will start using them together in some very simple flows to control lighting, to get a better understanding of how Node-Red works, and to start to delve into this powerful tool.

Continue reading →

Presence Detection Part 2: Improving Presence with Node-Red

In my previous post about presence detection, I showed how you can combine multiple device trackers into one highly accurate Bayesian sensor.

In Home Assistant, this new binary_sensor that I created is either on or off. It would be a little nicer if it were a device_tracker entity instead that was either home or not home.

With Node-Red that’s easy enough, but what if we take it a step further and create our own custom device_tracker based on a different set of rules altogether?

Continue reading →

The Open Source Smart Home: Getting Started with Home Assistant & Node-Red

Home Assistant is one of the most interesting open source projects I’ve ever come across. It interfaces with any device, platform, or service you can think of. It can connect all of your devices to make a truly smart home. With a little creativity almost anything is possible with Home Assistant, and best of all it’s private and totally under your control.

After using Hass to control my smart home for the last year, I started to hit the limitations of its YAML-based configuration. Any automation that was even moderately complicated required a lot of pieces spread out through the configuration files (see the sprawling “Creating an Alarm Clock” thread on the HA forums for an example). Doing simple things like if-then or a  loop required awkward workarounds. As my automations (and ambitions) increased in complexity, so did the time I spent trying to figure out what was going on.

That’s when I discovered Node-Red, a visual programming tool developed by IBM. Node-Red is the perfect complement to Home Assistant, allowing for very complicated logic to be constructed visually through a simple “flow” interface. It integrates seamlessly with Home Assistant. Let’s set it up.

Continue reading →