Monday, May 22, 2023

To Cloud or Not To Cloud

 To Cloud or Not To Cloud

Before getting into Home Assistant, I was like most of the household automation folks out in the real world: different products from different vendors, none of which talk very well to each other unless you have a "voice assistant" like Alexa, Home Kit, Google, or the like. I suppose if you live in an urban or suburban area with pretty good internet, that's probably not a huge problem. However - I live in the sticks. Way out in the sticks. My internet comes from Starlink, and I consider myself lucky if I can get through a full day without seeing some sort of intermittent slowdown or disruption. If I don't like it, my option is standard DSL, which is kind of like watching the fields sprout.

My voice assistant of choice is Amazon Alexa. It normally, usually, works without any issues. Once in a while, though, it'll have a hiccup - either on its own or with help from Starlink. Everything I did up to this point was 100% dependent on having a connection to the cloud.

Enter Home Assistant

With a little bit of planning and sometimes a little bit of extra work, you can design an entire HA environment that requires no connection to the internet at all. It is entirely possible that everything in your HA environment could be controlled by your HA server and nothing else.

But to do that, you're going to need to really think about your current and future devices.

Some "smart" devices out there simply do not play with HA at all. Others kinda/sorta play with HA but they need a little coercion. And of course, some play very nicely, like the vendor wanted to make sure good APIs were available and cooperation between their products and HA was important.

Let me give you a prime example:

Google and Google Nest products.

Google and Google Nest products do not play nicely with HA without some poking and prodding, and even then (like with the Nest smoke detectors) they will be very, very, VERY finicky. And, you're going to need a connection to the internet to make them work.

You can tell the difference by looking at the card in your "Integrations" area (under "Setup").

Here's my Google Nest integration, which handles my Nest doorbell cam:


You can see the little white cloud in the upper right. That means that this integration must have connectivity to the internet to work correctly. 

By contrast, here is the integration for my router:



No cloud on this one, so even if I lose internet connectivity, this integration will still work fine.

In the end, it's going to come down to your preference. Some users absolutely refuse to install any integrations that require the cloud. Others (me included) accept cloud connectivity requirements grudgingly. I'd rather NOT have to depend on that, but for the integrations that require it, I'll accept it.

For now.

Sometimes, you can find integrations that require the cloud, and then find that the community has developed a better integration that doesn't need the cloud at all. Like this one:



There is a box in the upper right, which indicates that I'm using a custom integration. There's an "official" Meross integration, but it requires the cloud - and if you make too many calls on the Meross API, they will cut you off. (Ask me how I know.) The HA community developed an integration that doesn't require the cloud, and I'm using that now quite successfully and happily.

My point here is that even for the integrations that require the cloud, there might be integrations out there that remove that requirement. You'll just need to do some searching.

And, I would highly recommend that you do some searching for integrations before you purchase a new smart device. Make sure that it will talk to HA before you get it and install it. That'll save you some headaches (and maybe some salty language, if you're like me) later on.

Until my next post - rock on.

Friday, May 19, 2023

Designing Your Views

Designing Your Views

So now you've got HA up and running. It's finding devices and you're figuring out how to add cards to  views and make dashboards. By now, you've probably figured out that it's fairly easy to MAKE cards, but it's much more difficult to ARRANGE the cards so they look nice. I struggled with that for a little while. I'd add a card, then another, then another, and I could never get them to fit quite right and in the order I wanted.

Let me save you a little trouble. Learn how to "nest" your cards.

Remember that in HA, you have "views" that show in tabs across the top, and "dashboards" that show in tabs down the left side. I wanted to make sure we're on the same page here (no pun intended).

HACS

The very first thing you're going to want to do is get the "Home Assistant Community Store" integration ("HACS"). If you don't download or install anything else for HA, you're going to want this one. It will make your life easier when you want to add new things to your HA set up.

Layout-Card

Once you get HACS, you'll need a front-end addition called "layout-card." Grab that through HACS and install it.

Once you have both HACS and layout-card, we're ready to start making new views.

New View

What I found that works easiest for me is to create a new view and use the "Grid (layout-card)" view type. That sets the stage for the new view to be laid out in a basic grid pattern that I can control. Once you've created that new view, you should be looking at a blank screen. Now - here's where we start getting tricky.

