Cant access web interface

I have Home Assistant OS 5.11 / Core 2021.2.3 installed in a rasPi3B, and been getting components running one at a time over the past few days. Curiously it feels that I often had to reboot the RasPi a few times before changes to configuration.yaml take effect - but that may be my inexperience.

This afternoon I started on adding my Google Calendar, so followed https://www.home-assistant.io/integrations/calendar.google/ to create and add the Google Client_id to configuration.yaml, and rebooted. On reboot the web interface briefly popped up a window, but was gone before I paid attention.

I now have a web interface comprising a blue horizontal bar and white screen - no text or icons. Page source contains one long line of HTML with javascript and lots of includes.

I may have done a hard reboot at this time - sorry, can’t remember.

I turned to the RasPi console, but the screen was blank, and keyboard had no effect. Samba was still working, and I was able to download the home-assistant.log from the config share…

2021-02-21 14:19:45 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for bureau_of_meteorology which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2021-02-21 14:19:57 WARNING (MainThread) [homeassistant.setup] Setup of recorder is taking over 10 seconds.
2021-02-21 14:20:26 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=24 from 2021-02-21 03:04:43.558439)
2021-02-21 14:20:45 WARNING (MainThread) [homeassistant.setup] Setup of coronavirus is taking over 10 seconds.
2021-02-21 14:20:45 ERROR (MainThread) [homeassistant.components.coronavirus] Timeout fetching coronavirus data
2021-02-21 14:20:49 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform snmp is taking over 10 seconds.
2021-02-21 14:20:52 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 301, in async_add_entities
    tasks = [
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 301, in <listcomp>
    tasks = [
  File "/usr/src/homeassistant/homeassistant/components/coronavirus/sensor.py", line 21, in <genexpr>
    CoronavirusSensor(coordinator, config_entry.data["country"], info_type)
  File "/usr/src/homeassistant/homeassistant/components/coronavirus/sensor.py", line 38, in __init__
    self.name = f"{coordinator.data[country].country} Coronavirus {info_type}"
TypeError: 'NoneType' object is not subscriptable

Coronavirus has been working for several days, and has no entries in the configuration.yaml file. This is the configuration.yaml …

# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

###################################################################

# Google calendar
google:
   client_id: '##redacted##.apps.googleusercontent.com'
   client_secret: '##redacted##'

#
# Draytek 2760 modem SNMP.
#       use snmpwalk to find the oids available for this device, listed below
#
sensor Vigor2760_SysDescr:
  - platform: snmp
    name: "Router Description"
    host: 192.168.1.1
    community: 'public'
    version: '2c'
    baseoid: 1.3.6.1.2.1.1.1.0
# 1.3.6.1.2.1.1.1.0 = STRING: "DrayTek Corporation, Router Model: Vigor2760 Series, Version: 3.8.9.4_VT2, Build Date/Time:Dec 25 2018 13:46:53, CPU Usage: 1%, Memory Usage:66%"
# 1.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.7367           # sysObjectID
sensor Vigor2760_UpTime:
  - platform: snmp
    name: "Router uptime"
    host: 192.168.1.1
    community: 'public'
    version: '2c'
    baseoid: 1.3.6.1.2.1.1.3.0
    accept_errors: true
    unit_of_measurement: "minutes"
    value_template: "{{((value | int) / 6000) | int}}"
# 1.3.6.1.2.1.1.3.0 = Timeticks: (1524000) 4:14:00.00       # sysUpTime
# 1.3.6.1.2.1.1.4 sysContact
# 1.3.6.1.2.1.1.5.0 = STRING: "DrayTek_Vigor_2760"  #  sysName
#   next is a table of the available interfaces. 
#   interface number 5 = WAN2, which is Ehernet connection to to NBN FTP
# 1.3.6.1.2.1.2.2.1.5.5 = Gauge32: 1048576000       # ifSpeed   = 1Gigabit interface
# 1.3.6.1.2.1.2.2.1.6.5 = Hex-STRING: 00 1D AA 67 B6 3A     # ifPhysAddress = MAC address
# 1.3.6.1.2.1.2.2.1.9.5 = Timeticks: (0) 0:00:00.00 # ifLastChange
sensor Vigor2760_InOctets:
  - platform: snmp
    name: "Router Incoming Data"
    host: 192.168.1.1
    community: 'public'
    version: '2c'
    baseoid:  1.3.6.1.2.1.2.2.1.10.5
    accept_errors: true
    unit_of_measurement: "Kbytes"
    value_template: "{{((value | int) / 1024) | int}}"
# 1.3.6.1.2.1.2.2.1.10.5 = Counter32: 4089853       # ifInOctets
sensor Vigor2760_OutOctets:
  - platform: snmp
    name: "Router Outgoing Data"
    host: 192.168.1.1
    community: 'public'
    version: '2c'
    baseoid:  1.3.6.1.2.1.2.2.1.16.5
    accept_errors: true
    unit_of_measurement: "Kbytes"
    value_template: "{{((value | int) / 1024) | int}}"
# 1.3.6.1.2.1.2.2.1.16.5 = Counter32: 184991        # ifOutOctets

#
# Time around the world
#
sensor WorldClock_SG:
  - platform: worldclock
    name: Time in Singapore
    time_zone: Asia/Singapore
sensor WorldClock_NZ:
  - platform: worldclock
    name: Time in New Zealand
    time_zone: Pacific/Auckland
    
#
# current petrol prices from NSW FuelCheck app
#
sensor FuelCheck_Towradgi:
  - platform: nsw_fuel_station
    fuel_types: "U91"
    station_id: 1114        # Independent Towradgi
sensor FuelCheck_MetroFairyMeadow:
  - platform: nsw_fuel_station
    fuel_types: "U91"
    station_id: 18111       # Metro Petroleum Fairy Meadow
sensor FuelCheck_MetroWollongong:
  - platform: nsw_fuel_station
    fuel_types: "U91"
    station_id: 18475       # Metro Wollongong

I immediately commented out the Google entries, without any noticable effect.

I found several rather old posts describing this same symptom, but without a resolution which makes sense in this case. I followed the suggestion to delete the home-assistant_v2.db file, and after a couple more reboots the console is now working - but the web GUI is still not.

It seems to me quite odd that the configuaration interface for an app dies but other parts continue on, so I’ll put this memory card aside so I can try any suggestions of how to resurect the web GUI.

Thanks in advance,
Don

Just popped the SD card into my linux desktop, and Disks found 8 partitions:

hassos-boot      34MB FAT
hassos-kernel    25MB Ext4
                268MB squashfs
hassos-kernel    25MB Ext4
                268MB squashfs
                8.4MB unknown
hassos-overlay  101MB Ext4
hassos-data      15GB Ext4

randomly swapping between kernel partitions might explain why simple text changes in configuration.yaml sometimes took a couple of reboots to take effect.

… except …

that is what a fresh install from hassos_rpi3-5.10.img.xz gives me.

Slow down.
Stop rebooting, when you change something in config. Go into the configuration panel and click “Check configuration”, if it’s all good then go to server controls and reload the section needed or restart home assistant if needed. You shouldn’t be rebooting the machine every time.
Also noticed a problem. Your indentation is off ok the Google lines should be a two space indent on the lines under it, you have three spaces.

Also all your sensor lines seems wrong:
Where did you copy and paste these from?

The sensor lines are fine like this, it’s a bit unusual, but it works as well.

Thanks Sam, but your replies read more as criticism of a newbie, than helping get my web GUI back :frowning:

The first thing I tried was to comment out the 3 lines in configuration.yaml I had just added (via the samba interface which is still working) … so i assumed that something else had got broken.

But no … deleting ALL of my entries on configuration.yaml (back to the original 13 lines) has actually got the GUI back !!! Thanks.

Curiously the Overview (Lovelace) page shows entries and values for sensor entries which are no longer in configuration.yaml. This doesn’t seem right.

You say to “stop rebooting”, then say to “restart home assistant if needed”. Do you mean to use Configuration > Server Controls > RESTART, Supervisor > System > RESTART CORE, Supervisor > System > RELOAD SUPERVISOR, Supervisor > System > RESTART SUPERVISOR, or Supervisor > System > REBOOT HOST … or is there another control in the GUI I haven’t noticed yet ? And how does a newbie determine which is the appropriate way to reload which “section” ?

As for where I got my configuration.yaml lines from ? I have spent several months on and off trying to get my head around HA’s documentation - just getting more and more confused. Yes, it feels inefficient repeating so many parameters, so I’m sure there is a better style … so maybe once I’ve filled my dashboard I’ll try to figure it out. If only the “documentation” on the home-assistant.io website started with an overview, an explanation of basic terminology, and a few basic worked examples.

YAML is fairly forgiving about the order of entries, it’s indentation that makes all the difference. There are lots of ways to define objects that yield the same result. For instance - your SNMP sensors could look like this:

sensor: 

  - platform: snmp
    sensors:

      Vigor2760_SysDescr:
        friendly_name: "Router Description"
        host: 192.168.1.1
        community: 'public'
        version: '2c'
        baseoid: 1.3.6.1.2.1.1.1.0
    
      Vigor2760_UpTime:
        friendly_name: "Router uptime"
        host: 192.168.1.1
        community: 'public'
        version: '2c'
        baseoid: 1.3.6.1.2.1.1.3.0
        accept_errors: true
        unit_of_measurement: "minutes"
        value_template: "{{((value | int) / 6000) | int}}"
    
     Vigor2760_InOctets:
        friendly_name: "Router Incoming Data"
        host: 192.168.1.1
        community: 'public'
        version: '2c'
        baseoid:  1.3.6.1.2.1.2.2.1.10.5
        accept_errors: true
        unit_of_measurement: "Kbytes"
        value_template: "{{((value | int) / 1024) | int}}"
    
    Vigor2760_OutOctets:
        friendly_name: "Router Outgoing Data"
        host: 192.168.1.1
        community: 'public'
        version: '2c'
        baseoid:  1.3.6.1.2.1.2.2.1.16.5
        accept_errors: true
        unit_of_measurement: "Kbytes"
        value_template: "{{((value | int) / 1024) | int}}"

Now that SHOULD work, and is maybe a bit easier to read.

I am yet to find a good YAML primer - and my configuration is a mix of many different syntax as I have learned over the years. The main take aways I have is to:

  • backup, offline, the snapshots are just archives you can open on a PC and pull out the config files if all goes wrong, plus they are easy to restore

  • go slow - add one integration at a time, check config and the just restart HASS from the cog wheel menu in config editor. Rarely is a full reboot required. You also have the option there of just reloading automations, groups etc.

Sometimes this is your browser cache, sometimes it’s because you have an integration installed that self-add sensor or switches.

I have LOTS of issues with Chrome requiring cache clearing, full shutdown of çhrome and start up again.

What happened to creating a snapshot before updating or messing around with the config?
Then you can always hit the ‘undo’ button…

and if the ‘undo’ button. didn’t work, then it is probably the browsers cache as mentioned is previous message :thinking:

Thanks Daryl for trying to tidy up my YAML - though readability improved mostly by just removing the commented out oids that I thought were not useful.

First issue was the unknown keyword “sensors:”
Invalid config for [sensor.snmp]: [sensors] is an invalid option for [sensor.snmp]. Check: sensor.snmp->sensors. (See ?, line ?).

On removing the sensors: line, I got another error:
Invalid config for [sensor.snmp]: [Vigor2760_SysDescr] is an invalid option for [sensor.snmp]. Check: sensor.snmp->Vigor2760_SysDescr. (See ?, line ?).

The thing that puzzles me most is … why does YAML insist on using my friendly_name as the entity ID, even though I have provided a unique sensor name (eg. Vigor2760_SysDescr) ?

And with a bit of experimentation I find that you mean “Supervisor > System > RESTART CORE” to action any changes to configuration.yaml

Not my intention, unspent quite a bit of time trying to find your problem. As for the sensor lines, I’ve never seen them done like that so asked where you got them from? Never seen them like that in the docs…

Have you reloaded the config?

Rebooting the host machine is different to clicking restart in the server controls section.
For many changes there are reload buttons that simply reload that part of the config. They are well labelled so it should be clear which one to press.

Anything that isn’t done in the GUI seems to have been labelled, advanced. Advanced Configuration - Home Assistant

Lol! I didn’t say it “would” work - I said “should”… :slight_smile:

Do you you use the file editor add-on to edit your yaml?

image

If not you should - it has an editor menu with things like auto comment and indent, plus an undo button.

It also has the cog menu, top right in the screen shot, that let’s you restart and reload things from within the editor. I often have one browser window permanently loaded with this, and another that lets me see the results of my change after reload:

Hi Daryl,

Ahhhh! that cog ! Knowing that File editor is optional, I had assumed references to the cog were to the Configuration option on the main menu down the left hand side of the screen.
And restarting core from there will definitely be more convenient.

As far as my YAML code goes, it is basically bits copy and pasted from various web pages; most of which are probably out of date.