Easy Two Dollar Magnetic Wall Mount for Google Home Mini and/or Tablet

Here’s a stable, cheap magnetic wall mount for a small tablet or a Google Home Mini. The big advantage to a magnetic mount is you can easily detach and reattach without any tools. In addition, for tablets, you can use them vertically or horizontally. The mounts have a surpisingly strong magnetic bond and are incredibly stable – I have been using these for a year with an Amazon Fire HD 7″ tablet and a Home Mini. For the wall plate of the Home Mini I used the bottom cut out from a tin can. For the Tablet I used a 1 gang metal plate bought from Home Depot. The metal plate is more attractive and has a stronger hold than the tin can but either will do these devices.

What you need:

  • Large circular Washer from Home Depot or other hardware supplier (not sure of exact part number but looks something like this, mine is 2″ in diameter and has “ASC” Stamped on it) (about 20 cents)
  • 1 Gang Metal Wall Plate or Bottom of a Tin Can (at most $1.60)
  • Large 1 3/4 inch Magnet (about 80 cents)
  • Sheet Rock Screw and Anchor
  • Super Glue

Installation

  1. Optionally paint the wall plates. Let dry well.
  2.  

  3. Attach the metal plate to the wall using the sheet rock anchors. The tin can just needs one screw, the wall mount has two. For a tablet, make sure you install the plate in such a way as to allow the tablet to be mounted or have enough space to orient it horizontally or vertically, the circulate magnet will let you do either.
     

    Tin Can

    Metal Plate

  4. Place the magnet on the plate (you can try superglueing it but I found that the magnetism holds it just as well and the super glue may come off as you can see happened on the tin can mount above).
  5.  

  6. Superglue the Washer to the back of the device.
  7.  

    Google Home Mini

    Tablet

  8. Done.

 
To keep the wires neat as possible and out of the way, I drilled holes above or below the device to run the cables behind the sheet rock to the wall outlet below. For the wall outlet I installed a USB outlet and a small saw brush plate above it (about $6).

One Line Linux Command to Kill Parent Process and Spawned Children in A Group

Computer Screen Photo by Markus Spiske on UnsplashIn Linux, if you’d like to kill a command and all processes spawned by that command do this (in our example the command “parent” is example.py):

This will kill the “example.py” process and anything that it spawned.

How it works:

To kill all processes of a group the command is

To get the group id you do the ps command using the arguments as shown, grep it for your command, but formatting example.py with quotes and using the bracket for the first letter (this filters out the grep command itself) then filter it through awk to get the second field which is the group id. The tail -1 gets rid of duplicate group ids. Yout put all of that in a variable using the $() syntax and voila – you get the group id. So you substitute that $(mess) for that -groupid in the kill command above.

Getting Home Assistant, Mosquitto MQTT, and CloudMQTT To Work Together Using an MQTT Bridge

Photo by Louis Reed on Unsplash

Photo by Louis Reed on Unsplash

I’ve been experimenting with Home Assistant (a home automation server) running the Raspberry Pi and have found the videos from Ben at BRUHautomation to be a big help. One thing I was having trouble with was getting MQTT to control both my sonoff outlets and track my devices. Home Assistant can apparently only use one MQTT Broker at a time. Ben uses Mosquitto when setting up the Sonoff outlets, but CloudMQTT when using Owntracks to track devices.

To get them both working at the same time with Home Assistant you have to join the two using a bridge. This thread helped but the steps I needed weren’t very clearly posted and summarized. Here is what I did that seems to work.

  1. Follow Ben’s video to setup Mosquitto MQTT and CloudMQTT (in that order).
  2. You’ll end up with your configuration.yaml file using CloudMQTT as its broker (we will later change this below).
  3. On the command line on your server, kill mosquitto, and then edit the /etc/mosquitto/mosquitto.conf file so it looks like this:
  4. Here’s a screen shot of CloudMQTT where you get the user and passwords for above:
  5. After editing start mosquitto. Note that I’ve commented out the log as that will force any debugging to output to the screen.
  6. Hopefully you’ll see something like this (rather than errors such as connection refuse, unauthorized, etc:

  7. Now, edit Home Assistant’s configuration.yaml and delete or comment out the the CloudMQTT broker under the mqtt section. Add Mosquitto as the mqtt broker:
  8. Restart Home Assistant:
  9. If you don’t restart, some of your devices may work but not all. Also, if you are still having issues of inconsistent response (e.g., I had one light respond well, but the other one wouldn’t go off), go to the command line make sure you are not running more than one instance of Home Assistant (pps aux | grep hass) – and if you are kill all of them and start only one instance.

  10. That’s it. Navigate to your Home Assistant control panel and test your local devices and your Owntracks tracking. It should all work.