Creating a floorplan for, well, Floorplan (Home Assistant) using Sketchup

Standard

Floorplan has a great guide to get started and add it into an existing HA installation. The part I struggled with the most was how to actually create my floorplan graphic.

The HA community suggests using Inkscape to create an SVG for this purpose, which is great and is very useful for adding entities, but doesn’t seem to be very easy to actually create the floorplan itself.

Background:

I’ve been playing with the Sketchup application for a few months now. Mainly to design plans for woodworking projects that I want to build. During this learning process, I ended up jumping down a rabbit hole and designed a layout of the bottom level of my house.

With all of the work I put into this design, I thought it would be great if I could take that image, convert it to SVG and use it as my floorplan in Home Assistant. Unfortunately, Sketchup does not have a way to export to SVG.

Solution:

There are a multitude of ways to go about creating floorplans, even out of Sketchup. For the purposes of this post I will focus on what I find to be the fastest and easiest method. The resulting SVG size will depend on the size image you embed, but I went from about 18KB with a very bad wireframe wit no color to about 800KB with several icons and the background image. YMMV.

  1. Create a floorplan in Sketchup.
  2. Export your floorplan as a PNG file and save it somewhere you will remember.
  3. (Optional) – Open the image in an editor such as The GIMP to remove the background and crop the image.This also cuts down on size of the final SVG (I went from 1.4MB down to ~700k)
  4. Open Inkscape
  5. Go to the document properties
    1. Set Display Units and Size Units to Px
    2. Set the Width and Height as desired (for me, I’m using 1024×600 – the resolution of a 7″ Fire Tablet)
    3. Ensure Scale = 1
  6. Create a new layer on your project. Let’s call it “Background”.
  7. Browse to the file location of your exported floorplan PNG
  8. Drag and drop the PNG into Inkscape.
  9. Review and modify the default import settings to your liking (or accept the defaults), and you will now have an image layer in your SVG!
  10. Drag the image around to position it as you prefer
  11. Create a second layer for your actual entities
  12. From here, you can take any SVG icon (or make your own), and import them into this design using the same method as the PNG import. A great resource for SVG icons is The Noun Project.
  13. To wire up an entity to an element on the image,
    1. Select the object
    2. Open Object properties
    3. Set the ID to your entity_id (e.g. sensor.light) This must match the entity_id in HA.
    4. I typically set the Label to match the ID, as it makes it easier to track down objects in the list later.
    5. Click ‘Set’. Don’t forget to do this! It will cause much pain during troubleshooting 🙂

At this point, you’re ready to upload your SVG to Home Assistant! If you haven’t done so already, be sure you’ve completely followed the Floorplan Installation Instructions.

 

Adventures in Home Automation – Choosing a system

Standard

Home automation has sure come a long way in the last 10 years. Where there used to be very specific use-cases for an automation system, there are now dozens of off-the-shelf devices, ecosystems, open source projects, and it can be very overwhelming to make a decision about what to use.

Through the years I’ve tinkered with different systems, mainly the more DIY ones simply because I enjoy doing so, but also because of the cost of entry of the retail systems. I started getting much more serious about my home ecosystem when I bought my current house a few years ago and it came with a Wi-Fi thermostat. This was when Nests were barely a thing.

The thermostat in question is a 3M-50 branded by Filtrete. My initial excitement grew as I did some research into this thermostat. It’s got Wi-Fi, and uses an open protocol called Radio Thermostat. I thought “Hey, it’s open, that means that most open source projects will probably support it!”. This is where I hit a wall. The one real “smart device” that I owned didn’t seem to be supported by anyone outside of an android app and the Filtrete web page. This came down tot he extent that you can’t even set up a 7 day program on it unless you create a cloud account with Filtrete.

All the same, I stayed plugged into the major HA hubs at the time, mainly Home Genie and Open HAB. As time went on I started looking at the off-the-shelf systems more and more, wondering if I would be better off just purchasing a system from Insteon or Honeywell and succumbing to ecosystem lock-in.

