Smart Homes, Dumb Components

Recently I have been attempting to improve my home in various way. Like a kind of “home improvement”, if you will. My home was built in 1910, and so it's very old. Much needs to be updated.

Since its construction, people have “improved” it and “fixed” it. And by that, I mean they half-assed upgrades and repairs. Everything is just a little bit wrong. Like a text translation done by someone new to the originating language.

This post, though, is not about the old wiring and plumbing and drywall over plaster. It's about making my home a smart home.

Bad Purchases

The Thermostat

Let's start off on the wrong foot. I have bought a lot of mistakes. I still own some of those mistakes. They sit on shelves now collecting dust.

The one of the earlier mistakes was a Honeywell Smart Thermostat. It was smart, reasonably priced, and wifi-enabled so I could check the temp and adjust it from anywhere. I was going to use the app to handle Geo-fencing so it would make sure to adjust the air before I got home.

I was excited. Then I was disappointed.

The thermostat did what it said on the tin. What it failed to mention (and my lesson in wifi smart devices) was that it was 2.4Ghz wifi only. Well, that's fine. I have both 2.4 and 5Ghz networks running. 5 for speed, 2.4 for distance. Nice!

Not nice. Wifi networks carry a name called an SSID. It's what you see when you try to connect your computer or phone. I set both the 2.4 and 5Ghz networks to the same name, and modern devices then make their own decision about which will give you the best performance. It works very well.

But not for Honeywell. Their thermostat actually had the hardware for both frequencies, but was set up to only use 2.4Ghz. What ended up happening is that unless I set up the networks with different names the thermostat would get confused and spew data packets everywhere and bring down the 5Ghz wifi. It would literally kick off almost every other device on the network.

I didn't have great networking equipment at the time, and I wasn't about to have two SSIDs for the frequencies like a savage. So I returned the Honeywell and got a Google Nest E (or whatever the cheap one was at the time). Which I would later learn was a mistake, but for a different reason and one I will have to live with.

Flakey Smart Bulbs

A later mistake was smart bulbs. Our living doesn't have ceiling lights. It's all lamps that you had to turn on and off manually. So I decided to try and make that better by controlling them all with a switch.

This being an old house, there were mistakes abound. Near the entryway was a blank wall plate. Something use to be there, but now it was just taped up wires. Using my low voltage skills, I learned some high voltage skills and pulled out the old wires. I installed a proper box and ran a new cable with grounding and everything. There I placed a new outlet with USB ports and a smart switch. That smart switch was a product line called C by GE (now called Cync... sort of) and had smart bulbs as well.

Details on the box and website were sparse, but mentioned that it did not need a hub and worked with Google Home out of the box. Great!

I got home and installed the switch and set up the bulbs and they worked like a charm! I could even shout at a Google Home Speaker and they would turn on, off, and dim.

Bam! The lights turned on.

Bam! The lights turned off.

Bam! My family got sick of how excited I was about light bulbs that did what light bulbs do best.

Then I got more bulbs because we had recently finished part of the basement to be usable space as an office and kid cave. All the bulbs down there and in our upstairs landing got swapped out.

It was exciting, until it wasn't.

Turns out that the lack of a hub did not mean wifi. It meant Bluetooth. And not great Bluetooth. Outside of the living room (which I believe was using the wifi smart switch to send Bluetooth to the bulbs), none of the bulbs worked consistently. When they worked, they worked great! But that was rare. Eventually, only the living room used any of the smarts (because of the switch) and the others were effectively expensive regular bulbs.

Brands or: Or How I Learned to Stop Worrying and Hate Everything

In the meantime, I was able to get myself some much better networking equipment. Like, business grade stuff. It's been awesome.

Then, we had to replace our oven. We decided to get a Samsung smart oven. It's a convection oven and has a built in air fryer (which I learned is just convection baking, but with a separate button). It has this great feature to turn the oven on from the app. Granted, the timer function starts before the oven is heated to temp... which makes no sense. And you can't use it remotely... which is not useful if you're buying frozen pizza and want to throw it in right when you get home.

To Samsung's credit, the remote block is a safety feature of gas ovens only. Not to Samsung's credit, it only really works in the SmartThings app. It claims to hook into Google Assistant for voice support, but it does not. Nor does it work in Google Home. I can see the oven, but it does nothing.

