HASS.io is still not for the masses (SD card fail and forced migration 0.75.3 -> 0.87.1)

IMG_4903

Running version 0.75.3 for the past 4-6 months because I couldn’t be bothered to update and deal with breaking changes. Versions 0.75.3 to 0.87.1

Everything was running more or less on autopilot. There were some odd things here and there such as my weather entities stopped working and some other minor details.

A few days ago I should have done something when I noticed the whole system slow to a crawl when refreshing. Hindsight being 20/20 it was the SD card dying but I didn’t know that at the time.

Disaster: The system died.

IMG_4904

All automation stopped is how I noticed it. This is why I state that HA is just not for the masses. If, on a RPi3 there are hardware issues, or deprecation when updating, the average Joe will or should steer clear.

  • I couldn’t log into the Rpi3.
  • The light remained red. (no flickering)

I thought the RPi3 could be dead, (albeit unlikely), so I connected an HDMI cable and saw errors upon forced restart (i.e. yanking the power). This was not good.
After another turn off I decided to pull out the card and see if it was working. In the PC I seemed to be able to read but not to re-partition with diskpart.

I paid the price when my Transcend 32Gb (purchased in 2016.08) locked up and became write only. This apparently is a sign that the card is finished.

Lifetime warranty…

Fantastic, luckily I had a backup from 3 weeks ago and nothing changed. Another Transcend micro SD card and off I went. I also still had the install image of 0.75.3.

Etching that in didn’t go as planned. With the settings and a FULL back up restored, my automations didn’t work.

A reboot later and still nothing. There is not much point in a FULL restore when it’s not fully restored. PFsense does a much better job at restoring all the functionality quickly.

New Etcher version update. Newest Hassio 0.87.1, fresh install done. Where the hell is the ADD-ON repository to add the CONFIGURATOR and/or SAMBA? It’s missing and I can’t add it in.

Re-download and re-flash 0.87.1 before slapping back in the RPi3 I decide to disable the PFblockerNG as I think the blocks were preventing access for Hassio but very unsure. (I also couldn’t access github)

With this reinstall I did NOT reinstall “SHINOBI nvr”, Grafana, INFLUXdb, motioneye, as the RPi3 is struggling as it is with all the data input it gets. This is a clean and minimalist (withing reason) re-install.

When transplanting the configuration file over I stumbled upon a few issues with breaking changes. I think these are for the SONOFFs

SONOFFS (with tasmota)

  – platform: mqtt
state_topic: “cmnd/devicenamehere/POWER1”
name: “Devicename”
payload_on: “ON”
payload_off: “OFF”
device_class: door
    retain: true <—– THIS IS NO LONGER VALID
qos: 0

SONOFFs fixed and next was….

The BRUH sensors

BRUH Sensor: ( I had planned to convert them to Tasmota style sensors but honestly, the time to convert them all is just not worth it for now, I have converted a couple)

A breaking change in 84.0

Invalid config for [light.mqtt]: [brightness] is an invalid option for [light.mqtt]. Check: light.mqtt->brightness. (See ?, line ?). Please check the docs at https://home-assistant.io/components/light.mqtt/

Found the solution here https://github.com/corbanmailloux/esp-mqtt-rgb-led

ORIGINAL BRUH non working in 0.84+

  – platform: mqtt_json
name: “SN6 LED”
state_topic: “bruh/sensornode6”
command_topic: “bruh/sensornode6/set”
brightness: true
flash: true
rgb: true
optimistic: false
qos: 0

UPDATED BRUH working as of 0.84

  – platform: mqtt
schema: json
name: SN6 LED
state_topic: “bruh/sensornode6”
command_topic: “bruh/sensornode6/set”
brightness: true
rgb: true
effect: true
effect_list: [colorfade_slow, colorfade_fast, flash]
optimistic: false
qos: 0

OK Sonoffs and Bruh sensors checked… now what

Sonoff B1 flashed with TASMOTA

I put this very dim light in the toilet room (the smallest room)

The original code was never great but it worked. But not it was causing errors all over and wouldn’t work.

  – platform: mqtt
name: “toilet light”

command_topic: “cmnd/sonoffB1.1/POWER”
state_topic: “stat/sonoffB1.1/POWER”
payload_on: “ON”
payload_off: “OFF”