You're going to add a new card - and it's going to be a blank "Grid" card. You'll also need to determine how many columns you want this new view to contain. Most of mine are 3 columns, although I do have a couple of views that are only 2. The only important things here are setting the number of columns and also, turn OFF the "Render cards as squares" selection. That makes things look really goofy if you don't.

Your card should look something like this now:


At this point, you must have an idea of what your first column (left side of the screen) is going to look like. Let me show you an example of what I have in one of my views:



There is absolutely no way you'd be able to stack these cards correctly in a standard grid or stack view. It's simply not possible. So, this is where you need to "nest" your grids. Let's dissect this first column.

The very first card I added to this column is a markdown card. That creates the "Interior" header. No issues there.

But then, I wanted to create two distinct columns of entities - single lights and groups. Focus on the keyword here: columns. How do you handle that? You simply add a 2-column grid card as your next card under the header markdown. Doing that, I now have a 2-column grid that I can manipulate however I see fit. Column 1 is a vertical stack of entity cards, and column 2 is a vertical stack of button cards. And they are arranged nicely, in the order I desire.

Here is (most of) the display that shows in my "cockpit" (my office) all day:


I've taken a 3 column grid for the main card and then addressed every column as it's own design area. This means nesting grid cards inside grid cards in some places. For example, look at the "Network Status" area. The header "Network Status" is a markdown card that takes up the entirety of column 2. The next card I added, however, was another grid card that is 3 columns wide. I could then add 6 different entities in there, arranged nicely, and how I wanted them arranged. I finished it up with another markdown card for the footer.

Give it a try. I absolutely 100% guarantee you will not like your first attempt. You probably won't like your second attempt either. What you see as my cockpit view comes after no less than 10 attempts to get it looking exactly like I want it. But remember that every time you fail, you learn a little more. Heck, there are a couple things I'm thinking about changing on this cockpit view.

Oh, and if you like the Star Trek looking "LCARS" view, guess where you can get that? Yep - HACS. I have a blog post about that coming up later.

Start making your views. Experiment and have fun. Learn how to nest grids and stacks inside other grids. It will make things look much better for you.

Until the next post...  rock on.


Wednesday, May 17, 2023

First Order of Business

First Order of Business

