openHAB and Home Assistant on same Raspberry Pi 4

Hi,

I am thinking about trying out Home Assistant to see if I want to switch over from openHAB.

Is it advisable to install Home Assistant on the Raspberry Pi 4 that openHAB runs on? Will there be conflicts regarding ports etc.? Sooner or later I will either switch to HA and remove openHAB, or I will stay with openHAB and remove HA.

Might be a little low on memory, but I would hope that both would at least work, if not too performant.

image

I don’t have any “left over” Pis right now. I do have two Pi 3 with Pi-Hole running on them, but they are even older and have less memory, and if possible I would like to have HA on the device that it will be running on later on.

Thanks in advance.

It really depends on HOW you want to install HA. There are multiple installation methods. HAOS - being the one I recommend in most cases. THAT takes a wipe and load - because you’re putting a new OS controlled by HA on bare metal. It wont be the ports that gets you - I doubt you get that far. :slight_smile:

Here’s the info about install types:
Installation Methods & Community Guides Wiki - Home Assistant (home-assistant.io)

The short version - if you dont use HAOS or Supervised you dont get Add-Ons. Instead, you’ll need to roll your own containers for those services. Do you need Add-Ons? …that’s entirely unique to the user. I don’t know.

If your existing HAB is on Debian - you MIGHT be able to do a supervised install - but honestly Supervised is the hardest method to maintain and it’s finicky at best. - I wouldn’t.

If those don’t work for you then it’s Container or Core…

The problem with HA likely won’t be memory - Disk space and Disk type. I actively manage my HA event database to try to keep the size down, and my backups are still well over 8GB, Basically my system ends up keeping the last 3 - so I need whatever my HA install uses PLUS 24GB for backups. PLUS free space for various system tasks. So I need space for my install +100GB… Do you have that kind of free space?

Finally, because you’re talking Pi… even with most recent updates making the system more friendly to SD cards - I’d still avoid them and install on SSDs SDs aren’t designed for the type of random constant writes that a database inflicts and leads to early wear on SD cards. If you’re on an SD now - just be aware about the DB writes and plan accordingly with your hardware.

1 Like

Thanks. Sounds like I should rather try to install HA on some other device (unfortunately, I don’t have any lying around). Don’t want to “kill” my openHAB. :slight_smile:

My openHAB runs on a Pi without SD card but rather USB SSD with I think 128 GB. But I guess that device won’t be the one I will install HA on…

1 Like

TBH, looking at the image you posted HA Container (HA in Docker) should work fine.

You don’t get add-ons, but add-ons are just software running in Docker with sprinkles for the HAOS supervisor.

Hi,
I parallel ran openHAB and HASS on separate RPi for over a year before moving fully to HASS. This worked well, with a single MQTT broker acting as a comms path when cross-platform automation was needed.

After writing years of Java(ish) complex scripts on openHAB, I though YAML automation was going to be a toy - but in the end, the same functions ported across with about 1/10 the total lines of code. Basically the jump from openHAB2 to openHAB3 was much worse than moving to HASS!

You don’t mention the number of hardware ports / radios you use (e.g. Zigbee, Z-Wave, serial, etc), so I can’t help with the differences. Basically, it’s a little easier to use USB than something like a serial RaZberry or 1-Wire bus due to better auto-configuration.

  • Think of HASS on a RPi as like openHABian - an appliance.
    (Supervised HASS updates everything down to firmware from a web interface, without the need for SSH - but SSH is still available and sometimes useful).
  • HASS will run fine on a RPi3b (ESPhome compiles might struggle), but an original RPi3 is too old.
  • HASS supervised backups are complete, so moving from a RPi3b to a RPi4 is the simple matter of flashing the image to a uSD card and uploading the backup.

For me, the convenience of not having to remap ports through a host OS and getting the full supervised HASS install is worth the minor hassle of backup/ reflash/ restore and using an slightly slower RPi3b.

If this helps, :heart: this post!

1 Like

Thanks guys.

I will try a HA Container and play around with that a little bit. Maybe Raspberry Pis will be a little more affordable and available, so I might then get another Pi 4 to set up a whole new system.

I use a Zigbee USB stick on my Pi4 with Phoscon/Deconz. That’s about it for radios.

Don’t forget to check on Intel NUC rigs as well - much more power - similar price as long as RPi’s stay as high as they’ve been…

