Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception: e.formatEntityState is not a function #688

Closed
rathinho opened this issue Feb 12, 2024 · 2 comments
Closed

Exception: e.formatEntityState is not a function #688

rathinho opened this issue Feb 12, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@rathinho
Copy link

rathinho commented Feb 12, 2024

Describe the bug

BATTERY-STATE-ENTITY
Exception: e.formatEntityState is not a function

Please check if the problem was reported already
Click [here](https://github.com/maxwroc/battery-state-card/issues?q=is%3Aissue+is%3Aopen+Exception%3A%20e.formatEntityState%20is%20not%20a%20function) to search
If it wasn't please consider creating one
Click [here](https://github.com/maxwroc/battery-state-card/issues/new?assignees=&labels=bug&projects=&template=bug_report.md&title=Exception%3A%20e.formatEntityState%20is%20not%20a%20function) to create
Please copy-paste the below stack trace.
TypeError: e.formatEntityState is not a function
    at http://192.168.1.185:8123/hacsfiles/battery-state-card/battery-state-card.js?hacstag=256292682320:35:11444
    at qt.<anonymous> (http://192.168.1.185:8123/hacsfiles/battery-state-card/battery-state-card.js?hacstag=256292682320:35:11567)
    at Generator.next (<anonymous>)
    at http://192.168.1.185:8123/hacsfiles/battery-state-card/battery-state-card.js?hacstag=256292682320:1:633
    at new Promise (<anonymous>)
    at e (http://192.168.1.185:8123/hacsfiles/battery-state-card/battery-state-card.js?hacstag=256292682320:1:378)
    at qt.internalUpdate (http://192.168.1.185:8123/hacsfiles/battery-state-card/battery-state-card.js?hacstag=256292682320:35:9852)
    at qt.<anonymous> (http://192.168.1.185:8123/hacsfiles/battery-state-card/battery-state-card.js?hacstag=256292682320:35:2146)
    at Generator.next (<anonymous>)
    at http://192.168.1.185:8123/hacsfiles/battery-state-card/battery-state-card.js?hacstag=256292682320:1:633

YAML configuration

type: custom:battery-state-card
title: ''
sort_by_level: asc
collapse: 10
color_gradient:
  - '#ff0000'
  - '#ffff00'
  - '#00ff00'
entities:
  - entity: sensor.iphone_13_battery_level
    name: my iPhone 13
    tap_action:
      action: more-info
    charging_state:
      entity_id: sensor.iphone_13_battery_state
      state: Charging
  - entity: sensor.loock_v8_f8d0_battery_level
    name: lock
    tap_action:
      action: more-info
  - entity: sensor.loock_v02_e29f_battery_level
    tap_action:
      action: more-info
  - entity: sensor.apc_bk650m2_ch_battery_charge
    name: APC UPS
    tap_action:
      action: more-info
  - entity: sensor.miaomiaoce_t2_5b3b_battery_level
    name: living room hygrothermograph
    tap_action:
      action: more-info
  - entity: sensor.miaomiaoce_t2_9707_battery_level
    name: washroom hygrothermograph
    tap_action:
      action: more-info

Entity debug data

Dev console errors

Screenshots

Version
v3.2.0

@rathinho rathinho added the bug Something isn't working label Feb 12, 2024
@maxwroc
Copy link
Owner

maxwroc commented Feb 12, 2024

You must be on old HA instance.

You have two options to solve your problem:

  1. Upgrade your HA
  2. Use default_state_formatting: false in your card config

More info here: #623

@maxwroc maxwroc closed this as completed Feb 12, 2024
@rathinho
Copy link
Author

You must be on old HA instance.

You have two options to solve your problem:

  1. Upgrade your HA
  2. Use default_state_formatting: false in your card config

More info here: #623

thanks, my Home Assistant version is 2023.7.3. By adding default_state_formatting: false in card config, it works properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants