Three Lights and a Ceiling Fan on One Awesome Controller Board – Internet All The Things!

This is a walk through of my lighting setup for my office/workspace/home gym. It uses a single ESP8266 Four-Relay board with Tasmota (and Home Assistant).

Cool Things:

4-Relay Aptinex ESP8266 Control Board

4 Foot LED – Fluorescent Bulb Replacement -Single End

Dual End (I have not used this brand, but they have great reviews)

Metal Button – Momentary SP Waterproof

HIGHLY Recommended Tools

Voltage Tester Pen – Klein

Multimeter With Case

Fancy Soldering Iron kit) (adjustable Voltage)

Rotary Tool Kit (‘Dremel’ Knockoff)

Other Featured Items:

Slimline Extension Cord

10 Amp Breaker Switch

Double Paddle Rocker Switch

5V + GPIO Single Relay

120VAC/240VAC to 5VDC (USB Charger)

120x80x65mm project box

Extra “Must Haves”:

In-Code 120V AC “Romex Cable

4 wire “Alarm” cable

Heat Shrink Tube

Locked in Quarantine in New Zealand

In a “State Facility” in New Zealand – AKA nice hotel paid for by the NZ Gov’t. Lots of rules but a small price to pay.

Editing video, studying NZ medicine. New Content will be up soon (tech stuff first).

Quarantine Command Center

Home Assistant + Supervisor + Pi4 + SSD Boot!

Introduction

I have spent an insane amount of time trying to learn just enough linux to get my silly setup working. I have a Raspberry Pi4 B running home assistant — yeah yeah, no big deal…. but booted off a SSD! This was actually hugely annoying to set up given conflicting instructions, deprecated and buggy install scripts, and dated instructions. However, it should work as long as I don’t fiddle with the operating system too much, as it is running out of Docker (that’s the point of Docker, as I understand it).

Not interested in the mess? Well read on, there’s something for you as well.

I think I got it pretty well figured out and with the recent announcement that they are resuming support for some parts of the install process, it will hopefully get a lot easier some day.

Home Assistant

For people who have no idea what I’m talking about: Home Assistant running on Raspberry Pi (or virtual machine on a windows or mac server) is the fastest, most full featured, and supported way of automating your home and adding all sorts of cool stuff to your network without using a cloud-based service that can cancel or alter the deal after you’ve purchased your products.

It is also free. Literally free, no fees, no “permission to run” it gets from the benevolent cloud like some IoT devices.

The Supervisor

Home Assistant is also typically paired with the most awesomest thing ever: the supervisor. It allows you to click on this “add on store” (how can they call it a store when everything is free? do they get paid in clicks and happiness??) and install programs with just a few clicks. Programs like DuckDNS (totally essential), NodeRed (so awesome fast and simple that this intro video made me install HA immediately for the first time 2 years ago), PiHole (a crazy fast, add blocking local DNS replacement), WireGaurd (a surprisingly easy VPN server to access your home network from anywhere), and MotionEye (a simple, fast, easy, low overhead security camera program). I literally started from a scratch install and had all my stuff going in minutes.

Why Spend the time “Learning” this simple software? I can just pay Google to turn my lights on!

It’s not that hard, Google et al spy on you, and they literally break your stuff you thought you owned.

For example, Nest (Google, now) notoriously did this when they sold their overpriced but otherwise great “smart” thermostats under the guise of having them compatible with most any automation system, only to later lock down the entire thing months or years after purchase. I spent $400 on two thermostats which, though they paid for themselves in energy savings, required me to create my own totally cludgy solution using community code (that broke periodically) to get it to do presence detection and other stuff the way I wanted it to (I used this because I’m hooked on PHP).

To put it simply: You do not own your smart devices if the parent company can brick them at any time.

Home Assistant has been the main open source alternative for years, the irony I suppose is that the fact it’s not a product of a big tech firm probably ensures its longevity better. Mp3s pulled off Napster in 1999 (or ripped legally from Hanson’s first album) still run on nearly every telephone on Earth, iTunes first DRM FairPlay runs on exactly nothing and can only be upgraded while Apple allows it.