1 Like

Somebody on Discord bought themselves an ASUS PN41 with N6000 which has a peak power draw around the same as a Pi4, but much better performance.

I moved off a Pi years back, initially to an old i5 laptop with peak power draw around 10W. I’d never consider going back.

1 Like

Sounds good. A little on the more expensive side, but definitely something I will look into.

For the past couple of years I was hoping for Synology to come up with a good new 2-bay-NAS as I am using an old Synology DS216j right now and would have liked to move all of the stuff that is currently running on Pis (2x Pi-Home, openHAB, Node-Red, openWB (wallbox software)) to containers/VMs on a new NAS; but their new stuff is just underwhelming. So I might look into getting a different kind of home server.

Not sure what the best approach would be with something like the ASUS you mentioned… if I wanted to use Home Assistant. Would I be able to use HAOS and still install all of the other stuff I mentioned, or would it be better to use a containerized version and try to get add-ons in a different way?

Edit: I guess I would probably go for different containers, even though it might not be ideal for Home Assistant…

You could also look at “tiny desktop PC’s” (also called TFF) which are available at reasonable-ish prices on a well known auction site. Examples: Lenovo M700 series, M93, etc. Also there are similar machines from other makers. Used headless, they have more power than a raspberry pi 4 and no worries about SD failure. Cheaper than NUC for similar performance. I’ve got a Lenovo M700 running both OpenHAB and HA in Proxmox VM’s. Andreas Speiss has an informative You-tube about Pi alternatives, which is what got me interested.

1 Like

HAOS should work there, if that’s what you want

Depends on what you want. If you want an appliance like experience then go with HAOS. If you like the ability to spin up a container on demand, and trivially downgrade software… go with Container.

1 Like

I am more and more thinking I will use my existing Pi4 and use a complete, fresh HAOS installation.

It might not be the correct thread to ask this, but I’ll try anyway:

If I understand correctly, with HAOS I will be able to install Influxdb (and Grafana) as an add on to HA.

On my current system I have a few years of “persistence data” from openHAB in an existing Influxdb. Is there a way to import/restore that data into the new Influxdb that will “come with” Home Assistant?

Another thing would be that I presume that HA will not be able to use my existing influxdb but will rather use its own one, so I will somehow create all new Grafana dashboards that will use the new “sensors”/data?

Not at all, if you have an existing InfluxDB you can just point HA at it.

Regarding Grafana, there is a way to export your existing dashboards and charts etc. It varies according to the version of Grafana, but try the docs or googling for details. You get a json file for each, which can be imported into your “new” Grafana.
HTH.
Andrew

I would like to keep saving the same data points, but rather then using openHAB to do so (which saves into my “old” influxdb), I would like HA to save the same “sensor” data into an influxdb. I would like to be able to keep all of my old data and not have a “cut” when switching over to HA (with its own influxdb).

I guess it will be hard to accomplish that, basically reading all of the old data points from the old influxdb database that openHAB saved its data to and “merge” it with a new influxdb created by HA. And the Grafana dashboards should just keep displaying the old data (from openHAB( and then new new data (from HA).

Hope that makes sense somehow :slight_smile:

Today I was able to “find” a Pi4 with 8 GB of RAM and also a 120 GB SSD, so I have already set up a fresh system with HAOS. I’m quite happy of how much better I like it compared to openHAB. Still a lot of work to do, but I’ll get there some day. :smiley:

I’d expect it to be … impossible, unless InfluxDB supports the concept of aliases. HA will push the datapoints it has, which will differ from what OH has. The odds of them agreeing on the names is not high.

That’s what I thought. I will have to find a way to handle that. Maybe I can tell the Grafana querys to use both data from the old and from the new influxdb, for example “temperature_openhab” and “temperature_HA”, as the “same” datapoint/type “temperature”. Something like that…

I now have a backup of the old database, created on my old Pi. Now I’m not sure how to move those backup files to the influxdb container that is managed by Home Assistant.

I have installed Portainer already, but haven’t managed to find out how exactly to get the influxdb container to actually see that files. I copied the database backup files to my /share/ folder, but when I use the Console on that influxdb container in Portainer just to do something like “echo test > /share/test.txt”, that doesn’t create a text file in the /share/ directory…

Maybe someone here can give me a hint how to get those backup files into the container so that I can restore that old database in my new HA InfluxDB installation.