Looking for further input on my setup

Hello forum,

Happy New Year!

After more reading and time to investigate my options I do think OpenHAB will work best for me…but I’d still like to clarify a few things first.

In my setup I’m looking to use a Raspberry Pi with a RaZberry addon board. I’ll be using Z-Wave sensors that will talk to my Pi/RaZberry. I don’t want to run OpenHAB on my PI though. I want to install OpenHAB on my home server and have the data collected from my Pi/RaZberry sent to my OpenHAB server. I’ll most likely be using MQTT for this transmission.

Is there any advice on how I can collect my data on the Pi and send it immediately/real time to my OpenHAB server? I don’t want my Pi to have to store this data. I want to keep what I need to install on my Pi to a minimum to be honest (reduce corruption problems if they occur). If I could run everything on my Pi in memory only (read only mode) that would even be best!

I realize this isn’t specifically an OpenHAB question but I’m hoping others with experience have done a similar setup.

Thank you.

Hello Charles

If you don’t like to run anything on your RPI, why you dont’t go with an USB zWave Stick (e.g. Aeon Stick Gen5) and run it on your Home Server?
This is a lot easier and more stable than putting an RPI Instance between and translate the communication?

If this is not cappable for you, please let us know, why you want to build up your setup as described.

regards
Michael

Hello @michael_sutter and thank you for your reply to my topic.

I’ll describe what I’m hoping to accomplish to help with why I’m using a Pi.

  • At our cottage I want to put some sensors in and around the cottage. I’ll be starting in our boathouse to monitor our boats for water in the boat and charge level on the battery. In the boathouse I will be using a Raspberry Pi to report/alert me on the sensors placed there. The boathouse will have wireless so My Raspberry Pi will be able to access the Internet from the boathouse.

  • Phase 2 (if you could call it that) will include adding some more sensors up at the cottage in various places. Not sure what sensors I’ll be using up there yet. Up at the cottage I will have a Raspberry Pi and this Raspberry Pi’s will also have internet access.

  • I would like to have each of these Raspberry Pi’s send and display their data in one location…hence the reason to send all sensor data to my OpenHAB server at home (where my home is not at the cottage).

  • On each Raspberry Pi I want to connect to my OpenHAB server securely so I thought what better way to do that than use OpenVPN. I have an OpenVPN server at my home and my plan is to connect each of these Raspberry Pi’s at the cottage to my OpenVPN server to send the sensor data.

  • I don’t live at my cottage all summer but someone from the family is always there so another requirement of mine is to be able to send up through the mail a new sensor and tell my family member where to put the new sensor at the cottage. Remotely from my home I plan to be able to add that new sensor to one of the Raspberry Pi’s at the cottage and have that new sensor data sent back to my OpenHAB server at my home. I don’t believe I would be able to add new sensors so easily using a zWave Stick. Also a zWave stick would not allow me to connect my various sensors to my OpenHAB server running at my home via VPN. Please correct me if I’m wrong though.

  • At my home I use Zabbix monitoring for my various hardware I run in my home. Adding my cottage Raspberry Pi’s to my monitoring system could easily be done since I’m running a full Linux O/S on my Raspberry Pi’s. This isn’t necessarily a requirement…just a comment more on being able to add more to a Raspberry Pi if I wanted too.

Hopefully I’ve described what I hope to accomplish. There is a lot I haven’t worked out yet since I’m just beginning. I know that z-wave sensors create their own mesh network and I’ve read up on using MQTT (or a python script) to send sensor data to my OpenHAB server…but how I would exactly do this is still something I need to learn and setup.

Any advice you can give me on my setup would be greatly appreciated.

Thank you.

I’m just re-reading my post and your comment @michael_sutter and thought I should add another comment.

I’m not married to using a Raspberry Pi I suppose…although my requirement to host my OpenHAB server at my home and send data from my various sensors to my OpenHAB server securely through VPN probably limits me on what I can use to collect data. If there are options ow ways to accomplish what I hope to build that doesn’t include a Raspberry Pi I’m all ears!

I’ve been using Raspberry Pi’s for the past 3 years and find them very useful…but I’m very aware of the pitfalls that come with using them if you aren’t careful. Running my O/S on an SD card means I have to be careful about writes and proper shutdown as writes on the SD card can be problematic. In my use case I want to use more than 1 collector of my sensor data so putting OpenHAB at home and sending all sensor data makes sense to me…but even if I did want to only use one hub to collect all my data I don’t want to put a database on a Raspberry Pi (or any other SBC that uses SD cards for it’s hard drive).

Thanks for listening!

Hello Charles

With your last posts I could mention a little bit better, what your idea is. Now, I agree with your initial idea.

If you use the RPI’s as “satellites”, I agree with your idea.

Is it right, that you primary monitor your cottage?
So you don’t want to switch lights when motion is detected or do something time critical?

Regards
Michael

Hello @michael_sutter,

My initial reason for using OpenHAB and z-wave sensors is to alert me on issues with our boats. But seeing how powerful OpenHAB is I can see myself expanding how the automation will work at the cottage whereby I probably will implement lights being activated based on motion and/or turning lights on/off on a schedule. The sky’s the limit I suppose with what I can accomplish with OpenHAB and home automation! :slight_smile:

What I’m hoping to accomplish from this post in the OpenHAB forum is to ask from you experts if what I’m planning to setup will work or not. I’m very open to suggestions on how best to do this seeing as I’m still early days in thinking up how this will work.

  • Will I be able to setup OpenHAB on my home server and collect data via VPN from more than one Raspberry Pi running a z-wave addon boards? It’s up to me to get OpenHAB installed and my VPN to work…but if anyone has done something similar I’d really like to know I’m going in the right direction on this plan.
  • From another thread I was told that MQTT (or a python script) can be used to send my data to OpenHAB from my Raspberry Pi’s. Now that I’ve expanded further into what technology I’ll be using (z-wave and their sensors), do using MQTT still make sense to send all this data to OpenHAB?
  • If anyone wants to comment on my use of the Raspberry Pi as a good or bad gateway to use for my setup I’d be happy to hear your comments on your own experience. Perhaps OpenHAB allows me to send data securely through https so I don’t need a VPN connection?

Thanks!

Charles,

you have great ideas and I’d like to assist you, with some inputs, ideas and more.

Please, don’t let you get blended by the featureset of OH2. Try to start to describe your visions.
Then break them down to a real strategy, but try to stay generally. Last but not least, fill your mix with technoloy.

In your case, I recommend a mutliple master installation.
Place one in the central of your cottage. Equip it with a zWave Stick. It’ll will serve the mainbuilding with lightcontrol, maybe blinds, contacts and so on. The perfect situation would be, if your zWave network reach the boathouse. But if not, place an branch data-reciever node there. It collect the data from the boathouse and send its to the master.

A second master could be installed in your main residence. It serves mainly the residence even with lighting, blinds and others. It also connects to the first master installation and greps information from it. You can show the status, send remote controls.

And if the VPN tunnel breaks, every part could runs autonomously.

Let me know, what you think…

Michael

Thanks very much for continuing to assist @michael_sutter!

By your comments to use a multiple master installation…is the hardware in your setup using a Raspberry Pi?

I completely agree that I need to start small and be clear in what I’m building. Very good advice!

I’ve purchased a RaZberry addon board for my initial testing on the Raspberry Pi. I looked at the zWave stick but didn’t like how I had to pair each sensor with the stick. Not that I’m against pairing that way per se…but again if I wanted to send a sensor up and have someone put it where I want the sensor placed I don’t want them fumbling around with pairing. Perhaps I’m wrong in my assumption but I thought that I could use a RaZberry addon board and update the configuration file from my home (through my VPN tunnel) to the Raspberry Pi to update the config on the Pi to accept the new sensor. If this is not how you can add new sensors using the RaZberry addon board then I apologize for my ignorance. Perhaps you can tell me why the zWave stick would be a better tool to use with the zWave sensors I’ll be adding.

I definitely like the idea of using master Raspberry Pi’s to collect data to one master that will put the collected data to my OpenHAB server. I do plan on putting Internet to the boathouse so a master Raspberry Pi down there will be on the same LAN as the main cottage so data can be aggregated to another master. But question for you…what if my boathouse was on a different LAN, could I still just send that boathouse data to my OpenHAB server and have my OpenHAB server know that that data from the boathouse is from another master? So in this setup I could have two master Raspberry Pi’s sending sensor data to my one OpenHAB server at home.

Lastly…something I have not been able to confirm or find…I don’t want to install OpenHAB on any Raspberry Pi masters in my setup. Am I wrong in assuming that I don’t have too? What I was hoping was to have each Raspberry Pi collect the sensor data and send that collected data to my OpenHAB server at home via a VPN connection.

Or do I need to have OpenHAB installed on all my master Raspberry Pi computers and have them send all their collected data to my big OpenHAB master running on my home computer? Your comment “And if the VPN tunnel breaks, every part could runs autonomously.” tells me that each Raspberry Pi will have OpenHAB installed on it. What I was hoping was to not have to install OpenHAB on any of my Raspberry Pi computers at the cottage but have each Raspberry Pi collect all the sensor data (in my case water sensor, battery voltage) and send this data to my OpenHAB server running at home (where home is not at the cottage).

Clearly I have lots of questions and lots to learn…

Thank you.

Gday,

Just an idea that I use. If you have 2 locations, boathouse and cottage and you would prefer to have your openHab instance running on a server in the cottage with sensors & actuators in the boathouse.

