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 →

Useful Sensor: Cardinal Wind Direction for Home Assistant

At a glance – gustier than usual this morning.

As someone who cycles to work most days, I keep a pretty close eye on the weather. One thing I like to know is which way the wind is blowing – a strong headwind means I should maybe opt for the road bike, not the cruiser. Home Assistant has a ton of weather platforms – and the Dark Sky one that I prefer tracks wind direction. The only problem is it returns the direction in degrees, which is meaningless to me.

See below for a template sensor that will convert degrees to a human-readable cardinal direction.

Continue reading →

Useful Sensor: Bayesian Sleep Detection in Home Assistant

Sleep is not something I can directly observe in my smart home (at least not until I build that DIY bed sensor). It would be nice to know though – then the alarm could be set, doors locked, thermostat set, music volume slowly dimmed, and internet bandwidth reprioritized automatically when it’s time for bed. We spend a lot of time sleeping in our homes, so it makes sense to be able to detect it.

Using Home Assistant’s Bayesian binary sensor it’s possible to guess pretty accurately when everyone’s tucked away. See below for example YAML and explanation.

Continue reading →

Home Assistant: Making My Plants Talk with IoT Sensors and a Python Script

Living in an urban city without a garden, I have been exercising my green thumb by accumulating more and more houseplants. I have them tucked away in every light-filled corner, hanging from every rafter in my tall ceilings. Which is a problem, because I have to get a ladder out to water most of them!

Using some cheap plant soil sensors and a simple Python script, I will have Home Assistant check all of my plants and make a list of which need my attention. Then when more than a few need to be watered, I can be notified or have the voice assistant give me an update.

Continue reading →

Useful Sensor: Motion Last Seen & Meta Motion Sensor

You know what’s great about motion sensors? They are very, very cheap to build yourself. All it takes is an esp8266 module like the Wemos D1 Mini, some PIR sensors, and the ESP Easy firmware and you can have a bunch up and running in a few minutes. I haven’t DIYed a battery powered one yet, but there are plenty of great Z-Wave ones available.

Once you have a couple of motion sensors in your smart home, you can have Home Assistant track the last place it saw motion. This is a useful bit of info – useful as a condition for your automations, or as an input for a bayesian binary sensor. See below for YAML to create a meta-motion sensor with a history.

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 →

Config: Setting up the Xiaomi Mi Robot Vacuum in Home Assistant

I have a dog who sheds like crazy, and the only thing that keeps the dust bunnies from overrunning me is a robot vacuum. My aging Neato Botvac, after fulfilling several years of hard labor, ate it’s 3rd expensive replacement battery recently. This was obviously a great excuse to get a new one that works with Home Assistant.

I went with the Xiaomi Mi Robot.

After getting paired with the app, teaching the robot English, and sending it on it’s way around the house to do it’s thing, I realized that the process of getting it paired with Home Assistant was not going to be straightforward.

For anyone else who runs into trouble, here’s how I got it working.

Continue reading →

Hardware: Odroid XU4 as Plex Media Server

The Odroid XU4 – like a Raspberry Pi, but better.

As part of my efforts to be cloud non-dependent, I have a NAS full of several terabytes of music, movies, and TV shows. Plex is of course everyone’s favorite software for solving this problem, as it essentially turns your hard drive full of files into a private Netflix capable of streaming and syncing to any device.

1080p and commercial free, sorry Anthony.

The problem is that streaming and syncing is a very CPU intensive task and requires a server of substantial processing power. Is the cheap Odroid XU4 single board computer up to it?

Continue reading →

Big List of Useful Home Automation Nodes for Node-Red

An ongoing list of nodes I have found useful for constructing home automation flows. I have not included device platform nodes, as all state tracking and actions are performed in Home Assistant.

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 →