Disclaimer and a Wise Alternative To My Install Method

For newbies, I would really just recommend just using the very simple standard install instructions and probably a fast SD card. If you want to use a Windows or Mac and no Pi, you can run in a VM like I did for 2 solid years using this guide.

But Why Though?

Why SSD instead of SD?

  • Faster: For operating systems and running programs with multiple files, SSDs are exactly one bajillion times faster.
    • Here is a video demonstrating the speed difference — I had this guys same VM setup on an 8th Gen Intel i7, I changed to a Pi4 with SSD and I do not notice a significant difference.
  • More Reliable: Software tomfoolery aside, SD cards are NOT designed to write or modify files a million times a day — SSDs are far better. All hardware fails, SD cards fail far faster when you use them in ways they are unintended.
  • e-Peen: The fact that my Linux-only single-board ARM-based server running this functionally identical open source software is also on a solid state drive makes me literally better than all other humans and most dogs.

Biggest Road Block (Pi 4 hates SSDs… for now)

By far, the biggest deviation from the standard installation instructions is convincing the Pi4 to boot off the SSD. HassOS, while clearly the best way to do HomeAssistant for most people, definitely does not support this and may not even do well on the Pi3.

Therefore, you are very limited in which operating systems you can use. Personally, I used Raspbian Buster Lite combined with Docker.

What Not To Do

Here are some things that I have tried (as of June 2020…. some day these may work):

  • Buster Lite install with boot partition pointing to HassOS
    • LOL no.
  • Buster Lite using beta firmware which allows for NATIVE SSD boot
    • Seems pretty great, but I could not get Docker (specifically, container.io) to Install
  • Berry Boot
    • No HassOS support