I also had to replace my garage door because it was literally falling off the hinges. It had been like that for well over a year before I was able to replace it. The installers put in a wifi-enabled Chamberlain. It doesn't work with Google Home or SmartThings. Just a select few home automation tools that have a huge upfront cost to install. And also Resideo (Honeywell's smart home app).

I then got a Legrand smart outlet to manage power on a schedule. This was so I could turn off power to the kid cave so one of my kids couldn't sneak video games all night (long story, he's a teenager). I then learned after buying it and ripping it open that only one outlet is managed. It didn't say that on the box. After seeing the device up close, I then saw the tell tale sign of a single controlled outlet. Turns out most outlets are like this. I think it's dumb.

I then started looking for smart bulbs. Something with wifi, and reasonably priced. I landed on Cree Connected Max. They are wifi, and they integrate into both Google Assistant/Home and SmartThings so it gives me one place to toggle everything and still shout at them. Unlike so much of this post, they have been great. I even reconnected my outdoor flood lights (that have no switch wired to them), and installed Cree bulbs that work like a dream.

Though, since the switch I was using was also C by GE (same as the bulbs), I needed a new switch for the living room. I did a lot of research to find something that would work. I then chose something I hoped would work.

It did not.

I got a TPLink Kasa smart switch. To its credit, it does what it claims to do. However, it's the same as every other smart wall switch. It doesn't care about your bulbs (unless for some brands you buy their bulbs), it just turns your wired lights into smart lights. Why have smart bulbs, but no smart switch? or a button? Or anything? Why have a switch that can't also control bulbs?

I get we're smart people trying to automate and shout at our devices like on Star Trek or something, but most of the world still reflexively goes for a switch. And if you have smart bulbs on wired lights, they become dumb bulbs when that switch (smart or not) turns the lights off. It is nonsense.

When I grabbed the switch, I also got Outdoor Smart Plugs by TPLink. They worked except that they only worked on the home network. Remote access didn't worked for some reason. TPLink said that this issue was related to either DNS (which would make sense if I was using the internet provider's DNS) or my DHCP server.

The DHCP server claim was a funny one. Their explanation was that I needed to set the IPs statically because devices may ask for the same IP address at the same time. For a house, that probably will never happen. That's not how DHCP works by default. You may get that in a business environment, but even then a good router or DHCP server would not hand out duplicate IP addresses.

Either way, it meant that the Kasa devices didn't work in SmartThings or Google Assistant/Home. Those apps talked to TPLink's cloud service to connect to the devices. Since I couldn't get them to work remotely, it meant that those apps couldn't use them either.

But what About [Insert Brand/Tech Here]?

So before I get into my solutions. What about all those other options?

Why not Hue? Well, to be frank, they are expensive. $30 per bulb is a lot. And I didn't want to keep buying devices that needed their own hubs, turning my network rack into a shelf of small hub devices.

