[SOLVED] Fresh install of openHAB2 via repository does not work (Linux)

I just meant to say that as it’s generic we cannot know/own/test all the variants a user might come up with. That does not require a disclaimer as it is self-explanatory, isn’t it.
Of course there’s commonly used combos it is tested on.

Hi,
I can confirm as well that the install through apt repository (on Ubuntu 18.04.3) is not working with 2.5.0.

I’m new to OpenHAB (as in since today new) and just came from a bad experience with “prepacked” systems such as HASS.IO (Home Assistant) so I wanted to go the more controlled way by doing the installation myself.
The documentation was very well done which gave me the confidence that openHAB2 is (at least I got that perception) more stable than that bleeding edge Home Assistant mess.

I’m reluctant to go the openHABian route because I don’t want another “blackbox” software on my hands (especially if at some future point should be running my house).

Any chance this issue on repository linux is going to get solved soon?
Thanks in advance

Hello Markus,
Let me assure you it is not. Especially because the documentation handles both debian/ubuntu as well as yum repository distos, and the documentation is exceptionally well written and complete, one could be under the impression that surely the most vanilla Ubuntu LTS release (18.04.3) would be in the standard smoke test set. This is not ‘any combination a user can come up with’.

If the self-install path is really such uncharted territory, it wouldn’t hurt to add the disclamer and save new (but experienced Linux) users such as myself the hassle of putting our faith in this documentation.

Thanks

1 Like

@k3mist and @FL140,

More "helluva first post!"s :smiley: Welcome to our little corner of the Internet!

This is now the Second third time in the last day or two that a new user joins and immediately is contributing with their very first post. I just said the same thing to @collectivetrader a little while ago in fact.

Welcome indeed! To all three of you! :smiley:

I think we might be on to something here… At least 3 people that I have read having same symptoms. I will cross post this workaround to the other thread. Collectivetrader is already here, so no more need to alert him.

Is it too soon to file a bug report? Seems reproduceable. @collectivetrader, you want to to see if purging the addons package makes things work for you, as a temp workaround, and so I can start formulating a bug report (with possible insight into where to look)?

EDIT: Sorry, I was confused. There are only 2 threads about this. I thought collectivetrader made his own post but he actually had posted in this thread:

Anyway, so yeah, only 2 threads about this issue (that I am aware of).

Also, @k3mist, I am not sure why you marked mstormi answer about openHABian as the solution (maybe mis-click)? I think you should probably correct that to your own post that actually contains the solution, in case anyone else comes along here looking for answers.

1 Like

Welcome from another former HA user.
OpenHABian is not like HASS.IO but is where HA got the idea fir their now discontinued HASSbian. It can either be installed on a Pi as a Raspian image or installed on any Linux system using git.
OpenHABian is basically a set of script to ease the complex installation requirements for OpenHAB and make it easier to add common companion programs. OpenHABian actually uses the apt packages for a Debian-based installation.

Thanks for the welcome! I marked that as the solution because it resolves the issue with the addons package installed.

Specifically the options I ran from the openHABian config menu were

01
02
03
10 -> 11
10 -> 13
10 -> 14


options 01 through 03 did not do anything since i was already fully up-to-date

still had my terminal open that i did this on; https://pastebin.com/Qx2CQJAV
commands from terminal

pi@habnode-master ~ % sudo apt purge openhab2 openhab2-addons  
pi@habnode-master ~ % sudo apt install openhab2                  
pi@habnode-master ~ % sudo /bin/systemctl daemon-reload          
pi@habnode-master ~ % sudo /bin/systemctl enable openhab2.service
pi@habnode-master ~ % sudo /bin/systemctl start openhab2.service
// checking to make sure its running
pi@habnode-master ~ % sudo git clone https://github.com/openhab/openhabian.git /opt/openhabian
pi@habnode-master ~ % sudo ln -s /opt/openhabian/openhabian-setup.sh /usr/local/bin/openhabian-config
pi@habnode-master ~ % sudo /bin/systemctl stop openhab2.service                                
pi@habnode-master ~ % sudo openhabian-config             
// ran the above options                                            
pi@habnode-master ~ % sudo /bin/systemctl stop openhab2.service                                      
pi@habnode-master ~ % sudo apt install openhab2-addons       
pi@habnode-master ~ % sudo /bin/systemctl start openhab2.service
2 Likes

@TRS-80: hi and thanks for welcoming us to the community.
I agree this is something which should be fixed rather than mark this issue solved on account that there is an alternative (openHABian) to install.

Rather than purging the add-ons, I’ve simply rolled-back my VM to a clean Linux install and started over. These are the exact steps I did:
Zulu install

    > apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0xB1998361219BD9C9
    > apt-add-repository 'deb http://repos.azulsystems.com/ubuntu stable main'
    > apt-get update
    > apt-get install zulu-8

