Alexa Timer Card

Hi there,

I use several Dots in my flat - if I understand your code correct, i have to create for each alexa this code?
Eg. Wohnzimmer, Küche, Bad etc?
Or is there a way to include all Alexa dots in one code?

Correct you need to create a sensor for each Echo Dot.

1 Like

okay thanks…
can you tell me, where I can find the correct names of the echos to add them to the script?

you can find in the list of the entities under Alexa Integration.

1 Like

sorry, but I cannot find the alexa integration? If I go into settings and home assistant clound -> alexa entities I find some devices but no alexa dots?

Are you sure that Alexa integration is working? Have you done all the step that are in the instructions?

1 Like

I use the nabu casa cloud and activated Alexa.
Also I installed the home assistant skill in Alexa and can use each Echo to controll the home assistant devices.
So I think the integration was successfull…

But I am not sure, where I can find the entities of the Alexas…
If I go to config -> entities there are no alexas listed…

Regards
Timo

hi there,

I tried different ways, but I dont get it…
Is it possible, that you explain me step by step?
:sweat_smile:

I think this is what you need:

1 Like

got it, thank you!
(Hopefully) last question:
Is it possible, that the card is hide, if no timer is set?

So if there is no timer, on my lovelace is empty, and if I set a timer the timer card will shown?

Anyone know how to parse all timers from an alexa? I can easily get next_timer from the state, but not all of them.

The below template gets a value from ‘sorted_active’, but I do not know how to loop over all indexes of sorted_active to be able to increment the “changeme” index.

{{ ((state_attr('sensor.livingroom_show_next_timer', 'sorted_active') |
  from_json)[changeme][1].remainingTime)}}

edit: This seems to work, need play with it, but it loops through and gets the alarm times

{% set active=states.sensor.livingroom_show_next_alarm.attributes.sorted_active| from_json %}{% for item in active %}{{item[1].originalTime + ' '}}{% endfor %}

Sorry to spam updates: This markdown will get all timers and alarms. Need to work on formatting, but should help in the kitchen.

{% for state in states.sensor %}

{% if state.entity_id.endswith('next_alarm') %}
{% if state.attributes.sorted_active is defined %}
{% set active=state.attributes.sorted_active| from_json %}
{% for item in active %} **{{item[1].originalTime.split(".")[0]}}** Alarm on  {{state.entity_id.split("_")[0][7:]}}
{% endfor %}

{% endif %}
{% endif %}
{% endfor %}

{% for state in states.sensor %}
{% if state.entity_id.endswith('timer') %}
{% if state.attributes.sorted_active is defined %}
{% set active=state.attributes.sorted_active| from_json %}
{% for item in active %} 
**{{(item[1].remainingTime / 60000 - ( as_timestamp(now()) - as_timestamp(state.last_changed))/60)| round(1)}} min** -  {{item[1].timerLabel}} timer on {{state.entity_id.split("_")[0][7:]}}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}


``
1 Like

Awesome idea! :star_struck: Works great! But one another question: is there a way to automatically create a single sensor for each timer?

I don’t know how. Not sure how to create an entity on the fly. Alexa timer will work with the card below, but it doesn’t pull the name of timer it, but you can make one for each alexa device. I really stopped using this, because my alexa integration craps out after a few minutes and needs to be manually reloaded.

rianadon/timer-bar-card: A progress bar display for Home Assistant timers (github.com)

Thank you! I will check it out!

Hi i’m really new to this. I’ve been following your steps but falling at the first hurdle. I’m pasting your code
into the config.yaml entry on Studio Code Server. on the last line i get an error saying Incorrect type. Expected “Array”

You need to add the platform configuration info, as is shown in Post #8. Also, make sure to put the entity_id of your sensor, not the original value (unless your echo just happens to be called ‘echo_wohnzimmer’ too)

Did you ever get multiple timers to display? I’d like to do the same thing. We often have 3 timers going at any one time.

No, I never figured it out.

This gal figured it out!

Actually, I misunderstood what you were looking for. The markdown I posted finds all timers and alarms, even multiple set on a single alexa. I just tried Kethlak’s card. It has much nicer formatting, but does not seem to support alarms (only timers).

I got confused because a while back I tried to use rianadon/timer-bar-card but that would only use the first timer set for each alexa.