Ha-floorplan resulting in "TypeError: Cannot read properties of undefined" on automatic default view

when I am on any of the tabs other than “Aperçu” (FR) which is the equivalent of “Overview” (EN) and I then select “Aperçu”, I get.

And in the console:

hui-error-badge.ts:22 TypeError: Cannot read properties of undefined (reading 'entity_id')
    at o (typography.js:181:1)
    at 62012e21.js:1:13284
    at Array.sort (<anonymous>)
    at 62012e21.js:1:13256
    at Array.forEach (<anonymous>)
    at f (62012e21.js:1:13226)
    at m (62012e21.js:1:14107)
    at y.generateView (62012e21.js:1:15164)
    at async o (hui-error-badge.ts:22:1)
    at async r.value (hui-masonry-view.ts:44:1)

However when reloading the page, it is shown just fine so that is what I do.
Using HA2022.10.5

EDIT: @duceduc identified that ha-floorplan was involved, I created issue [BUG] ha-floorplan breaks the automatic dashboard/view · Issue #335 · ExperienceLovelace/ha-floorplan · GitHub .

Reloading is using your cached page, there’s an error in your current config.

I went in dev mode also to disable caching, did CTRL+F5, etc, have made several HA updates since this started happening, etc.

I tried in private navigation - no issue.

So I went in DeveloperTools/Cache Storage and deleted al of the caches manually using the delete icon. Then it is sometimes ok, but still fails on some changes.

EDIT: just reproduced it in private mode as well.

EDIT2: The overview is still the automatically generated page. When I want to edit it, HA shows the popup " Take control of your dashboard".

post your config

What do you want:

  • View? there is no userconfiguration file for the view because it is generated - I could possibly try to edit it and hopefully it stays automatic as long as it is not saved.
  • Config.yaml & others, hidden configuration directory?

I remind that the page shows when opening the view directly (specified in the url), but not when changing the view without reloading the page.

This is the configuration that the view provides when I edit it from the error state (after accepting to “Take control”):

title: Name
views:
  - cards:
      - type: markdown
        content: |-
          Error loading the view strategy:
          > TypeError: Cannot read properties of undefined (reading 'entity_id')

This is the contents of a new default panel:

title: Name
views:
  - path: default_view
    title: Home
    cards:
      - type: entities
        entities:
          - sensor.hacs
          - entity: sensor.bureau_temperature_humidity
            name: Temperature humidity
          - entity: sensor.bureau_temperature_temperature
            name: Temperature temperature
          - entity: light.bureau_lumi_on_off
            name: Lumi on_off
          - light.reunion_lumi_on_off
          - light.tz3000_5ng23zjs_ts0001_55471efe_on_off
          - entity: sensor.bureau_lumi_on_off_power
            name: Lumi on_off power
          - entity: sensor.bureau_lumi_on_off_energy
            name: Lumi on_off energy
          - sensor.reunion_lumi_on_off_power
          - sensor.reunion_lumi_on_off_energy
          - entity: sensor.tz3000_5ng23zjs_ts0001_55471efe_on_off_power
            name: Power
          - entity: sensor.tz3000_5ng23zjs_ts0001_55471efe_on_off_energy
            name: Energy
          - entity: switch.bureau_aux_32e860fe_on_off
            name: Aux
          - switch.multiprise_on_off
          - entity: sensor.bureau_lumi_on_off_energy_daily
            name: Lumi on_off energy daily
          - entity: sensor.bureau_lumi_on_off_energy_weekly
            name: Lumi on_off energy weekly
          - entity: sensor.bureau_lumi_on_off_energy_monthly
            name: Lumi on_off energy monthly
          - sensor.reunion_lumi_on_off_energy_daily
          - sensor.reunion_lumi_on_off_energy_weekly
          - sensor.reunion_lumi_on_off_energy_monthly
          - entity: sensor.tz3000_5ng23zjs_ts0001_55471efe_on_off_energy_daily
            name: Energy daily
          - entity: sensor.tz3000_5ng23zjs_ts0001_55471efe_on_off_energy_weekly
            name: Energy weekly
          - entity: sensor.tz3000_5ng23zjs_ts0001_55471efe_on_off_energy_monthly
            name: Energy monthly
        title: Bureau
      - type: entities
        entities:
          - sensor.compteur_elec_smartenergy_metering
          - >-
            sensor.cleode_zmeter_e_09622301_smartenergy_metering_summation_delivered
        title: Entrée
      - type: entities
        entities:
          - light.principal_lumi_on_off
          - light.tz3000_5ng23zjs_ts0001_8d421efe_on_off
          - sensor.principal_lumi_on_off_power
          - sensor.principal_lumi_on_off_energy
          - sensor.tz3000_5ng23zjs_ts0001_8d421efe_on_off_power
          - sensor.tz3000_5ng23zjs_ts0001_8d421efe_on_off_energy
          - switch.principal_aux_on_off
          - sensor.principal_lumi_on_off_energy_daily
          - sensor.principal_lumi_on_off_energy_weekly
          - sensor.principal_lumi_on_off_energy_monthly
          - sensor.tz3000_5ng23zjs_ts0001_8d421efe_on_off_energy_daily
          - sensor.tz3000_5ng23zjs_ts0001_8d421efe_on_off_energy_weekly
          - sensor.tz3000_5ng23zjs_ts0001_8d421efe_on_off_energy_monthly
        title: Espace Principale
      - type: entities
        entities:
          - sensor.brother_mfc_9340cdw_black_toner_cartridge
          - sensor.brother_mfc_9340cdw_cyan_toner_cartridge
          - sensor.brother_mfc_9340cdw_magenta_toner_cartridge
          - sensor.brother_mfc_9340cdw_yellow_toner_cartridge
          - sensor.brother_mfc_9340cdw
          - sensor.epson_wf_7610_series_black_ink
          - sensor.epson_wf_7610_series_cyan_ink
          - sensor.epson_wf_7610_series_magenta_ink
          - sensor.epson_wf_7610_series_yellow_ink
          - sensor.epson_wf_7610_series
          - light.technique_lumi_on_off
          - sensor.technique_lumi_on_off_power
          - sensor.technique_lumi_on_off_energy
          - sensor.technique_lumi_on_off_energy_daily
          - sensor.technique_lumi_on_off_energy_weekly
          - sensor.technique_lumi_on_off_energy_monthly
        title: Pièce Technique
      - type: grid
        square: false
        columns: 1
        cards:
          - type: entities
            entities:
              - light.tz3000_5ng23zjs_ts0001_on_off
              - sensor.reunion_humidity
              - sensor.reunion_temperature
              - sensor.principal_humidity
              - sensor.principal_temperature
              - sensor.tz3000_5ng23zjs_ts0001_on_off_power
              - sensor.tz3000_5ng23zjs_ts0001_on_off_energy
              - sensor.trv_dom_vth20_5ce90822_smartenergy_metering
              - >-
                sensor.trv_dom_vth20_5ce90822_smartenergy_metering_summation_delivered
              - sensor.trv_dom_vth20_5ce90822_temperature
              - sensor.trv_dom_vth20_5ce90822_thermostat_hvac_action
              - sensor.tz3000_5ng23zjs_ts0001_on_off_energy_daily
              - sensor.tz3000_5ng23zjs_ts0001_on_off_energy_weekly
              - sensor.tz3000_5ng23zjs_ts0001_on_off_energy_monthly
            title: Salle de Réunion
          - type: thermostat
            entity: climate.trv_dom_vth20_5ce90822_thermostat
      - title: Energy distribution today
        type: energy-distribution
        link_dashboard: true
      - type: grid
        square: true
        columns: 3
        cards:
          - type: picture-entity
            entity: person.mario_de_weerd
            aspect_ratio: '1'
            show_name: false
            image: >-
              data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'
              viewBox='0 0 50 50' width='50' height='50'
              style='background-color:%23b3e5fC'%3E%3Cg%3E%3Ctext
              font-family='roboto' x='50%25' y='50%25' text-anchor='middle'
              stroke='%23212121' font-size='1.3em'
              dy='.3em'%3EMDW%3C/text%3E%3C/g%3E%3C/svg%3E
          - type: picture-entity
            entity: person.roland_r
            aspect_ratio: '1'
            show_name: false
            image: >-
              data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'
              viewBox='0 0 50 50' width='50' height='50'
              style='background-color:%23b3e5fC'%3E%3Cg%3E%3Ctext
              font-family='roboto' x='50%25' y='50%25' text-anchor='middle'
              stroke='%23212121' font-size='1.3em'
              dy='.3em'%3ERR%3C/text%3E%3C/g%3E%3C/svg%3E
      - type: entities
        entities:
          - binary_sensor.updater
        title: Binary sensor
      - type: grid
        square: false
        columns: 1
        cards:
          - type: thermostat
            entity: climate.bureau
          - type: thermostat
            entity: climate.principal
          - type: thermostat
            entity: climate.reunion
      - type: entities
        entities:
          - scene.tout_eteint
        title: Scene
      - type: entities
        entities:
          - sensor.95_weather_alert
          - sensor.bezons_cloud_cover
          - sensor.bezons_daily_precipitation
          - sensor.bezons_freeze_chance
          - sensor.bezons_next_rain
          - sensor.bezons_rain_chance
          - sensor.bezons_snow_chance
          - sensor.bezons_uv
          - sensor.bureau_aux_32e860fe_on_off_energy
          - sensor.bureau_aux_energy_daily
          - sensor.bureau_aux_energy_monthly
          - sensor.bureau_aux_energy_weekly
          - sensor.bureau_aux_32e860fe_on_off_power
          - sensor.cert_expiry_timestamp_https_ha_ynamics_fr
          - sensor.conso_elec_somme
          - sensor.danfoss_etrv0100_f42ef0fe_pi_heating_percent
          - sensor.light_trv_eldb_1_debit
          - sensor.light_trv_eldb_2_debit
          - sensor.principal_aux_on_off_energy
          - sensor.principal_aux_on_off_energy_daily
          - sensor.principal_aux_on_off_energy_monthly
          - sensor.principal_aux_on_off_energy_weekly
          - sensor.principal_aux_on_off_power
          - sensor.trv_dom_vth20_0c1a0922_pi_heating_percent
          - sensor.trv_dom_vth20_5ce90822_pi_heating_percent
          - sensor.neufbox_router_b_received
          - sensor.neufbox_router_b_sent
          - sensor.neufbox_router_external_ip
          - sensor.degc_principal
        title: Sensor
      - type: weather-forecast
        entity: weather.bezons
        show_forecast: false

Hi. I am getting the exact same error message showing in the first post. It has been awhile and I never gotten around to fix as as I don’t know where to start. After a reboot, I get this error when viewing my overview page. A reload of the page fixes, but it is just a bandage fix.

I know what is causing the error, but I don’t know why. See below update.

partial config.yaml:

pyscript: !include pyscript.yaml
alert: !include alerts.yaml
frontend: !include frontend.yaml
lovelace: !include lovelace.yaml
input_number: !include input_number.yaml
input_datetime: !include input_datetime.yaml
input_select: !include input_select.yaml

frontend.yaml

  javascript_version: latest
  themes: !include_dir_merge_named themes

lovelace.yaml

    mode: yaml
    resources:
      - url: /local/custom_ui/button-card.js
        type: module
      - url: /local/custom_ui/layout-card.js
        type: module
      - url: /local/custom_ui/weather-card.js
        type: module

    dashboards:
      lovelace-floorplan:
        mode: yaml
        filename: lovelace/dashboards/floorplan/ui-floorplan.yaml
        title: Floorplan
        icon: mdi:view-dashboard
        show_in_sidebar: true
        require_admin: false

ui-lovelace.yaml

custom_header:
  compact_mode: true
  button_text:
    options: '{{ hours12LZ }}:{{ minutesLZ }}'
  hide_help: true
  hide_config: true
  shadow: on
  chevrons: false

#title: DS
#icon: mdi:home
background: "center / cover no-repeat url('/local/lovelace/wallpaper/midnight.jpg') fixed"
views:

  - !include lovelace/dashboards/overview/data.yaml
  - !include lovelace/dashboards/overview/climate.yaml
  - !include lovelace/dashboards/overview/switches.yaml
  - !include lovelace/dashboards/overview/rooms.yaml
  - !include lovelace/dashboards/overview/floorplan.yaml
  - !include lovelace/dashboards/overview/weather.yaml
  - !include lovelace/dashboards/overview/automations.yaml
  - !include lovelace/dashboards/overview/energy.yaml
  - !include lovelace/dashboards/overview/chores.yaml
  - !include lovelace/dashboards/overview/signals.yaml

Here is the error log in browser.

Update: I figured out why it is throwing the error, but I don’t know how to fix it. It seems the additional dashboard I have created (Floorplan) is causing the error when viewing the overview page. It does not happen after a restart of HA; It happens whenever I click on the floorplan page and back to overview page.

lovelove.yaml:

    dashboards:
      lovelace-floorplan: # url slug need to contain a hyphen
        mode: yaml
        filename: lovelace/dashboards/floorplan/ui-floorplan.yaml
        title: Floorplan
        icon: mdi:view-dashboard
        show_in_sidebar: true
        require_admin: false

floorplan.yaml: With these codes alone, I receive the error. If I have a blank page with no codes save, no errors.

title: Floorplan
path: floorplan
icon: mdi:floor-plan
theme: midnight
panel: true
cards:
  - type: horizontal-stack
    cards:
2 Likes

Excellent find! It does seem that the floorplan is involved, so this can be reported to the floorplan project.

In my case, I can always return to the automatically generated page unless I visited the floorplan page.

So the floorplan page is likely changing data also used by the “automatic” page.

This image illustrates why the code is generating an exception, but not why “entities” contains ‘’.
The code fails here because it tries to find “sensor.16996282-911ec145” in the ‘entities’. And all entities except '
’ are indexed by their entity_id. So entities["sensor.16996282-911ec145"] is undefined while the code expects it return the entity details.

When the floorplan was not visited, this ‘’ key does not exist in ‘entities’ and the issue does not occur. So the floorplan is adding the '’ entry somewhere while it should add entities[“sensor.16996282-911ec145”] (entities seems to be from hass.entities).

EDIT: created issue [BUG] ha-floorplan breaks the automatic dashboard/view · Issue #335 · ExperienceLovelace/ha-floorplan · GitHub .