Openhab system for Holiday Home

Dear all, after having openhab for years and years in my main home i am planing to setup a system for my holiday home in spain.

I would be very happy if you can give me some advice and help in selecting the components :slight_smile:

I plan to install a raspberry pi 5 with openhabian and a sonoff zigbee stick.

Currently i dont have stationary internet connection or wifi. However we do have 5G mobile network connection there, so i would get myself a cheap pre-paid data SIM and a 5G network wifi router. But they are pretty expensive, maybe someone has a recommendation?

I would like to install 2-3 outdoor and a indoor IP camera.
Outdoor camera must be solar power and PIR-motion sensor would be nice. In my main-home i am using ONVIF cameras (instar and Tapo, but cable powered). Are there affordable solar powered outdoor cameras which do work with openhab?
I am using the IPcamera binding, however i am not sure how much internet traffic this is producing, is it only consuming internet data when i open the remote stream .. or always?

For remote control i am using the Android Openhab App for my main home. Is it possible to add a seconed Openhab server and switch between those?

Later i want to add some additional zigbee sensor and actuators. Water leakage sensor, door and windows sensor, water flow actuator and so one.

Would be great if someone could share his experience with a system like this :slight_smile:

Best regards, Simon

I’d suggest using a small computer with SSD for boot drive + a dedicated drive for storing video recordings. Look for SFF computers from Lenovo, HP, Dell, etc, second hand from ebay. Get (or upgrade it to) 16GB RAM minimum.

Then use Frigate to record your camera stream.

You can run openhab on that same computer too. Bonus points if you can install an NVidia card on it, e.g T600.

For cameras, I’d suggest using all wired cameras, PoE, Dahua, or hikvision, or one of their rebadges. Get a separate PoE switch for the cameras. A cheap netgear 8 port 100mbps poe switch will do the job, and another gb switch for the rest. Or if you can find a cheap 1gb poe switch that can do everything, go with that, subject to its reputation / reliability (so avoid no-name switches). The last thing you want is a failing component when you’re not there to fix it.

Then add a UPS (I’d recommend APC brand because its driver works better than cyberpower’s on Linux) + setup automatic shutdown on your computer.

1 Like

Hi jimtng, thank you for your answer.
Small computer with ssd sound like a good idea over a raspberry pi. I am just used to RPi because i am using it since years in my home setup :wink:

Regarding camera, runing wires through the wall will be difficult, this is why i would love to have solar powered cameras. But i am afraid there a bigger disadvantages with solar powered cameras … i am even not able to find ONVIF ones.

What is an UPS? :smiley:

Uninterruptable Power Supply. To keep your system running if there is a power failure or glitch, and to help shut it down nicely if there is an extended power outage. Less chance of your system being corrupted while you are away from it.

Sample here

There are many choices.

Generally, there is no point in putting up UPSs in Europe unless it’s something critical where you simply cannot afford downtime or an unintended shutdown.

Power supply is obviously less reliable in other parts of the world and when I lived in Africa I had power conditioners in front of every appliance at home due to multiple brown-outs a day as well as a UPS to protect computers, but Europe? Don’t worry about it.

I have made other experiences. Itā€˜s true that the number of power outages is really low, but we had one last year, which killed my NUC running openHAB. I have now added a UPS and a surge protection for critical devices.

1 Like

No it’s not, it’s right the other way round. Think maintenance and spares.

openHABian comes with a nice feature called SD mirroring.
With that, in case of hardware failures, you can even instruct some onsite person to replace the failed parts and can get your system back up working from all-remote.

I am in a similar situation only difference is my Holliday house is in ItaliešŸ˜‰. At my home and holiday house I am running OpenHAB on a rPi4.
At my home address I’ve got a separate rPi4 that is setup as a VPN server running WireGuard. Both OpenHAB system are clients on this VPN.
I also have no wired internet at my holiday house I’m using a tp link mr600 as wifi router. On both places I’ve installed an ups mainly to protect the rpi’s from uncontrolled shutdowns. As Marcus also suggests I’ve got sd mirroring setup and in both location a spare RPi as well as spares of (almost) all hardware components. I’m using pushover as an alarm message service in both location. The big advantage of my own vpn server is that I can acces my local network in ItaliĆ« from home and vice versa. In ItaliĆ« I’ve also installed an automatic reset device for the earth leakage circuit breaker (ABB) as there is a lot of lightning overthere. In both location I have installed a Dahua NVR with wired POE outdoor Dahua camera’s and indoor Tapo camera’s. I’m using the ipcamera binding mainly for positioning of the camera’s in case of an alarm and for privacy reasons. (when the alarm is not on all indoor camera’s turn their face to the wall). And I suggest you keep a log of everything you do so you will be able to rebuild your system from scratch when necessary. My combined SDS/HDS is now 58 pages long. It’s containing everything from MQTT commands to router settings and not to forget every single setting of my VPN system. And details of every hardware component.
To get an impression, below you find the table of contents of it. And you will need it at some point in time! (At least I needed it already more than once)

