Smart Home on Wheels

Well that turned out to be useless. Instead, I’m going back with building an Ubuntu box with openHAB and Plex Media Server and some kind of NAS or RAID setup. I found a few places that have mini-ITX boards, and through more searching, I found I can get a power supply that runs off the DC power of a car battery. Some have regulators that turn the computer on when the ignition is turned on, but I don’t need that. I figure I’ll have it hooked into the batteries directly, and once we get solar, that computer should run all the time then. Its only a 120 Watt power supply, they make some that are 160W, but that is hopefully enough. Not like it will have a huge power hungry graphics card or anything like that.

Now then, I found a Z-Wave USB adapter. Figure I need that to talk to the Z-Wave devices. But what about everything else? Do I also need Bluetooth and Wifi? I’m not sure how other devices communicate with openHAB. I don’t have anything yet, so I can’t test it out, but I’m trying to figure out how to make it all work before I start aimlessly buying parts. Getting Bluetooth isn’t that difficult, I can easily get a USB adapter for that as well. I’ll also be plugging the openHAB computer into the network over ethernet, but it will be connected to the wifi through a switch, so I assume it should be able to connect to anything that uses Wifi then. Is this right? I don’t want to have to buy a bunch of different dongles for every other type of protocol that may come up, but I want to have options as well.

Be aware that PMS and OH both try to use port 5000 for automatic discovery on the network. You will need to deal with that somehow to avoid a port conflict. Some do this using separate VMs. Others use Docker containers. I think there is a way to disable OH’s use of that port.

Yes.

Each one uses it’s own approach. You first need to choose a device or technology and then look for a binding that supports it. Then in the binding’s readme it will tell you what other devices or software you need.

Assuming a default configuration.

I did not realize Plex and openHAB used the same port. I thought Plex used 32400 since that is what it tries to open when I access it from another computer. There might be a way to change that in Plex as well, I don’t remember if the setting is available or not. I seem to remember it being an option though. I was hoping to be able to use one device for everything though so I can consolidate things and hopefully make it a little easier to maintain. I did find a place that makes power supplies and cases for mini-ITX computers just fr installation in cars, so I am hoping I can build something with what they have available and just get it started.

The power issue was my main concern, but I found a DC to DC power supply. The only issue they have is that their cases are small and limited with USB ports, so I might have to do something a little bigger so I can have enough USB ports for external drives, hopefully with their own power supplies somehow. I don’t think most mini-ITX boards come with builtin wifi and bluetooth, so it’ll be hardwired into the network with ethernet and should be able to talk to everything else through either the wifi from there or the Z-Wave USB dongle. A Bluetooth Dongle is easy to come by too.

I did price out everything and can do it for about $500, which isn’t too bad really for what it’ll be doing. I’ll have to figure out a NAS or something for everything else.

Both use UPnP for automatic discovery on your network. This is what, for example, lets the Roku automatically find and list your Plex server without being told what is IP address is. Similarly, it’s what let’s the OH phone apps automation find your OH server without being told what IP address they are on. UPNP uses port 5000. So the only way to run the to on the same host is to disable UPnP on one of them, or run them in separate VMs so they each have their own IP address.

Port 32400 is the port your clients connect to once the server is connected.

You can which is why I recommended looking into virtual machine and Docker containers. Not only does this make your system more flexible, but it isolates your services from each other so a failure in one does not impact the others. Patching and the like can take a little more work because you have to update more than one virtual server, but a failed patch won’t kill your other running services. You can even create a snapshot of a VM before changing anything and go back almost instantly if you run into trouble.

And all of this would run on one physical machine.

I’ll have to research that. I had tried using Plex with a dedicated IP on the computer its running on now, but for some reason, I couldn’t get the Roku to access it. I had an issue where Plex only runs in discovery mode if it has an internet connection, and we were having issues with ours going on since cell service sucks where we are currently.

I’ll have to look into how to setup and use a virtual machine, but its still probably easier and cheaper to have one dedicated machine instead of a few separate, low powered ones.