One day I was doing my semi-irregular Google-fu looking for Radio Thermostat support and came across a much newer open source project called Home Assistant. It seemed to be pretty fresh as far as the technology went, and was a bit rough around the edges, but somehow they had built in Radio Thermostat support when no one else did! I quickly set up the software on one of my Raspberry Pis and began to tinker. It only took about an hour before I had a local web page set up with my thermostat display and control. I was hooked!

Fast-forward a few years, Home Assistant has a great (and quite large) community of followers. I’ve expanded my little Pi-based system to include dozens of automations, presence detection, alerts, camera feeds, and more! The best thing about using Home Assistant (or any other FOSS project for Home Automation) is that it’s device agnostic. If I had bought into Insteon, Nest, or WeMo – none of my devices would have communicated with each other, and I would have multiple device hubs set up by vendor.

So: If you are in the market for a home automation system, don’t mind doing some tinkering, and have some understanding of how to set up and configure applications (a bit of programming doesn’t help either), then I suggest taking a look at Home Assistant.

If Home Assistant isn’t your thing, then here is a list of more options that you can consider.

Platform-agnostic (Supports Z-Wave, ZigBee, MQTT, etc.)

Off-the-Shelf

  • Insteon (Electrical, Thermostat)
  • Nest (Thermostat, Smoke/Fire, Security)
  • WeMo (Lighting, Switches, Outlets)
  • Phillips Hue (Lighting)
  • Smart Things (Seems to handle ZigBee and Z-Wave devices, but I haven’t used it)

 

Home Automation – The Beginning

Standard

I’ve been interested in technology ever since I can remember. It’s amazing what computers can really do for us. Back in the early 2000’s, I remember a project called Pluto Home that first really exposed me to the idea that home automation could be possible. At the time, Pluto Home was it’s own Linux installation. It was clunky, required specific hardware to run, and it was vendor specific. That was almost 15 years ago.

Today, there are multiple options – OpenHAB, HomeAssistant and HomeGenie, just to name a few. I’ve played with more home automation hubs than I can count, and have really settled into using Home Assistant.

If you’re not familiar with Home Assistant, it’s an open source project running on Python that allows you to set up your own home automation solutions with a vendor agnostic approach. It’s got a great community behind it. They are also adding new integrations on an almost bi-weekly basis. It’s amazing!

I’ve been using Home Assistant for about 18 months now, and while I consider my setup still pretty rudimentary, I figured I should start documenting my journey.

My current automation project contains the following (As of 9/23/2017):

  • A wifi-thermostat (came with the house, and was a big driver why I chose Home Assistant)
  • A home-built garage door relay/sensor switch to operate remotely.
  • 7 Smart Bulbs (IKEA Tradfri)
  • 2 Notification systems (Slack, and Kodi Notify)
  • Multiple Presence detection systems (Steam, Router/Wi-Fi, MQTT)
  • Current Weather Conditions
  • ZoneMinder Security Cameras (View and Notification of Motion)
  • A RainMachine Mini 8 Sprinkler Controller
  • Amazon Echos for Voice Commands
  • Display of my UPS information
  • SpeedTest.net results every 30 minutes for trending
  • An SNMP Bandwidth Monitor
  • A tablet interface using Floorplan

As time allows, I’ll be updating each of the components listed above with an in-depth look at how everything is being integrated into Home Assistant. I’ll also add new components to the list as I integrate them.

Upgrading to Team Foundation Server 2013 Update 4

Standard

Team Foundation At the company I work for, I am the primary TFS administrator. Overall, I think TFS is a fantastic system. Updates come out quarterly, and are – in general – painless to install.

Update 4 went in easily on our test TFS server, and no issues were discovered. We went ahead and pushed the update to our production server. Everything went fine (though the install seems to always take longer, even though our databases are pretty small). I was in the process of upgrading the build machines when I noticed that the build services had upgraded fine, but none of the services had started.