openHAB install

    > cd /tmp
    > wget -qO - 'https://bintray.com/user/downloadSubjectPublicKey?username=openhab' | sudo apt-key add -
    > echo 'deb https://dl.bintray.com/openhab/apt-repo2 stable main' | sudo tee /etc/apt/sources.list.d/openhab2.list
    > apt-get update
    > apt-get install openhab2
    > systemctl start openhab2.service

With this done, it works like a charm. So confirmed that the issue happens due to the installation

 > apt-get install openhab2-addons

Now I don’t know yet what is in the addons package? I assume openHAB won’t be the same without it so presumably the installation is definately worth fixing.

Thanks for the support

afaik its all the addons from here https://www.openhab.org/addons/

Hello @Bruce_Osborne,
Thanks for pointing out the difference with HA.
In general I’m a bit reluctant to rely on scripts of which you don’t know what they do behind the scenes. It’s great to get up-and-running fast but when it comes to upgrade-time, I prefer to upgrade in a controlled manner (one component at a time) so it doesn’t break things and if it does, at least I know which step broke it :slight_smile:
I’ve had too many installs work fine out of the box but broke after upgrade.

If open HABian is not like that at all, I’m willing to give it a try.
I was also thinking, because openHAB seems to have an excellent backup/restore functionality, to 1) simply backup my setup, 2) throw away the old VM, 3) install a fresh system from scratch (so no update) and 4) restore my config.
Does this method pose less risk of breaking things?
I’m working on virtual machines so in practice it seems easy enough to do this if it were to increase stability.

Thanks for the support

Oh ok. Seems pretty significant than. Probably can’t run openHAB without it because the add-ons represent the connection to things.

If your system can update over the Internet it just downloads what you select. That package is for those with no public Internet connectivity at all. I have never installed the bindings package.

1 Like

agreed. it is if the pi wont have internet access (mine wont).

hab works fine without the addons package and installing through the ui instead (but it requires internet access). i tested by installing through paper ui without the addons package and it works fine. but if you want the addons package definitely requires going through openhabian config

OK cool. That opens possibilities !
I’ll start off without the add-on package and will see where it leads me.
Since I’m new to openHAB, I’ll probably be messing around with the config and reinstalling the machine a couple of times in BETA before going to a clean production setup.
By then, the add-on bug might be solved already :slight_smile:

Thanks

Bruce beat me to the punch but yes it’s the entire collection of addons, for the case of offline use. I have never installed it either. Seems like a waste of space, as you will likely never use 90% of them. Not only that but an offline home automation controller? That whole use case now that I thihnk about it seems a lot less useful to me (no weather or other information, remote control, sending notifications (the last being arguably most important)). To each their own I guess; options are good.

I am like you in our apparent shared disdain for installation scripts. I want to know what is going on at each step, in case something goes wrong (now, or later). This is why I don’t use Docker images, pre-built OS images (for the most part), etc…

Something else I do is to keep my settings (/etc/openhab2/*) under version control using Git. And hand in hand with that, I try and keep (as much as possible) a text based configuration. I have read about too many people having trouble at upgrades. I’m suspect an experienced Linux sysadmin like yourself will probably see where I am coming from on that.

Keep asking questions here. Where are you located and what sorts of devices are you considering?

The first time when I was researching home automation as a hobby I made the mistake of not posting here to the forum. I ended up trying Home Assistant because it appeared easier and OH was in a transitional state. When I reconsidered OH the developers and users here helped me get going. The system plans are starting to get more cohesive now.

Somebody (the openHABian developer, I think) stated here the 3 most important goals for an automation system are stability, stability. and stability. I found that lacking in HA.

actually, early on, I helped debug a script issue.

I agree, except for Things. In my experience, letting the system discover them works best.

HA has entities, openHAB has )approximately) split that into the physical Things and Items controlled by the system. They are connected by linking the Item to a Thing channel.

Yeah that’s where I am at. Not by conscious decision, but becasue I started out following the instructions to get things working through Paper UI. Now I have this sort of bastardized set up where I am honestly not sure what I would do in the event of declaring openHAB bankruptcy and starting all over fresh. I keep thinking about it though…

You are right though, auto discovery usually works well and creating all those channels and items (for certain things, some have quite a lot) and linking them seems like it would be tedious.

OTOH, some of those things have lots of channels I don’t think I would ever use, either. So perhaps I could move one step closer towards all text files by first letting some Thing auto discover, see what channels openHAB / PaperUI come up with, and then manually create the necessary counterpart in some text file(s) in another window using the discovered node ID, then delete the discovered Thing in Paper UI, and finally save the new version of config text file(s), and watch the console/logs to make sure it picked up everything without any errors…

Just sort of thinking out loud here.

Advice:
In spite of what the tutorial says, do NOT turn on Simple Mode in the Paper UI. It confuses and adds unnecessary complexity.

Yeah, I find myself toggling it on and off. ON when discovering / adding new Things (to auto create all that stuff) and then OFF when I need to find the name of a certain item for a rule or something (because otherwise it would be hidden).

But you are right, that was one of the BIG stumbling blocks for me at first.

You don’t need Simple mode turned ON for that.

1 Like