That is the point of virtual machines. You have one physical computer that you virtually break up into separate virtual machines. For instance, I have a single physical computer that is running five virtual machines. One runs my NAS (open media vault), one runs my media services (Plex, Calibre, etc), one runs my home automation (OH, InfluxDB, Mosquitto, etc), one runs my firewall (PFSense), and one runs a Desktop I can VNC into remotely. Between the five I’m running four operating systems (Debian, FreeBSD, Ubuntu Server, and Mint) and each appears on my network for all intents and purposes as a separate machine. But they all are running on the same physical host. (Yes I know it’s a bad idea to run the firewall on the same host as my server VMs, this is a temporary setup until I can get a little dedicated firewall box.)

I’m not suggesting you need a setup as complex as this, just trying to explain by example at a high level what a VM is. With VMs you can run OH and Plex on the same hardware but as far as everything on the network and the software itself is concerned each is running on a separate machine. So you have no port conflict and they are isolates from each other so they can’t break each other.

If you are looking to do this as a business, another advantage is that you can build up a template VM once and make many copies of it so your installs become much simpler and less error prone. Backups and recovery can be easier because you can take a snapshot of the VM which captures everything. Patching and upgrades become less risky because you can take a snapshot before and roll back before you run into trouble, or you can spin up a new VM to test out the patch before deploying it to your production system.

About the only thing sticking to a single server to run everything makes simpler for you is you have just a little less to learn right now. But you will save so much more time and effort in the long run that spending a little time now is well worth it.

That is how Plex works. It won’t let you authenticate with your server without going through their cloud servers. It is a pain in the butt if you ask me and if you search around a bit you will find some hacks that will let you get around that.

Well with Plex, I found somewhere that said you can connect to it directly through a static IP if you don’t have an internet connection. I think it was on the Plex.tv forums, but I could never get it to work. Since we only have two Rokus that connect to it, it wouldn’t be hard to set it up with a dedicated IP, but I do agree that a VM will work better. I’ve never used VMs before though, haven’t had much experience with Ubuntu either, so this will all be an experiment. I don’t have the hardware to run it on yet, still trying to figure out what I want to use and how to get it all powered together, but I’m hoping to buy the parts when I get my tax return if not sooner.

Okay, so I’m going to try and work with the hardware I have on hand. Right now, I have Lenovo Ideacentre Stick 300. Its running Plex Media server and that’s it really. I cannot instal Ubuntu on it, so I’m stuck with Windows 10. It works fine, no extravagance, but it at least works. I’ve also got it all set up already. I would like to make a RAID for backups of the media, but I think I can get an enclosure and put in three hard drives and have it be a RAID 5. That should work fine. I can also set up part of the RAID to be a file backup for us I think. I’ve never build a RAID before, so I’m hoping this is easy.

Now, the other tech I have on hand is a Raspberry Pi 3. If I want to do this the cheap way, I can just use that and put openHABian on it. This is where the fun comes in. I’ve built a couple Pi’s, but one was just straight up Raspbian and the other was a RetroPie. I gave the Raspbian Pi to my nephew, but the second one has been sitting in my media cabinet gathering dust. Since I have backups of all the ROMs on it, I can just use the same SD card and set up openHABian and play with it until I get the Z-Wave adapter and some smart devices. At least then I will be able to play around with it and figure everything out.

I had wanted to build some big elaborate computer monstrosity, but really, I don’t need to. I can’t really afford to anyway, so I might as well go with what I have and make it work. Plus this way, I can put together systems for other people easier as well, since the Pi’s are so cheap and easy to come by. I will be adding ethernet to the RV in the near future, so the Pi will be connected that way instead of wifi, but the Plex machine doesn’t have ethernet and only has one USB port so I’m stuck with wifi for that. Its worked fine up to now though, so hopefully it can continue.

Now, for future expansion, I’ll have to upgrade the Plex machine at some point, and when the Pi 4 eventually comes out, hopefully that is an easy upgrade as well.

I am in the process of downloading openHABian right now, so maybe I can work on that tomorrow if nothing else comes up. I already installed the openHAB app on my Kindle Fire, so I can play with it remotely, I just hope one Pi 3 has enough power to run it well.