1.	Introduction	5
2.	Modem and Router settings	5
2.1.	Berghem Modem/router , Nokia XS 2426G B	5
2.2.	Berghem, Shopfloor router RT-AC68U	5
2.3.	Tuoro, TP-Link Archer MR600	6
3.	VPN Server setup	7
3.1.	Rasbian operating system installation	7
3.2.	PiHole DNS server and add blocker installation	7
3.3.	Wireguard VPN server installation	9
3.4.	Installation of Wireguard VPN client on Windows10 and Mobiles	10
3.5.	Installation of  Wireguard VPN client on Rasberry Pi	10
3.5.1.	Crontab Watchdog on Wireguard tunnel	11
3.5.2.	Things to do when installing Openhab Tmp on specific location	12
4.	Rasberry PI OpenHab server installation	13
4.1.	Initial installation of Openhab	13
4.2.	Samba network drives in windows explorer	13
4.3.	Openhab package and User interfaces	14
4.4.	Using the Pi serial USB interfaces	14
4.5.	Connecting PI to local NAS for backup services	15
4.5.1.	Setting up an NFS file service on NAS	15
4.5.2.	Mounting the NAS nfs service to a folder on the rPi	15
4.5.3.	Setting up a cifs share connection to NAS	15
4.6.	Connecting an SSD drive for backup and database service	16
5.	Openhab cloud services	18
5.1.	Setup OpenHAB cloud service account	18
5.2.	Installation of  the local cloud service	18
5.3.	Setup of the remote cloud service	18
5.4.	Log file entries from IOS app	19
6.	Home Automation Shop Floor WIFI	20
7.	Visual studio installation and setup	22
7.1.	Installation	22
7.2.	Complete uninstall of visual studio code	22
8.	Openhab 3.0 configuration	23
8.1.	Adding users to openhab	23
8.2.	Log files in OH	23
8.3.	Binding configuration	24
8.3.1.	Philips Hue	25
8.3.2.	OpenTherm Gateway	25
8.3.3.	Opentherm binding	25
8.3.4.	Mosquito MQTT broker	26
8.3.5.	Smart meter binding, DSMR	26
8.3.6.	Roomba binding	26
8.4.	Thing file definitions	27
8.4.1.	Hue.things	27
8.4.2.	EatonUPS.things	28
8.4.3.	Opentherm.things	28
8.4.4.	MQTT.Things	28
8.4.5.	Smartmeter.things	29
8.4.6.	Network.things	29
8.4.7.	Camera.things	29
8.4.8.	Pushover .things	29
8.4.9.	Roomba.things	30
8.5.	Items	30
8.6.	Site Map files	30
8.7.	Rules	30
8.8.	Things naming convention	30
8.9.	Items naming convention	31
8.9.1.	Location groups	31
8.9.2.	Equipment Groups	31
8.9.3.	Functional groups	31
8.9.4.	Sitemap groups	32
8.9.5.	Control Groups	32
8.10.	Data persistence	32
8.10.1.	Setting up MariaDb MySql  database server on RPI	32
8.10.2.	Influx db and grafana	34
8.10.3.	Moving influxdb database to NAS	34
8.10.4.	Influx database administration	35
8.11.	Alarm panel configuration	35
9.	Tasmota and ESP8266 and ESP32	36
9.1.	Configuration of ā€˜build’ files, user_config_override.h	36
9.2.	PlatformIO	37
9.3.	Dedicated  builds	37
9.4.	Tasmota OTA server	37
9.5.	Sonoff basic	38
9.6.	Sonoff Dual R2	39
10.	Tasmota software Development	41
10.1.	I2C addition of XGZP6897D pressure sensor	41
10.1.1.	I2C Driver file for XGZP	42
11.	Uninterruptable Power Supply’s  UPS	42
11.1.	Eaton Ellipse pro UPS	42
11.2.	PiJuice installation	42
12.	Dahua camera surveillance	44
12.1.	NVR settings	44
12.2.	Camera buiten settings	44
12.3.	Tapo camera’s	44
12.4.	Dahua NVR API control	45
13.	Berghem Specific	46
13.1.	Hostnames login’s and passwords	46
13.2.	Berghem local & VPN IP addresses	46
13.3.	Phillips Hue	47
13.3.1.	Serial numbers Hue components	48
13.4.	MQTT Topics Berghem	48
13.4.1.	Floorheating	48
13.4.2.	Alarm control	48
13.4.3.	Garage lights	48
13.4.4.	Livingroom lights	49
13.4.5.	Kippenluik	49
13.4.6.	Rollershutters	49
14.	Tuoro specific	51
14.1.	Hostnames login’s and passwords	51
14.2.	Cronjob entry’s	51
14.3.	Tuoro Local and VPN IP addresses	51
14.4.	Phillips Hue	52
14.4.1.	Serial numbers Hue components	52
14.5.	Arduino Yun	53
14.5.1.	Uploading  sketch to Yun thru SSH	53
14.6.	MQTT Topics Tuoro	54
14.6.1.	Yun MQTT Topics	54
14.6.2.	Tasmota MQTT Topics	54
15.	Horlepiep Specific	55
15.1.	Usernames and passwords	55
15.2.	Ip addresses	55
16.	Backup restore of Raspberry Pi	55
16.1.	SD card imager	55
17.	Linux commands used up to now besides the obvious ones	56
Revision history	57


