maxwroc / battery-state-card

Battery state card for Home Assistant
MIT License
866 stars 38 forks source link

reltime() seems broken, just adds literal "<rt>" tag #738

Open magicus opened 1 month ago

magicus commented 1 month ago

Describe the bug

I tried to copy the example in the docs, and added:

value_override: '"Changed: {last_changed|reltime()}"'

to my card. However, this does not result in relative times, but instead an output like:

"Changed: <rt>2024-08-26T21:53:45.731Z</rt>

How to reproduce Add the reltime() function in a template.

Expected behavior I expected a relative time, like 5 minutes ago.

YAML configuration

type: custom:battery-state-card
title: Battery levels
value_override: '"Changed: {last_changed|reltime()}"'
non_battery_entity: true
default_state_formatting: false
filter:
  include:
    - name: entity_id
      value: '*_last_seen'
unit: null
sort:
  - state

Entity debug data

Dev console errors

Screenshots

Version

I am using the latest version from HACS.

made-indrayana commented 5 days ago

Same here 👋🏼