I was excited to get Home Assistant ("HA") up and running. A co-worker told me about HA as we were talking about an idea I had about weather alerts (and I'll cover that in a later post).

"What's this? You mean there's something out there that will actually allow smart devices from different manufacturers talk to each other and <gasp!> work together?" I was stunned.

My first decision was figuring out where I was actually going to run HA. It's not a Windows app. Probably everyone and their grandmother knows how to run a Windows app. HA, though, is a different beast.

Home Assistant Server Hardware

Probably the easiest thing you can do is get a Raspberry Pi and load HA on that. (If you can actually find them; they're difficult to find at the time of this article.) There are some things you need to keep in mind if you go that route, so make sure you research what's on the web for ways to make that work with optimum performance. The first thing I recall seeing is to use an SSD and not an SD card. The amount of traffic going to and from the SD card will eventually destroy it. SSD is the way to go, so I hear.

If you are a wee bit more technically minded, and you want to run HA in a Windows environment (kinda), get some Virtual Machine ("VM") software and run HA in it's own VM. Personally, I use Oracle VM VirtualBox. It's free and it does the job. The problem there, though, is you're assigning resources on a PC that you might be using for something else to running HA. And, if you want to really get the benefit of HA, like any server, it needs to be on 24/7. So in this case, it almost seems like you need a PC that you're not using for a lot of other things and that you're not going to mind having it running 24/7.

If you have a NAS, like a QNAP box, you can use that as a host for the server. But again, make sure you have the horsepower for the added traffic and disk I/O. My QNAP box is older, and there's no way I could get away with running HA on there.

One more thing I'd like to mention here is micro PCs. You've probably seen them in places like doctor's offices. Tiny little PCs that don't take up a lot of room but still have some horsepower. Those can be had on eBay for $200 or less - and they're usually a complete package. You could end up spending that much on a Pi, the case, the SSD, etc... so the question is, what makes more sense for you? My HA VM is running on the PC that I use for my ham radio activities and scanner programming, so it's not a big deal. But I might still think about the micro PC route some day.

Home Assistant Software

Once you've figured out your hardware platform, grab the software you need and follow the instructions carefully to get it installed. It's not like a Windows app where you just download and click the executable. There are going to be steps involved, and you're going to need to follow them closely.

Remember also that if you go the VM route, you're not going to find a lot of tutorials on the HA site about installing and configuring your VM. That's not what HA does. Yes, it's possible that you might be able to find someone on the forums to help you out. But HA assumes that you have a working knowledge of the hardware decision that you've made. If you're going into it with zero knowledge, you're going to be frustrated.

Installation Complete

At this point, you're probably thinking you're ready to fire the afterburners and head into combat.

Slow down, cowpoke.

Take the time to explore a little bit. I made the mistake of seeing this package, liking it, and installing it. Then seeing that package, liking it, and installing it. One after the other. Without taking the time to explore a little bit first. I got overwhelmed and tried to do too many things at once. I didn't break anything, but I ended up having several views and dashboards incomplete as I'd find another shiny object to try before I finished playing with the last toy I got out of the box.

Have an idea of what you want HA to do; what mission you want it to accomplish for you. I'm not saying that you need to have your plan 100% perfect, because guess what? Your plan in HA will NEVER be 100% perfect. It's a tinkerer's playground. But as you go along, at least have an idea of what you're looking for. It'll make things easier for you as you progress.

Until the next post...  rock on.


Monday, May 15, 2023

Introduction

 What is the "Blue Collar Home Assistant?

I'm not new to the world of technology, having worked for a living in some aspect of technology since 1980. (I cut my teeth on a TRS-80.) I even had an extensive X-10 setup in my home back in the early-90's, but that faded away over time (and several moves & a couple of marriages).

Enter today's home automation technology and the product "Home Assistant (HA)."

Before I stumbled on to HA, like many others out there, I had automation products from many different vendors that wouldn't talk to each other unless something like Amazon Echo, Google Home, or Apple HomeKit was used. But I didn't really find myself totally enamored with those products because loss of an internet connection meant loss of operations. Plus, they didn't offer a huge range of integrations and add-ons that I didn't even know existed until I installed HA. Things like being able to monitor the health of my NAS, for example. HA certainly helped bring my disparate technologies together!

But why "blue collar?"

Simply put - if you're not a programmer, or you don't have a programmer's mind, HA might be super frustrating for you. I found that out the hard way. I went into this not seeking to find people to do my work for me, but I DID want to learn. And if you want to really unlock to potential of HA, you need to be comfortable programming in YAML, using Jinja, and to be really slick, it helps to have some CSS knowledge as well.

That's not necessarily me. I'm InfoSec by trade these days, and any thoughts of doing programming has long since passed me by. I haven't done serious programming since the days of BASIC and FORTRAN. (Dating myself, right?) So to do some of what I was looking for, I either needed to read documentation that was sometimes rather lacking or out of date (as it can be in the open source world), or depend on folks to lend a helping hand at times.

While searching for help, I found a number of folks who were more than willing to give me a hand with some troubles that showed up. There were, however, several who scoffed at being burdened by helping the new and unwashed get up to speed and figure out how to do things with HA. I suppose they just picked it up by doing it or through osmosis, and perhaps they didn't see why others couldn't do that too. Here's a news-flash though:

Not everyone is cut from the same cloth.

Sometimes we all need a little help.

This won't be a super busy blog (at least I don't think it will be), and it's not meant to be an "ask me anything and I'll fix it for you" kind of repository. Instead, I intend to post some things about HA I've learned along the way from the school of hard-knocks. 

If you need general help about HA, there are many YouTube videos out there that can help too, so don't overlook that option. And AI - I actually learned a lot from ChatGPT while working on a project, and honest to goodness, that was one of the most patient and understanding mentors I've ever had. Go figure.

There's a Home Assistant Discord channel. It's flooded with information, but it can be difficult to find help in there at times. At least that's been my experience. While I have received some help in there, I've also seen (and been the recipient of) some of the snarky responses if you ask for assistance and it's something that was discussed x number of weeks or months ago. Or if you don't provide all of the necessary information right off the bat with your first request.

There's also the Home Assistant Community on the web. Again, tons of information out there, ripe for the searching. And in my experience, a bit more accommodating to the newer user.

Over here at The Blue Collar Home Assistant, I'll post what I've found to work and not work, some of my failures, and some of my wins. Maybe it will help someone. Maybe it will help nobody. But if I can help one of you find more success with HA, then I'll have done my job I suppose.

Rock on.

So Long Microsoft! Hello Pi!

Another one of the most stable things I did was ditching the VM I was using to run HA and go to a Raspberry Pi. I was using Microsoft Window...