For the other needs, well, I’ll work with them as they come up. No need to rush things for now.

So after many issues with our RV, I have openHABian installed. I don’t have any smart devices, so it can’t really do anything, but I have it setup and updated and connected to the network. I can access it from my laptop and work with the UI, but I have no idea what the hell I’m doing. Guess I should get something that it can talk to and start from there. I wish the DC powered controllers weren’t so expensive, but that’s what I’ll have to work with anyway. Might be able to buy something this weekend when I get paid, so I guess its one small step at a time.

I’m going to start small, with one DC powered light. I found this: https://www.amazon.com/dp/B075JK1B5G/ref=asc_df_B075JK1B5G5353216/?tag=hyprod-20&creative=395033&creativeASIN=B075JK1B5G&linkCode=df0&hvadid=198093101467&hvpos=1o2&hvnetw=g&hvrand=11489205771964671984&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9014700&hvtargid=pla-368846558121

Does anyone know if there is a way to make openHAB work with this device? I’m starting at zero knowledge of what I’m doing, but its a DC controller, I’m just not sure how to make a openHABian Raspberry Pi talk to it. It looks like that only works with their app though.

I’m desperately trying to find some way I can connect from a Pi to a DC powered switch. If I have to build it myself, I will, but I don’t want to if I don’t have to. All I need is something that talks to openHAB and opens or closes the electric flow at 12V DC. That’s it. And I don’t know how to do it.

If you want to start small (and cheap) then you should start with the DIY way. Just have a look for “ESP8266 relay” around the Internet and you will get some cheap devices (under 5 USD). These devices can be programmed to use a alternative Firmware, so if you invest another 3 USD for a USB-to-TTL-converter (used by Arduino boards), you can get a very cheap WiFi-Switch, which works with openHab. As Firmware you can use “ESP Easy” from let’s control it (https://www.letscontrolit.com/wiki/index.php/ESPEasy) and you can connect not only relays, but also other cheap sensors.
On the server side you have to install MQTT (can be installed together with openHAb on the RasPi) and you Need a WiFi-Network in your RV.

So if you have the RasPi and a WiFi-Network within your RV, there is no more money to spend as the ESP8266-Relay-Board and the USB-Adapter to flash the ESPEasy and spend some time…
With ESP-Easy you can easy adapt multiple temperature sensors (1-wire sensors)…

This way you can have a working system (relay Switch, temperature sensor,…) with only spend under 10 USD…

Andreas

Okay, found the ESP8266 switch with wifi. Only about $7 for one, which is easily affordable. I’ll order a couple next month and see how they work and if its good, I’ll get more. Probably not one for every DC light as there are some in cabinets and such that don’t need to be wifi controlled, but the main lights I’d like to do.

Now, I want to add functionality to it obviously. I’m thinking my first project is going to be adding a motion detector to the bathroom light, so when the door opens, the light turns on. Should be too difficult. However, for some of the other lights, I’d like to have a switch for times when I just want a physical button to flip on one light and be done with it. Is there something I could buy or make that would send an “on/off” command to just one light or do I need to do something more complicated?

There aren’t many lights in here and only a few zones that we use most of the time, but if I could set something up so when we are gone for awhile the lights shut off, or when we enter the RV and hit a button by the door, a certain selection of lights turns on. Or if I’m sitting up front and just need the one light on, I could have some sort of control mechanism in the dash so I could just turn on the lights I needed and not have to go in and turn on all of them.

I guess I want the functionality of both a smart and dumb home at the same time. I’m also in the process of reworking the dash (there used to be a 10 inch tube TV in the center), so I’m gonna get a piece of metal custom cut and shaped so it holds a rearview camera, car radio, some USB outlets, a clock, dunno what else. I was thinking I could buy a cheap tablet and build it into the center console as well. If I could have that default to display something like the time most of the time, and be able to control the smart devices from it, that would be ideal. I could even incorporate a temp sensor in the openHAB setup and have the tablet be the control for it. I could have openHAB accessible from our phones and computers, but have the main controls in the dash. I do have a small 7" cheap ASUS tablet I bought awhile ago, so I could just repurpose that and throw it in there.