On that note, why not Z-Wave or Zigbee? Well, at the time, I was trying to avoid hubs because I was having trouble finding one with good reviews or would last longer than a year (cause it was tied to some small company's cloud service that would go defunct) or was even for sale anywhere.

So yeah.

Beating Everything into Submission with Home Assistant and Node-RED

However, I did give in to a hub of sorts. I decided to try my hand at an open source smart home product since the nerds of the internet are as stubborn as I am. I asked for suggestions on Fosstodon, a Mastodon instance, and they all rooted for Home Assistant.

Seeing as I had a spare Raspberry Pi 4, I installed it on that. Giving me a hub, but one that I can use as something else if this failed.

Installation was simple. One of the options is to write Home Assistant (and all of the OS and libraries it needs) to an SD card, insert it, and power up the Pi. There are other options, but I wanted simple.

There was some initial set up, but that was just filling in some forms. Afterwards, it immediately detected some of my devices when I loaded it up the first time. Setting those up was pretty simple.

Now there was a caveat to the lights. Cree doesn't currently offer any kind of cloud service that Home Assistant can tie into. Fortunately, the Home Assistant community discovered that the cloud service is a re-branded device service by Tuya. It required some steps to take and to sign up for a developer program, but it did integrate into Home Assistant.

So now I have my switch and bulbs and outlets and media players and garage door (cause they figured out how to get Chamberlain's API working with Home Assistant) working and automated.

A Note about a Couple Devices

Before I get on with talking about solving my light problems, I wanted to touch on my Nest Thermostat and Samsung oven. They are the two smart devices I have failed to add to Home Assistant.

The oven may be able to added in the future. There's no direct integration, but I may be able to automate it by connecting to SmartThings. However, that requires some set up and webhooks for push notifications. I'd rather not have that set up on my network and may add it later through Nabu Casa.

Nabu Casa is a cloud service by the founder of Home Assistant. It's meant to simplify things like connecting to SmartThings, as well as connecting to voice services like Alexa and Google Assistant. It also offers a way to remotely access your Home Assistant install without having to configure a VPN connection.

I can do all that myself, but I'm also lazy and don't want to maintain it. Plus it helps to fund Home Assistant, so I'm down for that will probably buy it later.

As for the Nest Thermostat, it's not a simple integration and the community has been reporting various amounts of success since Google, Nest's owner, has been messing with the developer API and people's ability to use it. So that's on hold and I may look into another smart thermostat that requires less leg work with a chance of failure.

Long paragraph short, I don't want to put in the effort if I may fail. I don't do enough smart thermostat things to make it worth it.

Back to the Stuff About Smart Bulbs

So my goal in all this was to get my living room lights to turn on and off using both a smart home app and a physical switch. I had everything in Home Assistant I could turn them on and off with toggles. Even got the app working and can toggle from my phone.

However, there was no way to group them so that if one turned on or off, they all would do the same. So I looked to the docs to see what I could do. They suggested settings things up with automations. I could use the switch as a trigger (since I'll probably just hit the main toggle for the room in the app), and then set the other lights as actions to turn on and off along with it.

And it worked!... sort of.

It did work. I could hit the switch and the other lights in the room would turn on and off. The downside was that I was waiting for almost 10 sec each time. Everyone would think it was broken by that time and hit it more, just to confuse the system. So I did some digging...

And I found (again through the community) that Kasa products use the cloud for initial set up to the wifi network, but then Home Assistant just talked to it directly on the local network. In order to get device status, it polls for updates every so often (I'm guess every 10 sec or so). There were various solutions to remedy it, but the one that jumped out at me was Node-RED

Enter Node-RED

Node-RED is a device workflow tool. It's written in NodeJS and gives you a visual tool to create automation sequences. If your install has the Supervisor, it can be added as an add-on that is automatically integrated into Home Assistant. Which is what I did to great success.

When I jumped into it, I then added a custom TPLink package for it that added support for Kasa devices. After much fiddling, I was able to shorten the check time to 1 sec, and would change the living room lights on and off based on the switch status using Home Assistant scripts.

I then took it a step further.

Node-RED has somewhat of a learning curve. It makes more sense if you've done any programming, but it's still a little odd. The big thing that was tripping me up was that the documentation for the TPLink package was sparse and assumed you knew you had to add the Inject node to tell the TPlink node to start polling for events. I did not, and it required some reading of fine print to figure it out.

And really, similar goes for Node-RED in general. It has decent documentation and some users have created videos, but they feel like they are explaining things to people who already get how it works. Which I did not so I had to dig a bit more to get what I needed.

But once I got it, I got it. I tried using the Sun Events node to change the color temp of my lights based on the time of day. The node listed all of the events, but didn't say what order they go in and neither did the library it relied on. So I threw that away and had it check time ranges that I defined. When the lights were turned on, it would check the time of day and set a scene to match how they should be with the sun.

Then I set a recurring check to update the scene for the time of day if they were already on (no sense in changing if they're off).

Then I got real fancy and tied the lights to my Roku player (which is hooked up to an overhead projector). Once someone starts playing a movie or video, the lights turn off. They then stay off until someone goes back to the home screen. I did that just in case they pause or rewind very shortly. They wouldn't want the lights to flicker on and off as they do things.

You can see my complete workflow below.

A screenshot of a Node-RED workflow.

Conclusion

I like making my home into a smart home. I hate smart device brands because they feel anti-consumer (specifically in the “we want you to use only our products even though we may not sell everything you need or do exactly what you need” sort of way). I really like Home Assistant and Node-RED. I may think about adding Z-Wave or Zigbee to my Pi to adding support for more sorts of devices if they offer things like generic buttons and the signal is strong enough.

I can't imagine regular people being able to set up a smart home. Consumer brands make it so frustrating and difficult and arbitrarily limiting, that I'm not surprised most people don't go beyond Hue. Hue is expensive, but they also just work and they have wall buttons that just make the smart bulbs do what they do best.