Show all Active Alexa Timers

Hm, I’m having a different issue where the entity next_timer is just undefined. I think there’s an issue with Alexa Media Player causing my issue. That makes it difficult to troubleshoot yours, though. I know card-mod had some updates fairly recently, so I’d start there maybe?

1 Like

This has also stopped working for all of my Sonos speakers using Alexa, the timers have an unknown state. I think it began with one of the 2025.11 updates but I can’t be sure exactly when or why. I have a timer running right now on this speaker but nothing is shown:

There is a mod to the manifest to get the timers back, but looks like the format changed so the card no longer works. Going to see if I can make mods for it to work.

“requirements”: [“alexapy@git+https://gitlab.com/b366/alexapy.git@fix_api_notifications”, “packaging>=20.3”, “wrapt>=1.14.0”],

Here is some crappy markdown which shows timers and alarms. Figuring out the offset was a pain. The new alexapi does not return a name for each timer. Only the last timer. Hopefully this is enough to convert to the card

type: markdown
content: >-
  {% for state in states.sensor %}

  {% if state.entity_id.endswith('next_timer') %}

  {% if state.attributes.alarms_brief is defined %}   {% if
  state.attributes.alarms_brief.active is defined %}  {% set
  active=state.attributes.alarms_brief.active %}
    {% set
  name=state.attributes.friendly_name %} {% for item in active %}    {% set
  offset=(now() - state.attributes.process_timestamp|as_datetime) %} {% set
  offset_seconds =  offset.total_seconds() %}  {% set remainingSeconds =
  (item.remainingTime/1000) | int %} {% set total_seconds = remainingSeconds -
  offset_seconds %} {% set h = (total_seconds / 3600) | int %}  {% set m =
  ((total_seconds % 3600) / 60) | int %} {% set s = int(total_seconds % 60) %}
  Timer on {{name.split(' ')[0]}}: {{'{:02d}:{:02d}:{:02d}'.format(h, m, s) }}

  {% endfor %}{% endif %}{% endif %}{% endif %}{% endfor %} {% for state in
  states.sensor %} {% if state.entity_id.endswith('next_alarm') %} {% if
  state.attributes.alarms_brief is defined %} {% if
  state.attributes.alarms_brief.active is defined %} {% set
  active=state.attributes.alarms_brief.active %}
      {% set
  name=state.attributes.friendly_name %}
  {% for item in active %}  Alarm on : {{name.split(' ')[0]}}
  {{(item.date_time | as_datetime).strftime('%a, %b %d, %-I:%M %p')}} {% endfor
  %}{% endif %}{% endif %}{% endif %}{% endfor %}

1 Like

With the new Alexa Media Player update (5.8.3), alarms and timers are back, but this card seems unable to read the timer values. Is there anything I can do to get that feature back?

@firstcolle I’m having trouble seeing the alarms and timers on my Home Assistant, even with AMP 5.8.3. Where are you seeing information about them? They still show as “unknown” for me.

I only see them once they’re set, otherwise they’re unkown

The sensors show a value in developer tools, but they don’t appear on my dashboard card. Is there something wrong with my yaml code? I have tried it with ‘hide_card_on_empty’ set to false, but it made no difference. The card appears, but not the actual timers.

type: custom:card-alexa-alarms-timers
entities_alarm:
  - sensor.kitchen_next_alarm
  - sensor.living_room_next_alarm
 entities_timer:
  - sensor.kitchen_next_timer
  - sensor.living_room_next_timer
 entities_reminder:
  - sensor.kitchen_next_reminder
  - sensor.living_room_next_reminder
remaining_time_bold: true
show_cancel_button: true
cancel_entity: media_player.computer_room
hide_card_on_empty: true
card_title: Alarms, Timers and Reminders
show_device_name: true
show_empty_hours: false
show_alarm_name_seconds: true

I am now aware that the problem is with the card needing to be updated. I have a workaround in place.

In the past I was used to take to set timer duration e.g. via

{{ ((state_attr('sensor.echo_show_5_next_timer', 'sorted_active') | from_json)[0][1].originalDurationInMillis)/1000/60 }}

Any one found a way to get this originalDuration back via which way ever?

Also curious if there’s a workaround/update that can be done to get timers to show on the card again.

Okay, I have made an update to the code that will allow reminders, alarms, and timers to show. It’s not great, because Alexa Media Player changed the way that it delivered the information. I no longer have access to the original duration of timers, which I used to update the countdown. Now, timers are updated whenever AMP feels like giving it new information, which looks bad but is somewhat functional. Alarms are as before. Reminders and Timers only show the name of the most recent one (if it has a name) so all the rest are displayed wrong. Maybe AMP can update to give this information once more, I don’t know.

2 Likes

Fantastic… its great to see the timers on my dashboard again. Thank you for your work on this project… its much appreciated.

Thank you - its great to have the timers back and showing on my dashboard again! One thing I’ve noticed after updating is a large number of occurrences of an error in my logs:

Logger: frontend.js.modern.202512033
Source: components/system_log/__init__.py:331
First occurred: 18:47:26 (135638 occurrences)
Last logged: 23:26:26

Uncaught error from Edge 143.0.0.0 on Windows 10 SyntaxError: Unexpected end of JSON input CardAlexaAlarmsTimers.draw (/hacsfiles/card-alexa-alarms-timers/card-alexa-alarms-timers.js:59:52)
Uncaught error from Chrome WebView 143.0.7499.146 on Android 16 SyntaxError: Unexpected end of JSON input CardAlexaAlarmsTimers.draw (/hacsfiles/card-alexa-alarms-timers/card-alexa-alarms-timers.js:59:52)

is anyone else getting similar? No changes to my card or dash configuration. Running latest versions of AMP and this card which were just released.

I had not noticed the error but this morning a new update to the alexa integration has messed with the timers attributes again so they were not showing up on my dashboard again …

Update: To fix the issue I backed out the alexa media player update … When I went back in the logs to the gap between the update and me backing it out I see the error you mention so it looks like the updated media player is now causing the card code to fail.

I would suggest backing out the media player update and using 5.8.4 until @kethlak has some time to look at the card again

If you have the latest version of kethlak’s card (1.3.2) and Alexa Media Player integration (5.9.0) , everything should work. The 5.9.0 broke my markdown fix, but the card works again.

Looks like the latest Alexa update fixed your card. My custom json calls don’t work any longer, but now that your card is working I can Ditch all that work I did on Alexa timers.

Now if only we could get your card working for voice assistant satellite devices… why this is missing from their implementation is beyond me. Named timers is like the #1 use case for voice assistants other than playing music

Do you find a solution?

originalDuration should be back now, that is provided by the Alexa Media Player plugin and the folks there worked with me to get their reporting back the way it used to be.

In last update it came back to the attributes. Structure somehow changed, but here I use

{{ state_attr('sensor.echo_show_5_next_timer', 'sorted_active')[0].originalDurationInMillis }}

now

1 Like