Migration from hassbian to hass.io (my experience)

With the retirement of hassbian, I thought it might be a good idea to migrate my setup to Hass.io. I thought I would share my experience with the community, hopefully it may help someone thinking to do this or generate a little mirth. It was a reasonably clean experience but not without one or two hiccups.

My setup is Home assistant runs on a Raspberry Pi 3+ with a Z-Wave USB Adapter (Aeon Labs Z‐Stick Gen5) to allow the Pi to act as a Z-Wave Hub. I use Z-Wave sensors and either Lightwave RF or Tuya switches.

First I upgraded hassbian to the latest and checked that everything was working OK afterwards.

Next, on a fresh microSD card I created a new hass.io installation, shut the Hassbian server down, replaced the SD Card and rebooted. All the lights that usually flash when a Raspberry Pi boots were flashing, so everything looked like it was going well.

Then I went to my PC and had a look on my Router to see if there was a new connection. There was! So I started Firefox and entered http://192.168.1.93:8192 and… (hiccup #1)… “Connection Refused”; I kept trying this for the next 45 minutes… gave up and pulled the plug on the Raspberry pi. I waited a few seconds and applied power again… Lights flashed encouragingly and this time I was able to connect ok from firefox.

Next I installed the SSH Server add-on and connected to hass.io from my PC using ssh. I used scp to copy my old configuration from the hassbian sd card to /config on the Hass.io server and restarted. (hiccup #2) back to “Connection Refused” again. But I was able to ssh in to the hass.io server and take a look at the home-assistant.log file. This told me that hass.io was unhappy with the database. So I deleted the database file and restarted.

Success! Sort of… Lovelace fired up and everything sort of looked as it was, All Tuya and Lightwave RF controls were working and Z_Wave hub was up and running but (hiccup #3) all my custom names had gone from my Z-Wave devices. I realized sometime later (too late) that this was because I had not copied the .config directory from my hassbian setup… To fix the problem I spent a happy hour editing my automations to use the default names for these sensors. So that was it… everything seemed to be working now…

…or not (hiccup #4) none of my shell scripts were working. On Hass.io, these are stored in a subdirectory ie /config/shell/; on hassbian, they are stored at */home/homeassistant/.homeassistant/*shell; a quick edit fixed this, no problem. All done?..

…No. (hiccup #5) I have a some shell_commands which use ssh to send controls to computers on my system. These commands worked fine from the command line but did not work from automations. A little bit of googling and I realized that I needed to copy the rsa keys from /root/.ssh to /config/.ssh and amend the shell command to include the options -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa. Everything was working after this…

…except (hiccup #6) some automations worked unreliably. Tricky. Looking at the logs it was obvious that there was a problem with nmap. Devices that were switched on were switching between “home” and “not-home” regularly and this was causing some automations to trigger and others to fail to trigger depending on what the device status happened to be.

I never really liked nmap; so I decided to get rid of it and use binary_sensor ping instead. I moved the known_devices.yaml file to known_devices.yaml.old and removed the nmap_tracker device_tracker. I created a new known_devices.yaml file and copied bluetooth known devices from the .old file. I spent a happy six hours editing and re-editing my config files to migrate to ping binary_sensors. So now, finally I thought everything was working but…

(hiccup #7) google_maps wasn’t working; easy I hadn’t copied the cookie file over, so easy to fix? Copy the file over. re-start… still not working. log file says the cookie file creates an invalid session. This was the same problem that I experienced the first time I integrated google_maps. It took another happy hour or so, generating and re-generating cookie files until eventually it sprung into life.

(hiccup #8) I discover that my git credentials disappear on reboot. On investigation this issue was similar to hiccup #5; basically after a reboot any root settings seem to be lost so it is necessary to embody things you want to persist into /config path). In order to get git to remember credentials I normally issue the command

$ git config --global credential.helper store

On Hass.io I amended this as follows:

$ git config credential helper "store --file=/config/.git-credentials

This worked a treat the .git-credentials file was created in the /config directory when I invoked an update to my repository and thereafter I wasn’t prompted for credentials.

Everything is now back as it was. I’m pleased with the result and think the switch was worth it! It made me replace nmap and I like the add-ons, HASS configurator is great, I’m also using Dnsmasq, Duck DNS, SSH Server, Hass.io Google Drive Backup and Check Home Assistant configuration. All were easy to setup and use.

To see my setup on git click here .

4 Likes

Thanks very much for this overview, very helpful. I’m just about to start this exercise with a new Pi 4. My current Ubuntu venv installation has finally failed me while trying to upgrade to python3.7, hass.io looks like a better solution all round.

1 Like

Thanks for your reply. Pleased you found the article useful :grinning: Just FYI, I used this SD Card. Incredible speed & very low price on Amazon.