simple-thermostat icon indicating copy to clipboard operation
simple-thermostat copied to clipboard

Uncaught TypeError: Cannot read properties of undefined (reading 'attributes').com

Open garyak opened this issue 2 years ago • 2 comments

Describe the bug Error appears in HA log for 2021.12.6. No visible issues with the operation or rendering of the card.

2021-12-29 09:48:12 ERROR (MainThread) [frontend.js.latest.202112270] http://homeassistant.local:8123/hacsfiles/simple-thermostat/simple-thermostat.js?hacstag=158654878243:285:19980 Uncaught TypeError: Cannot read properties of undefined (reading 'attributes')

Card Config:

control:
  hvac:
    auto:
      icon: mdi:auto-fix
      name: Auto
    cool:
      icon: mdi:snowflake
      name: Cool
    heat:
      icon: mdi:fire
      name: Heat
    'off':
      icon: mdi:power
      name: 'Off'
    dry: false
  fan:
    auto:
      name: auto
    circulate:
      icon: mdi:restore
      name: circulate
    'on':
      icon: mdi:fan
      name: 'On'
decimals: '0'
fallback: 'Off'
icon: false
sensors:
  - attribute: current_humidity
    name: Humidity
    unit: ' %'
step_size: '1'
setpoints:
  temperature:
    hide: false
  target_temp_low:
    hide: true
  target_temp_high:
    hide: true
type: custom:simple-thermostat
layout:
  mode:
    names: false
    headings: false
    icons: true
entity: climate.south_zone_1
header:
  name: Kitchen

stsat

  • OS: Win10/iOS15+
  • Browser: All
  • Simple Thermostat version from browser console: 2.4.3
  • Home Assistant version: 2021.12.6

garyak avatar Dec 29 '21 17:12 garyak

+1

nelsonamen avatar Jan 01 '22 17:01 nelsonamen

This bug may come from the following line:

https://github.com/nervetattoo/simple-thermostat/blob/eb0c0d5902a4a1e51d4ae3849417ea3eef7b8886/src/config/header.ts#L71

entity is undefined

image

This means that the entity defined in your card configuration doesn't exist

bokub avatar Jan 08 '24 20:01 bokub