One solution would be to explore the mysensors.org setup and transmit the sensor/actuator data via MQTT. I do this locally and it has been working quite reliably for about a year now, I like that is very expandable and separate for any fault finding.

Cheers,
George

Hello @George_Whitehouse…you are now getting into what I need to know!

I will eventually have two locations in my setup (in fact I can envision many different locations all reporting back to my OpenHAB server running at my house…but that’s another day).

I will definitely take a better look at mysensors.org. I was pointed to using MQTT from the OpenHAB forum in a past post…but I don’t know how it works. Could you shed some light on how you use it please?

  • Do you use z-wave devices?
  • What gateway or master are you using to collect all your sensor data and send it via MQTT? I’d like to use a Raspberry Pi with a RaZberry add on board.
  • Do you use a python script to initiate the MQTT transmission?
  • Where is your OpenHAB server installed in relation to where your gateway/collector resides?

Please describe how your layout is setup and what hardware you are using perhaps so I can see if my plans are on the right track.

Thanks!

Charles,

Yes I do use half a dozen zwave devices, for me I use them for switching 240VAC. Personally I am happy to build electronic bits but for switching mains power I would prefer to buy certified devices. So for me zwave switches most of my lights via Gen 2 Aeotec Micro Smart Energy relays, of course with a USB Z-Stick, Aeotec Gen 5. This has been quite stable and reliable.

I use the mysensors.org MQTT gateway (Arduino Uno) which sends all the sensor/actuator data to a MQTT broker on my RPi server where openHab is running. In this format I can fault find all the MQTT data flows from the sensors/actuators with MQTTLens, (a big thanks to the fellows on this board who pointed me in the right MQTT direction).
With this type of setup you could have multiple sites all sending encrypted data over the Internet back to one openHab instance for storage and actions.

No need for a script for MQTT transmissions, the Arduino sketches all have regular (adjustable) times to send new sensor data, say temperature/humidity. Of course some sensor types like reed switches send instantly. I really like my rainwater tank level sensor, I cant help but watch it going up when it rains.

I use a RPi for openHab & the mosquito MQTT broker (static IP), the MQTT gateway is in a differnet physical location and simply connected to the LAN and pointed to send data to the MQTT broker IP.

I dont have any problems running the RPi as the server, I started off with a dedicated old windows PC but did notice the power consumption was a bit high for what it is, I then switched it to the Pi, much less power consumption and it hardly budges the Pi’s processor capacity.
I do a backup of the SD card every week or so or when I change anything, I just use the SD Card Copier tool in Raspbian. (I would love if someone who knew could let me know how to do it over SSH to an .img file, then I could try to write a script to do it via cron)
So at any one time I have two copies of the exact openHab setup on SD cards, so if one dies I just put in the other one and create a backup again. I suppose same for hardware faults.

Regards,
George

1 Like

Outstanding detail here @George_Whitehouse! Thanks very much for sharing your setup with me. This has greatly opened my eyes to what I will need to implement. My setup will be a little different than yours since I don’t want to have OpenHAB on my Raspberry Pi. If you don’t mind I’d like to confirm what I’ll be setting up for my setup:

I will install OpenHAB on my Linux home server at my home. My home network runs an OpenVPN server on my router/gateway.
On the OpenHAB Linux server at home I will install a MQTT Broker.
At the cottage I will install a Raspberry Pi in the boathouse. On the Pi will have OpenVPN connect to my home router/gateway. Also on this Raspberry Pi will be installed a MQTT gateway installed (https://www.mysensors.org/build/raspberry).
The Raspberry Pi Gateway will collect data from all the z-wave sensors around the boathouse and send this data to my OpenHAB server (through VPN) running at my house.

Does the above sound like I understand how my setup needs to look like/work? I know you have Arduino Uno’s in service for your setup collecting sensor data and sending it to your Raspberry Pi running OpenHAB but as I mentioned I don’t want to run OpenHAB at the cottage and I don’t want to run OpenHAB on my Raspberry Pi so I’m trying to setup as I described.

I very happy to hear that the Raspberry Pi is capable of running OpenHAB for you…very good information to know. For my setup I’d prefer to keep my OpenHAB server running at my home as our cottage is not used in the winter and I do see expanding the locations from where I will be collecting data to my OpenHAB server (parents home as well as the cottage and boathouse in the summer).

As to your backup…let me detail something I’ve not implemented but always considered using for backing up Raspberry Pi images…

At a small business I support I use Raspberry Pi’s as thin clients running http://rpitc.blogspot.ca/. It’s been working flawlessly for us for 3 years now. I support the office remotely and was looking at ways of re-flashing the Raspberry Pi O/S remotely. Here’s what I thought of (but never implemented)…perhaps this can point in direction that may work for you.

So basically berryboot is a very useful tool on the Raspberry Pi. In my case I was looking for a way to remotely change to a newer version of the thin client image I need. In your case probably what you would need is to have two images Raspberry Pi SD card…boot into the second image (not the one with OpenHAB on it) and from this second image drop into the command line and copy the OpenHAB image to a NAS share for backup. You then reboot the Raspberry Pi and have berryboot log back into your OpenHAB image (since it’s your default image to use on berryboot).

Not a solution you could completely automate but at least you don’t need to pull the SD card for the image backup (unless you prefer that method of course).

Thanks!

Hi @George_Whitehouse…another thought that may work better…

A while back I discovered DietPi. It’s an amazing O/S built for the Raspberry Pi. What I discovered while reading the DietPI website is that they offer many tools and wizards. One of these tools they built will backup the full O/S for recovery if need be:

http://dietpi.com/phpbb/viewtopic.php?f=8&t=5&start=30#p255

I’m not sure if you can script the backup or not but this seems like a much easier way to backup your Raspberry Pi O/S running OpenHAB on it.

Hopefully this suggestions help you find a solution.

Thanks.

Charles,

Your set up sounds ok however the mysensors gateway will not work with zwave devices, it is designed to work with mysensors builds. If you would like to implement zwave sensors in the remote location you may want to use a zwave stick, RPi & a remote instance of openHAB that is connected to your main openHAB instance, I have read linking openHAB instances is possible however have not had a need to try it.

Thanks for the backup suggestions, I will have a good look at them.

Cheers,
George

Thank you @George_Whitehouse for reviewing my setup.

I do own a RaZberry add on board that will allow my Raspberry Pi to collect data from z-wave sensors. What I was missing was how to collect data from the z-wave sensors and send this data to my home OpenHAB server. It would seem the only way to do this is to install OpenHAB on my Raspberry Pi then and connect this OpenHAB Pi server to my home server. I know you said that you have OpenHAB running very nicely on your Pi…but won’t this kill your SD card eventually due to the database?

Thanks!

It is a good point you make with the writes to the SD card wearing it out, so far I have not had any issues, probably around 8 months so far on the Pi testing & production. I persist around a dozen items I suppose. I am a bit cautious and thus have the cloned SD card ready to just drop in at a moments notice if need be. I suppose everything breaks eventually but if it is just a $10 SD card and I have a couple of spares/clones I am not too concerned.
I backup the configurations folder to my NAS as well every week or when I change anything meaningful. So far I have not had any failures and feel confident when it happens I can get back up and going in less than 10 mins (although if hardware I would have to cannibalize my kodi media Pi :frowning: ).

If you are keen for zwave and/or MQTT sensors/actuators in a remote location I would think a remote instance of openHAB might be a good way to go, might add to the learning curve a little thought. Always best to start off with modest goals and add to the scope over time.

Cheers,

Hi @George_Whitehouse, followup question for you on OpenHAB. I was going to post this in a new thread but thought I’d confirm with you first since you mentioned it.

Do you know if OpenHAB needs to have an OpenHAB server on the same network that the sensors are on in order for sensor data can be sent back to OpenHAB? I guess what I’m wondering is can’t my OpenHAB be installed at home and z-wave sensor data be collected (somehow…not sure yet) on a Raspberry Pi(s) at my cottage and have this data sent back to my home based OpenHAB server? I think what you have referred too is what @michael_sutter had referred to as being a multiple master setup.

I’m not necessarily against having OpenHAB running at the cottage. It does afford a safety net for me in case my connection goes down to my home server. But running OpenHAB on the Pi is not something I would do for my setup as a first choice (although if I had too I would consider installing my OpenHAB database on a WD drive made specially for the Raspberry Pi - http://wdlabs.wd.com/category/wd-pidrive/).

Before I opened a new post and asked more newbie questions I thought I would see if you knew of another type of setup that didn’t require me to install OpenHAB at the cottage at all.

Thanks!

That is a good question and I can not recall reading about how this could be done without running an openHAB instance on the RPi and having the two connected. Depending on how far apart the two locations are you may be able to just extend the zwave mesh network the distance by putting two physical zwave devices close enough together for them to communicate, thus eliminating the need for a standalone RPi. They say the range for zwave is up to 100m. I have had not problems running my network with a 35m range and all sorts of RF noise. If the locations were more than 75m apart I would suggest the dual instances path.

Another alternative is not to use zwave at all and go down the MQTT path with mysensor type builds and just connect all the sensors/actuators to a gateway and point the gateway to your MQTT broker.
Or you could explore the ESP8266 path with MQTT & WiFi.

In my experience the build you own type path is cheaper but more time consuming to set up v’s the zwave gear that is much more expensive but quite easy to set up. Both have been quite reliable for me once set up and running.

Regards,
George

Thanks very much @George_Whitehouse for your comments and user experience with what you have setup. Appreciate the feedback!