I Want One, But How?

  1. Change your clock to Venus time so you have 2800 hours in a day, you might get it done in an afternoon!
  2. Follow this guide exactly (!!), from start to finish (easier than it looks). Here is a summary
    • Buy Stuff:
      • Raspberry Pi 4 with a good power adapter and a decent case with good cooling
        • Case: I tried this one but the fan failed and I cried. So then I used this one (highly recommended)
        • Pi 4 : I used this one (note : if you get the recommended above kit and this you will have an extra power supply, both of which are very good).
      • SD card – slow, small (8Gb) and cheap is fine but EVERY boot will require it for a few seconds so get a decent brand
      • Just about any SSD
        • I used this one. Probably a good idea to get a bigger one if you are going to do a lot of security cam footage or media server.
      • Compatible SATA to USB 3 adapter
        • I used this one. I love these.
    • Copy Raspian buster Lite to SD card AND SSD card – use same version
    • Boot partition of SD and SSD: Make sure your wpa_supplicant.conf is done correctly and placed in the root of the “boot” partition if you are using wifi (but WHYYY use wifi)
    • Boot partition of SD and SSD: Make sure your “ssh” (blank file) is placed in the root of the “boot” partition unless you have a keyboard and monitor hooked up to your pi
      • Fun fact: the default keyboard and localization settings of the pi through “raspi-config” are setup for space aliens so half of the special characters you need for the linux commands cannot be executed on ‘murican keyboards. This cost me much time to fix. Just use SSH.
    • Change PARTUUID for the SSD (a unique ID the thing OS uses to identify the drive on boot, I guess it usually matches the SD card so you gotta change it to make it identify it correctly)
    • Change a text file on the SD card that points to what drive to boot from
    • Change more boot information (“root” location) on the SSD to point to the SSD
      • Funny story: I skipped this step the first time and it still worked. It was probably slower though. I like stories.
    • Resize the partition on the SSD to take advantage of all the space
  3. Important: once booted into buster lite (yay!), login to the pi via ssh (probably use PuTTY, port 22):
    • Login is pi, password is raspberry
    • Change password Type passwd, follow the prompts (make sure to forget your password so you have to start over
    • Type sudo raspi-config
    • Change your time zone and make sure it knows where you are in the world
  4. Follow this guide starting from number 7 (READ BELOW FIRST)
    • NOTE 1: This install method says it is not supported but they are resuming support soon. Trust me, it works perfectly for everything most people (I think) would use HomeAssistant for, and it’s unclear if it has any limitations at all on Raspbian buster Lite. (explained here)
      • “HomeAssistant” should actually run great from what I’ve read as it runs through docker in this install (docker allows for a “familiar” environment on all linux distributions). It can be updated without breaking, restarted, etc.
      • The main issue (based on my limited understanding from their post) is that “supervisor” which allows you to do all sorts of crazy cool stuff like install Node Red, DuckDNS, PiHole, MotionEye, MQTT, and a bazillion other things has to dive into the OS to get access to stuff, and it might not know the deep end from the shallow end, plus there could be a user sitting at the Pi watching cat videos off a USB device that it wants to use for some Add-On.
    • NOTE 2: On step 16 you end up running the super unhelpful helper script that does like 90% of the work for you. This is not supported (or is it?) and in expressing that they broke the script in the version I used. I would recommend trying it but if you have problems, read on. Here is what I ran into and how to fix:
      • If you get to the the command
      • curl -sL https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh | bash -s -- -m raspberrypi4
      • And it says something like please typ "not supported" but does not pause for the prompt (and instead: does nothing), download the script, delete the prompt, and have a big party:
        • Instead of the above curl command, type these commands ( you should have done sudo -i at this point):
        • cd ~ (goes to pi’s home directory just to make sure we’re in a safe space)
        • curl -sL https://raw.githubusercontent.com/home-assistant/hassio-installer/master/hassio_install.sh > hassio_install.sh (downloads script)
        • nano hassio_install.sh (edits)
        • Remove lines 15- 21 which should look like this:
        • echo 'Please typ "not supported" to continue this installation'
          read x
          if [ "$x" != "not supported" ]
          then
          echo "OK, bye!"
          exit 1
          fi

        • Save and close the document (says how at the bottom of the screen, I forgot the buttons)
        • Type this to actually run the thing:
        • cat hassio_install.sh | bash -s -- -m raspberrypi4 (replace italics with your pi model, or just replace your pi model)
        • Don’t forget to finish step 16 (from guide):
        • journalctl -f -u hassio-supervisor
      • NOTE 3: Follow the steps exactly. You can paste the commands into PuTTY by doing Shift+insert. Do them in order as well. If you change your network settings after network manager, for instance, it gets really annoying.
      • Summary of steps in the guide (starting from number 7):
        • SSH into your pi
        • Change your IP/DNS settings – DO THIS NOW AND DO NOT SKIP OMG!
        • Update everything and install VLC for some reason
        • Install Docker
        • Install all of HomeAssistant’s other dependencies (so very dependent, it is)
        • Run the hopefully working (see above) install script, or fix it then run it
        • Please note the numerous reboots (sudo reboot) and updates (apt-get update) and upgrades (apt-get upgrade) and cleanups (apt autoremove) interspersed throughout.
        • type the url into your web browser http://[your pi's ip address]:8123
        • If you can get through the setup process within Home Assistant and you see the “Supervisor” thing in the left column, it should all be gravy.
        • If your addons or some of the side links do not work or install, from my experience you messed up step 11 where you did not enter your network settings correctly. You are so on your own, but you’ll have to look up how to change it in “Network Manager” which you just put in charge of all your network settings for the Buster OS in step 16. Change it through SSH.

Conclusion

Everything has been insanely stable and perfect for about 3 months now. Running Motioneye (VERY easy to install through Home Assistant – just some clicks!) with 5 security cams. All my Tasmotas added automagically. I am extremely happy.

Just Getting Started

Just getting started with all the fun. Leaving for New Zealand in 12 days!

Finishing up and publishing all my technical projects–leaving it all behind.