I spent several hours trying everything I could think of to get the services to start, but they wouldn’t work. I tried reboots, unregistering the services and reading them, using different service accounts, and adding the account to every TFS and Built-In group I could find. I finally narrowed it down to the build service account, my account ran the build services fine. That’s when I started looking closely at the permissions given to the account. Everything listed as Inherited Deny.

There were no groups that had Deny privileges, so I was at a loss. Finally, I came across a forum post on the Microsoft support site that explained the issue. in update 4, the licenses were changed, and the stakeholder license was added. Apparently if this is the default license for users, then the service accounts are pushed into this access level, which disables functions they need in order to do their jobs.

Once I added the build account as a Basic License, everything began running correctly again.

System.Diagnostics.Process.Start Exit Code returns 255 in Mono

Standard

I have been doing some incredibly deep work with inter OS services written in C# for ease of support at work. I could get into the reasons we are using Mono, but I will just cut to the chase.

I was executing a shell script using System.Diagnostics.Process.Start(), and always received ExitCode 255. After a bit of research, it sounded like 255 meant that Mono was unable to start the process.

I added !#/bin/sh to the top of my script, and viola! Exit code 0 (success)!

Disclaimer: The script I was running was not written by me. I try to make a habit of adding the executable line at the top by default.

]]>

Installing Linux on a new Windows 8 Laptop

Standard

I recently purchased a new laptop (Lenovo Y400 for those that are curious, I may do a writeup on it in the near future). As is my habit, immediately upon receiving it, I booted to a windows 8 installer, deleted every partition from the drive, then recreated a windows partion with 75% of my drive, so I could dualboot linux. 

Everything seemed fine, but when I went to install Linux, i ran into some really odd issues, that I hope I can help people avoid in the future.

 

]]>

PDF Files do not download from PHP running in IIS

Standard

Very short “I Fixed It” for today. A client of mine moved a Concrete 5 site to his new IIS server, and all PDF files stopped working. He spent several day siwth his web host troubleshooting the issue, and finally asked me to take a look. It turns out that the php configuration zlib.output_compression needs to be set to Off.

Setting this in the PHP.ini file, I was able to get IE and Firefox browsers working, but webkit (Chrome and Safari) still failed to work. I put the line ini_set(‘zlib.output_compression’,’Off’); in the index.php file of the site, and problem solved!

I am at a loss as to why this was actually happening, but everyone is now happy!

]]>

Node.JS and PHP Part 2

Standard

In the previous article, we laid the groundwork for a Node.JS broadcast server. Now that it is working, the next step is to throw some PHP into the mix. We will begin by creating a PHP script that will post to our Node.JS server. Once that step is complete, it is just a few lones of code to complete the script, posting to PHP and returning the result!

]]>

Node.JS and PHP Part 1

Standard

It was recently suggested to me to try out Node.Js and websockets to replace some ajax calls I was using in a web app. After scouring the web for a few hours, I realized that I would have to compile forum knowledge and my own experimentation due to the lack of any actual getting started articles on this subject. I decided that I would document all of my efforts and post them here. This is the first article in my tutorial series on setting up Node.Js, Socket.IO and PHP in a simple socket application.

]]>

Organizing Photos

Standard

My wife and I were going through pictures on her camera card today, and she made the comment that she isn’t patient or organized enough to sort all the images by year and month, so I built a small php script to handle this for her.

This script is a bit limited, but it needs to reside at the same level as a directory named ‘unsorted’. It will go through all images in the unsorted directory and create directories for each month and place the pictures in them, based on the date the picture was taken. Right now this is only set to work for 2012, but I promise I will expand it to work for all years. 

This script also requires PHP and the EXIF extension to function. When I get a bit more time and the script perfected, I think I will port it to a windows executable so it can be downlaoded and run without extra requirements.

]]>