1 Like

First of all I recommend, a server setup, which save you data in a way, that in case of power lost, (which will come for sure), that you PI shut down himself after a couple of minutes.

So highly recommended a UPS which stays for 30min for the PI, and the Router. Optional the switch also. (Not needed, when the PI is connected with the Router directly).
As connection I would recommend a classic Router e.g. Fritzbox, or something in this way, and
for the modem I would take a USB-Stick with LTE (4G) etc. 5G is to expensive, and I assume 4G in good enough for this setup.
Have a look where the Router incl. the USB Stick will be located, and check before which Provider, Movistar, Vodafone, Orange to choose. Select this provider where you have the best coverage. You can check with you mobile phone, which priovider is offert in this location by doing a manuell network search on your mobile.

OH has a binding, for the UPS (Network UPS Tool) here you can trigger a classic shutdown of you PI, when the power is lost and not back after 15min (by a lifetime from 30min in total)

The system goes down, saves all you data. (If the power is lost whithout that, you will loose data) Trust me, I have personal hard experiance in that.
A couple of years before I have had some challanges with power and rain in the garden. All the time the ā€œfi circuit breakerā€ where go active and shuted down the whole baseband, where the OH server is running, Include the PI OH server. All the recorded temperature, humidity values where lost. This happend server times, and then I bought a UPS.

Also enabled a secured VPN tunnel to the Router, with Wireguard or any other VPN tunnel that you have remote access to the PI and the OH installation. Works also nice from a mobile phone.

All used componets need to setup, that they come up without any manuell interaction when the power will come back. So, enable all settings here, and also highly recommended to do a test before hand, if everything works.

The same belongs to your camera setup. Here I would personal not use a UPS for them.

Summery:

  • UPS is absolut need to have a controlled shutdown from the PI and the OH service to ensure not to loose recorded data.
  • Check beforehand which provider with what coverage
  • Have a classic VPN tunnel established, so that you can log on where ever you are.

Spares and mirroring yes, but actually, I wouldn’t be investing too much time and work here.
Recording data is not important, is it.
Plus, with SD mirroring, persistence data is saved at least daily. You can also additionally setup Amanda backup.
In short, any UPS doesn’t do harm but IMHO it is overkill.

On VPN access, sure you can do on your router, but let me point you at openHABian-integrated Tailscale VPN. Sleek and simple, and you can even connect all your openHAB instances across it.

Dear guys, thank you alot for your good hints and recommendations!
I will check your posts on the weekend and re-think my solution!

I second @jimtng 's recommendation of Frigate NVR if you want to be able to record video from your cameras locally and not be beholden to a third party cloud service for access to your camera data. There is also an openHAB binding for Frigate, I’m not using it at the moment, but I believe others do successfully.

You will not want to run Frigate on an RPi, I similarly use a NUC type PC. Adding a tensor USB chip will enable much better person/car/thing detection.

Everyone has their own idea of what is important to them, to me I would rather spend more money making sure a system does not go down in the first place, then to need a person onsite to fix a preventable issue. Its not all-remote when you need a person onsite to make a change. Some people would see the $ as overkill and rather the downtime instead, I can understand both sides.

@sl4m Depending on why you want cameras, I see it as vital to have a UPS. Often cameras do not come back up online after a power brown out, requiring a power reset to get them back running. A UPS normally prevents it from occurring in most cases. You also get video footage if someone kills power to the house before they rob you. Your planning on solar battery cameras based on other posts, so that is less likely to occur to the camera but may to a switch or any other piece of gear that gives you a remote connection.

Also before I got a UPS I would get data corruption that would stop openHAB from running every now and then. Since getting the UPS and other choices, I have had a nice run of no issues. I would never choose to resort back to backups and needing a person onsite to restore a working setup.

You can always add a UPS at any time, it does not mean you need to start from scratch so it really is no big deal. Start off small and you will soon work out when you need one.

The more complex you make a system, the more likely it is to fail. So start small and keep things simple.