brightness_command_topic: “cmnd/sonoffB1.1/DIMMER”
brightness_scale: 100
brightness_state_topic: “stat/sonoffB1.1/RESULT”
brightness_value_template: “{% if value_json.Dimmer is defined %}{{ value_json.Dimmer }}{% else %}{{ states.light.test_b1.attributes.brightness / 255 * 100 }}{% endif %}”

rgb_command_topic: “cmnd/sonoffB1.1/COLOR”
rgb_command_template: “{{ ‘%02X%02X%02X0000’ | format(red, green, blue) }}”
rgb_state_topic: “stat/sonoffB1.1/RESULT”
rgb_value_template: “{% if value_json.Color is defined %}{{ value_json.Color[0:2]|int(base=16) }},{{ value_json.Color[2:4]|int(base=16) }},{{ value_json.Color[4:6]|int(base=16) }}{% else %}{{ states.light.test_b1.attributes.rgb_color|join(‘,’) }}{% endif %}”

color_temp_command_topic: “cmnd/sonoffB1.1/CT”
color_temp_state_topic: “stat/sonoffB1.1/RESULT”
color_temp_value_template: “{% if value_json.CT is defined %}{{ value_json.CT }}{% else %}{{ states.light.test_b1.attributes.color_temp }}{% endif %}”

effect_command_topic: “cmnd/sonoffB1.1/SCHEME”
effect_state_topic: “stat/sonoffB1.1/RESULT”
effect_value_template: “{% if value_json.Scheme is defined %}{{ value_json.Scheme }}{% else %}{{ states.light.test_b1.attributes.effect }}{% endif %}”
effect_list:

– 0
– 1
– 2
– 3
– 4

availability_topic: “tele/sonoffB1.1/LWT”
payload_available: “Online”
payload_not_available: “Offline”

This above code was changed using https://www.home-assistant.io/components/light.mqtt/ to the following

This seemed to work with some modifications. Previously I used to get constant errors with the tasmota-Sonoff B1. They were non critical errors so I’d let them slide.

  – platform: mqtt
name: “toilet light”
command_topic: “cmnd/sonoffB1.1/POWER”
state_topic: “stat/sonoffB1.1/POWER”
rgb_state_topic: “stat/sonoffB1.1/color”
rgb_command_topic: “cmnd/sonoffB1.1/color”
brightness_state_topic: “stat/sonoffB1.1/dimmer”
brightness_command_topic: “cmnd/sonoffB1.1/dimmer”
color_temp_state_topic: “stat/sonoffB1.1/CT”
color_temp_command_topic: “cmnd/sonoffB1.1/CT”
qos: 1

Hurray! The Sonoff B1 is working now!

Since I’m here, fiddling around in the configuration.yaml file I might as well automate back-ups and sync them to somewhere.

AUTOMATED BACKUP to dropbox.

This was a feature I had been wanting forever. But I don’t want to mess with NODE RED as in the video from the hook up. I found this video which does the trick and has hopefully saved me a headache in the future.

Automated backups secured…

DATABASE SIZE sensor

Now if I’m going to automated the backups I also don’t want the database to start expanding to ridiculous sizes and so I’m using the HISTORY and RECORDER include & exclude functions as all my input sources make for 100mb file size in 10 hours otherwise.

Update my database file grows to 200+MB a day I’m not sure of the settings are working. More observation required.

And finally to check if the data base is being managed a database size sensor was added

sensor:
– platform: filesize
file_paths:
– /config/home-assistant_v2.db

Although it seems counter intuitive without the following the database ssize sensor didn’t work.

    whitelist_external_dirs:
– ‘/config/’

Screenshot 2019-02-27 16.49.11
After 4 days… hmmm ongoing problems?

 

Finally all done and as a bonus very few errors in the logs.

The next step that I would love to do is to have Home Assistant in a docker running on freenas or a NUC, anything more powerful and which can keep longer logs and not on an SD card. If it’s simpler than a RPi3. I would ideally like HISTORY and RECORDER info for months to analyse data patterns.

3 thoughts on “HASS.io is still not for the masses (SD card fail and forced migration 0.75.3 -> 0.87.1)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s