Home Assistant: A Few Weeks Later

I can't remember the exact date, but I do know that it has been at least a few weeks since I started using Home Assistant. And, I'm impressed. It has gone down quite well.

The biggest thing is, my wife notices when I take/move the laptop running it. Which means it is getting used. While she primarily uses it for the time, it nonetheless means it has value in our house.

I also use it to control the lights and do monitoring from my phone. And that is actually even more surprising to me. I paid a bunch into Hue Essentials and rarely go into it. I think the difference here is twofold. I can control the layout, and it gives me access to more than just lights.

Hue Essentials is a great app. But, I open it, I just get a massive array of light buttons not laid out in any particular order. It takes time to find and work with one and even longer if I need to deal with multiple. With Home Assistant, I've linked a URL to the specific page in HA I use most and it is laid in more a logical fashion. Similarly, the original Hue app always feels slow and requires too many clicks to get what I need done.

The second point is even more obvious. Those other apps are JUST about my lights. And while that is an important part of my smart home solution, being able to scroll a little further and see my Nest cam is great. Then I can flip to another denser page if I'm interested to check on weather and house temperature. I can see how the server memory and CPU are doing and even check what the latest detection from my TensorFlow setup is.

Short version of the story is pretty darn simple. I'm using this a lot more than I thought I would.

As such, it has made a few transitions. And that is worth talking about a bit as well.

It started life as Hass.io on my Raspberry Pi 3b+. I set it up, plugged it in near the router and let it run. As it started to grow on us, I started doing some research. I quickly hit two fears; processing power and SD card corruption. The more research I did, the more things I wanted to add. The more things I added the more it became apparent that the Pi couldn't handle all of this gracefully. I shudder to think what TensorFlow would do to the Pi. And next was, reading up on corruption of the SD cards. It is REALLY hard to get a solid scientific answer with some people claiming they ruin theirs every other week and some claiming to run years off of even the worst offending Pi hardware.

Whatever the reality of the corruption issue, it seemed like I needed to move it to new hardware anyway to sate my desire for features and integrations. And that created my first pain point. I've never really had any experience migrating something like this. But, it was actually quite easy. I copied the configs, dropped them in place in the new setup and I had to re-authorize a few things and point my UIs at the new PC. But, all in all, I would the migration was done, end to end, in under 15 minutes thanks to Docker.

That second device migrated to was my desktop. It lived there for a little more than a week. Even though I don't think it drastically impacted my energy bill, the truth is, that was overkill. I went from a Pi to 16 core AMD processor, with GeForce 1060 and 16GB of RAM running on an SSD. Needless to say, aside from when TensorFlow ran, CPU stayed in the low single digits. And while, depending on the model used, TensorFlow could push it up to 100% for a few seconds, the more taxing models didn't really yield value over the models that only pushed the hardware to 40%.

So, enter the 3rd HA server. My laptop. This thing is already always on as a display for HA now. It fits in nicely hardware-wise between the Pi and the desktop. It is an older mobile i5 with 4 cores, 8GB of RAM and an SSD. I had been seeing some (what looked like) memory leaks on the desktop which don't seem to be there on the laptop. So, it is running well. The CPU stays in the high single to low double digits. The weaker processor and lower core count means that the same TensorFlow model that only hit 40% on the desktop hits 100% for a second or two on the laptop, but is easily finishes within an appropriate window and isn't causing any noticeable issue.

Really, all I need there now is a Samba share pointing to the configs so I can modify things remotely and also to access the images I have TensorFlow outputting upon detection. It outputs 2 each time, one overwrites an image which is used as a local image camera in HA, and then I have a timestamped version in another folder which I review and delete regularly.

The last thing is how what I've used it for has changed. I have trimmed down the number of devices over time and improved a number of them as well.

First, the major improvement; the nmap tracker defaults are terrible. This thing would basically report us as intermittently being out of the house at least once ever 5 minutes. None of the devices I care about turn off WiFi, so it SHOULD have been accurate. I increased the host timeout on the nmap call it makes, decreased the frequency so the job itself wouldn't timeout as quickly, and increased by a small amount the time it takes to consider us away.

I also had setup and subsequently stopped using alerts from detections on TensorFlow. I may set them back up for when we're gone on extended trips. But, there were two problems; Nest images only update every 6 seconds, and the movement detection is unreliable. In short, to use it to truly monitor security I basically need to setup TensorFlow to run every 6 seconds or as near as matters. And, when I did that, on my desktop at least, TensorFlow would hit periods of non-functionality and my logs would blow up with all sort of errors. TF seems more stable on the laptop, but it would also be running quite hot if it remained stable because it would be basically pegged at 100% CPU all the time.

In short, when I try and use Nest as a security system to push data on activity to TensorFlow, it often misses the event because I either get NO motion detection event, OR it is late. TensorFlow itself is decently reliable. WHEN it gets an image with something to detect within the bounding boxes I have setup, I would say it gets it done 90% of the time. And it is winter here right now and people are all wearing massive clothes which make them look non-human, so I think the detection rate will improve with the weather.

And, at 90% accuracy, IF Nest could accurately notify me when there was movement in a zone, then 6s intervals for just that time frame would actually be fine most likely. Watching my wife in the snaps dropping my daughter off and coming back from school, she always ends up in 2-3 pictures within the box. In short, it would pretty much always detect her. In fact, right now I have the Nest running, only every 20s, which means I see only every 3 and 1/3 pictures from Nest. And I still get at least one snap of my wife every day, and usually 2-3.

Right now though, the bounding boxes are too large for a timed process. I get 40-60 events a day right now judging by my output folder because it includes part of the sidewalk. Which is why the nest motion events would be critical if they actually worked. And why, if I went on vacation, I would need to reconfigure if I wanted to get alerts. If I went on vacation I'd probably use smaller bounding boxes, but polled at every 10s. That is slow enough to leave some breathing room for the PC, but fast enough that I would get every other Nest image processed and sometimes even back to back images.

As for trimming down. I cut out the Chromecast devices. We don't cast often enough, without more tinkering we can't send music to the devices, and we never turned to the app to turn them off. Same goes for OnHub integration. And I think there was one other one I killed.

The only real shame is, without the Chromecasts, some rooms have just the time and a light switch. They feel rather lame.

Anyway, this post is uber sized. And now, even I'm unlikely to re-read it all again. But, it is done.

Comments

Popular Posts