-
Notifications
You must be signed in to change notification settings - Fork 15
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
[question] Multiple timers from Alexa? #49
Comments
Hello! I'm not familiar with how the echo timers are created, but might something like the auto-entities card work for selecting all the timers? See #19 (comment) for an example of using the timer bar card with auto-entities. |
I don't think so - The next_timer sensor contains the data in a "sorted_active" list
|
I'm also trying to figure this out. Its easy enough to get a list of each timer from the sorted active data
Now using the timer card, I can get it to render the next timer, but not all active ones. My other question is how to pull the timerLabel and use that is the name.
|
This is the first use case I've seen for making the name configurable. You could create a template entity through Home Assistant that has the name set to the type: custom:config-template-card
variables:
TIMER: "JSON.parse(states['sensor.kitchen_echo_next_timer'].attributes.sorted_active)[0]"
entities:
- sensor.kitchen_echo_next_timer
card:
type: custom:timer-bar-card
entities:
- sensor.kitchen_echo_next_timer
name: "${TIMER[1].timerLabel}"
bar_foreground: '#eee'
bar_direction: rtl
bar_background: 'var(--mdc-theme-primary, #6200ee)'
start_time:
attribute: process_timestamp
end_time:
attribute: prior_value
bar_width: 35%
layout: full_row # hides the name and icon, but not time remaining
#text_width: 0px # hide the time remaining
guess_mode: true
filter: false
debug: true You might even be able to use the template card to render all the timers. Here's my attempt at setting that up. I haven't tested it, so it may need some debugging to make it work. type: custom:config-template-card
variables:
cards: |
() => {
const timers = JSON.parse(states['sensor.kitchen_echo_next_timer'].attributes.sorted_active)
return timers.map(timer => {
return {
"type": "custom:timer-bar-card"
"entities": ["sensor.kitchen_echo_next_timer"],
"name": timer[1].timerLabel,
"bar_foreground": "#eee",
"bar_direction": "rtl",
"bar_background": "var(--mdc-theme-primary, #6200ee)",
"duration": {
"fixed": timer[1].originalDurationInMillis/1000,
"units": "seconds",
},
"remain_time": {
"fixed": timer[1].remainingTime/1000,
"units": "seconds"
},
"bar_width": "35%",
"layout": "full_row",
"guess_mode": true,
"filter": false,
"debug": true
}
})
}
entities:
- sensor.kitchen_echo_next_timer
card:
type: entities
entities: "${cards()}" |
Right I forgot the name property assigns the title of the card. Instead follow these directions to rename the timer so the I'll have to look into the second block of code I wrote some more. There might be an error in the browser console, or I could be wrong that it's possible to pass an entire config in this template card. You could try editing the |
Almost there! Nice work fixing some of the issues through the browser console. I would have expected the bar to show with this configuration. If you send the output with "end_time": {
"fixed": timer[1].triggerTime
} That will be a little more accurate than using the remaining time. |
With the debug, mode is idle
I made the change to end time. There is still no bar when extracting multiple timers from a single entity. With debug turned on, it appears that time remaining, and counter are NaN, and the mode is Idle
My attempts to change the mode have not worked. I appreciate you working and talking me through this. |
Taking a look through the code, there's a subtle bug with using As for the "end_time": {
"fixed": new Date(timer[1].triggerTime).toISOString()
} |
Hi!
Firstly - Thank you for this card - It's excellent! I've added my Echo show as a timer, and it displays the last timer I've set perfectly.
My question is what's the recommended way of showing all timers set on a specified Echo device? I have a show in the kitchen and set multiple timers when cooking - It would be great to show all of them automatically.
Thanks in advance,
Neil
The text was updated successfully, but these errors were encountered: