Display remaining seconds of timer in frontend

yes

1 Like

cool, thank you. you mention in your post to exclude the entity from the recorder, which I’ve done using the following code:

recorder:
  exclude:
    entities:
      - sensor.countdown

and restarted home assistant, but the current value as it’s actively counting down still shows up in the history tab. the docs say

If any entities are excluded from being recorded, no history will be available for these entities.

so why is this still showing up in the history? is there something else I need to do to disable it because it’s a template?

if it’s in your DB, it’ll be there till it’s purged. Seeing That you excluded it, don’t worry because the data is not going into the database. You can verify this by looking at the history in the UI, it shouldn’t change. After it’s removed from the DB, it’ll no longer show a history. Based on your configuration, that will happen in 10 days.

it’s actively changing in the history tab, still, even after restarting home assistant. it’s still being recorded even though it should be excluded.

1 Like

FWIW, I have timer as one of several excluded domains and none of my timers have a recorded history.

recorder:
  purge_keep_days: 5
  commit_interval: 10
  exclude:
    domains:
      - group
      - script
      - automation
      - counter
      - input_text
      - input_datetime
      - input_number
      - input_select
      - timer

image

thanks for the input, I added timer as excluded under domains and unfortunately, the history for the template is still changing :confused:

is there something else that could be causing it to still be recorded?

… restarted Home Assistant?

Checked the Log for any errors related to the recorder related configuration changes made to configuration.yaml?

yes, I restarted Home Assistant. No, there are no logs related to the recorder or configuration.yaml. The only log there is a crash related to components/upnp/device.py, which seems unrelated to the recorder.

Source: components/upnp/device.py:54
First occurred: 5:07:37 PM (1 occurrences)
Last logged: 5:07:37 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 880, in async_init
    flow, result = await task
                   ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 908, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 389, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/upnp/config_flow.py", line 176, in async_step_ssdp
    mac_address = await _async_mac_address_from_discovery(self.hass, discovery_info)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/upnp/config_flow.py", line 68, in _async_mac_address_from_discovery
    return await async_get_mac_address_from_host(hass, host)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/upnp/device.py", line 54, in async_get_mac_address_from_host
    ip_addr = ip_address(host)
              ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/ipaddress.py", line 54, in ip_address
    raise ValueError(f'{address!r} does not appear to be an IPv4 or IPv6 address')
ValueError: 'fe80' does not appear to be an IPv4 or IPv6 address

I updated to the latest version of the stable Docker image so my core is now at 2023.12.3 and my frontend is on 20231208.2, and it’s still updating the history even though the entity is excluded from the recorder.

anything else to check? or is it possible the recorder is bugged or the documentation is out of date re: how the recorder being excluded for an entity in its history page?

I’m currently still using 2023.11.2 and the configuration I posted above has been part of my system for dozens of previous versions. None of my timers display a state history even though one of them ran this morning.

Post a screenshot of the state history of one of your timers that show it had recorded a recent countdown.

oh okay I think I see the confusion. the timer entity itself is not being recorded. the template entity that is being updated every second is being recorded, despite the fact that it is explicitly excluded in my configuration.yaml, as I previously posted in a code snippet.

so, why is that being recorded? does it have something to do with it being a template entity?

Is there a good reason for why the entities card automatically shows the countdown of timers, but the entity card only shows ‘Active’