Page 1 of 1

An amazing mish-mash

PostPosted: Sun Sep 01, 2019 6:45 pm
by FlyingDiver
So last week we closed on a unit in a storage condo complex. It's designed for vehicle storage, and the interior is about 50' by 20', with a 14' high by 16' wide door. So now I can get my 45' Class A RV inside and out of the Florida sun. And with careful vehicle placement, I think I'll also be able to get a Class B van and a car inside as well.

Now of course I need to monitor that space. So I was looking around at the random components I had to see what I could use. Hmm. I've got those Wyze sensors I just bought. 2 Wireless contact sensors and a Wireless motion detector, plus the USB dongle, for $30. That should cover the two doors plus a motion backup. And an AM2302 Temp/Humidity sensor I got for MQTT testing, $7.39. And a Raspberry Pi 3 I bought for another project that never happened, $34.30. And an old USB power brick I wasn't using.

So I could have just written a Python program to run on the rPi to do everything, but I decided to see how the other half (?) lives. I installed Hassbian on the rPi. Which, for those who don't know, is custom install of Home Assistant (https://www.home-assistant.io) for the rPi. Boy is that kinda painful to set up. It's a web interface that can do most things, but for tricky stuff you need to edit the text config files (in YAML format) and copy them to the rPi.

Turns out HA has support for the AM2302 built in, once I figured out which pins on the rPi to connect it to.

For the Wyze sensors, I used https://github.com/kevinvincent/ha-wyzesense, which is uses the same code as the Wyze script I posted here: viewtopic.php?f=316&t=22862

And HA has built-in support for MQTT.

I wrote one "Automation" in HA, which is basically a single trigger that activates when any of the five sensors change state, and publish the new state info to an MQTT topic. Then I subscribed to that topic with the MQTT Connector device in Indigo, and wrote a trigger for the topic to queue up those messages to the MQTT Shims plugin. Then I created five shim devices to represent the five sensors in Home Assistant. And done.

Oh, I also have Twilio enabled in Home Assistant, so I can send SMS messages for "Emergency" issues without going through the MQTT Broker and Indigo.

The only thing I still need to do (other than actually installing everything in the storage unit) is decide where I want the MQTT Broker to live. I could leave it on my local LAN at home, and punch a hole through the firewall for it. But I prefer not doing that too much. And it puts my home internet connection in the critical path, even if I'm trying to monitor the location from somewhere else (like the RV on the road). So I'm considering using a cloud server for the broker. I could do one on Digital Ocean for $5/month. That's about the cheapest I know of.

Cool stuff.

Re: An amazing mish-mash

PostPosted: Sun Sep 01, 2019 11:34 pm
by roussell
Thanks for sharing! FYI instead of hasbian I highly recommend Hassio. It’s a docker based self—contained install of HomeAssistant and honestly works much better. Your MQTT plugin should make integration with Indigo a breeze. I haven’t tried it yet as I’ve been traveling for work and vacation but I am installing Hassio in my camper (just a bumper-pull and not a class A) and want it to tie into Indigo back home for one seemless interface.

Terry


Sent from my iPhone using Tapatalk

Re: An amazing mish-mash

PostPosted: Mon Sep 02, 2019 5:57 am
by FlyingDiver
I tried both. One problem I had with Hassio was getting ssh to work was non-intuitive. And if you run Hassio, installing anything other than Home Assistant on the same rPi was impossible. Or is it?

What works better in Hassio?

Re: An amazing mish-mash

PostPosted: Mon Sep 02, 2019 9:01 am
by FlyingDiver
Well, I did another install of Hassio. Turns out it doesn't have the hidraw device driver needed for the Wyze sensor dongle. So can't use it.