Not long ago I became interested in Home Automation. This occurred as a result of making plans to add some more living space to my house. I figured if I was going to spend some money on my house I should add some new capabilities as well. I found out about Home-Assistant and was intrigued by the idea of being able to integrate disparate manufacturer's devices into the same mix along with being able to control them from the same source. The problem with going to any one vendor is that they want you in their ecosystem; hence when you have many devices you end up with say many apps on your phone. I wanted to do everything with one, or do it by voice, but be able to pick and choose what device I want where. The war between Insteon and Z-Wave be damned.
So here is the brain-fart. I have a Subaru Forester that has a set of HomeLink buttons on the auto-dimming rear-view mirror. I don't have a garage, but I do have a porch with lights. So, my first interaction was to add a Chamberlain light switch to the porch lights which I can command to go on and off from one of the HomeLink buttons. Now I can turn on the porch lights when I get home late, and turn them off when I get in the house. That was very little effort and I did that before I decided to go into Home Automation. I removed a dimmer switch to put in the Chamberlain light switch. I miss the ability to dim the lights on the front porch. Why can't I have both a dimming capability and a HomeLink turn on and off ability. In fact, why can't I use the HomeLink buttons to key off a "scene" like turn on the porch lights (if it's dark outside), turn off the living room lights, lock the door, set the alarm, wait for x minutes so you can get out of the driveway before turning off the porch lights? Then, when I come home I just use a different HomeLink button to do the reverse? Hence my desire to integrate something into the Home Automation sequence using HomeLink.
I was able to locate / buy a Liftmaster 850LM switch which has the ability to integrate with the HomeLink switches and garage door opener remote controls. Normally it is used to control a garage door, but interestingly enough, I can sense the latches with an ESP8266 / Arduino / Raspberry Pi (take your pick) and push out the state of those latches using MQTT to the Home Assistant automation platform. If I want, I discovered that the 850LM can run on as little as 9 volt DC input. The Adafruit 757 bi-directional logic level converter has a max input on the high side of 10 volts which means that I could go through the 757 from the 850LM to whatever device I want to sense the state change. I can then use the chosen device to use MQTT to send state information changes to the Home-Assistant center. If I am real smart I can use a length of time timer that a HomeLink button is held down to increase the number of different states that I can report and if I use an RPi with Docker I can do other things at the same time. Oh, and two clicks within 1 second would give me a third level, but let’s not get ahead of ourselves. Anyway, it's worth investigating.
So now to get from Brain-Fart to working system.
This is a blog mostly about techie things, what I am doing to my apartment network on the cheap, IOT, 3D Printing, Raspberry Pis, Arduinos, ESP32, ESP8266, Home Automation, Personal Weather Stations, Things That Go Bump in the Night, and some side issues that need discussing. Remember, sometimes the journey to an end is as much fun as the goal achieved!
Thursday, July 12, 2018
Monday, July 9, 2018
OVS Changes #4 - Spinning up a Remote Z-Wave USB stick and Connecting to Home-Assistant
So over the weekend I was able to set up a Aeotec Z-Wave USB stick server on a Raspberry Pi using the instructions at https://community.home-assistant.io/t/rpi-as-z-wave-zigbee-over-ip-server-for-hass/23006. It was a piece of cake getting it installed and running under systemd. Now I have to set up a client and attach it to my running home-assistant.
TBD.
TBD.
Sunday, July 1, 2018
Project #14 - Add Home Automation to the Network
I have been getting interested in Home Automation and setting up things so that I can automate some lights. In addition, I would like to have the ability to lock doors, look at camera feeds, etc. from a single source.
Saturday, June 30, 2018
OVS Changes #3 - spinning up Home Assistant in a Docker Container
Now that I know how to connect a Docker Container to a specific bridge through the OVS, it's time to spin up an example. I am trying to get into Home Automation and I have settled on the use of Home Assistant (http://www.home-assistant.io). I am going to be reporting more on the use of this controller since it will pretty much control what I do within my house.
I have settled on the use of Z-Wave Plus components throughout the house because of the added distance and mesh connection improvements. Home Assistant gives me the flexibility to connect to all sorts of things that normally don't go together because you know business. Every company out there wants to do there own thing and control the whole market. I'm not buying it if I can't use it with other companies products that have a capability I want.
I am going to first spin it up on the Experimental vlan until I am able to configure everything the way that I want. I am intending on using OVS to connect ways of having devices on separate vlans and integrating them within the home system. Anyway, that is the plan.
According to https://www.home-assistant.io/docs/installation/docker/, I have to do the following on Ubuntu:
$ docker run -d --name="home-assistant" -v /path/to/your/config:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/home-assistant
Update: well that didn't work out as planned. I sent the following commands:
$ docker run -d --name="home-assistant" -v <my_HA_directory>:/config -v /etc/localtime:/etc/localtime:ro --net=none homeassistant/home-assistant
$ ovs-docker add-port <my_ovs_bridge> eth1 home-assistant --ipaddress=<home-assistant-ip>/24
What I ended up with was the home assistant available on every vlan that was in the ubuntu server. I only want it on the <my_ovs_bridge>. So what do I do to get it there?
I have settled on the use of Z-Wave Plus components throughout the house because of the added distance and mesh connection improvements. Home Assistant gives me the flexibility to connect to all sorts of things that normally don't go together because you know business. Every company out there wants to do there own thing and control the whole market. I'm not buying it if I can't use it with other companies products that have a capability I want.
I am going to first spin it up on the Experimental vlan until I am able to configure everything the way that I want. I am intending on using OVS to connect ways of having devices on separate vlans and integrating them within the home system. Anyway, that is the plan.
According to https://www.home-assistant.io/docs/installation/docker/, I have to do the following on Ubuntu:
$ docker run -d --name="home-assistant" -v /path/to/your/config:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/home-assistant
Except in my case I need to have the container attached to a specific OVS bridge, so:
$ docker run -d --name="home-assistant" -v /path/to/your/config:/config -v /etc/localtime:/etc/localtime:ro --net=host homeassistant/home-assistant
Update: well that didn't work out as planned. I sent the following commands:
$ docker run -d --name="home-assistant" -v <my_HA_directory>:/config -v /etc/localtime:/etc/localtime:ro --net=none homeassistant/home-assistant
$ ovs-docker add-port <my_ovs_bridge> eth1 home-assistant --ipaddress=<home-assistant-ip>/24
What I ended up with was the home assistant available on every vlan that was in the ubuntu server. I only want it on the <my_ovs_bridge>. So what do I do to get it there?
Thursday, June 14, 2018
I've gone overboard with the SD Cards
I was sitting at my kitchen table last night getting all of my RPi SD cards organized. I just realized that I have gone overboard - I now have a total of 70 plus cards that do various things and are in various levels of completion. Do you think I have a case of hoarder fever? Must needs to reuse cards that I haven't touched in a while. I know it is that many cards since I have all of them numbered. Good grief!!
Sunday, May 13, 2018
OVS Changes #2 - getting Docker containers to attach to the OVS bridges
Now that I have been successful with KVM VMs and their connections to the OVS bridges, I need to figure out how to do much of the same thing with Docker containers. One of the reasons that I run ubuntuServer is because it is very easy (so they say) to get Docker containers running. So now, what I am going to attempt is to startup a Docker container attached to one of the OVS bridges, used on a pfSense KVM VM.
So according to the site, http://containertutorials.com/network/ovs_docker.html, I have to do the following steps:
Install OVS (already done on my system) -
Install OVS-docker utility (already done on my system) -
Create an OVS bridge (already done on my system, except the bridge doesn't have an IP address) -
So according to the site, http://containertutorials.com/network/ovs_docker.html, I have to do the following steps:
Install OVS (already done on my system) -
Install OVS-docker utility (already done on my system) -
Create an OVS bridge (already done on my system, except the bridge doesn't have an IP address) -
Create the docker container
Connect the container to the OVS bridge, such as
$ ovs-docker add-port ovs-br1 eth1 <container_name> --ipaddress=<ip_address_for_container>
OVS Changes #1 - Updating the ubuntuServer to use OVS bridges
One of the things that I wanted to do with my network was to be able to access multiple vlans while I was away on trips or from the office. I hit upon the use of OpenVSwitch (OVS) as a means of connecting an Ubuntu VM running under VMWare on my Windows 10 laptop. In addition, I wanted to be able to run a set of Docker containers from my Mac Mini server and have them connected to the ubuntuServer. So, in effect I have a SDN within my house that can be connected to through my VPN server.
I had setup bridges to multiple Ethernet ports using the following template:
I had setup bridges to multiple Ethernet ports using the following template:
iface <ethernet-port-name> inet manual
auto <bridge-name>
iface <bridge-name> inet manual
bridge_ports <ethernet-port-name>
The setup is in a number of bridge definition files located in /etc/network/interfaces.d/; one file per interface. The only template that is in /etc/network/interfaces is the one that I have for my day-to-day network activities. Again, I separate out vlans for different purposes making sure that the vlans do not talk to each other except in controlled instances.
What I did to use an OVS generated bridge was to remove the bridge definition file from /etc/network/interfaces.d/ and then delete the previous bridge using:
and then perform the following command (note the ovs addition to differentiate it):
sudo ip link set <bridge-name> down
sudo brctl delbr <bridge-name>
sudo brctl show
and then perform the following command (note the ovs addition to differentiate it):
sudo ovs-vsctl add-br <bridge-name-ovs>
sudo ovs-vsctl add-port <bridge-name-ovs> <ethernet-port-name>
sudo ovs-vsctl show
sudo ovs-vsctl show
Which is done for each port that I have defined, except for the day-to-day port. It turns out that you can use the Virtual Machine Manager to pull up the VM, reset the bridge designations from the pull-down list, hit apply, then launch the VM. Works very well with pfSense. The interesting thing is that the <bridge-name-ovs> will now show up in an ifconfig command, where as before (when first created with OVS) would not. Also, there are now tap devices that show up in ifconfig, like macvtap0 and macvtap1. Those correspond to the tap device attached to the KVM VM; created from the use of Virtual Machine Manager. I still need to figure out how to do this with Docker.
Anyway it works! I am able to pull up the VMs on the correct vlan now.
Subscribe to:
Posts (Atom)