Display timer on Stream Deck

This is probably an extremely niche question.

I use Stream Deck (connected to Windows PC) to control HA devices. I set a button to switch on a socket and then switch off after 30 minutes. This works.

My problem is that I’d like a timer to show (on the Stream Deck button) how much time remains until switch-off.

I’ve tested with the timer helper, and, so far, the only things I can display is the state (Idle or Active) and timer duration, which won’t move, but stay fixed to the time originally set in the duration field.

I’ve done some research, and… is my understanding correct that HA doesn’t have the capability to return (send) live timings?

In other words, is there a way to make this happen?
Thanks

We need to know what you have tried and how.
Show us the templates you have tried or the code or whatever.

Oh, I didn’t code anything. Unfortunately, I’m not a coder. I just configured the available resources.

The only thing I did “code” is that I specified the “state” parameter in Stream Deck so it could read the state of the timer helper. As far as I know, there is no way to make it read the “remaining” time, since it won’t be updated by HA until it finishes.

Hi, welcome to the forum!

Maybe, as a newcomer, it’s not bad to look at these search results: Search results for 'stream deck' - Home Assistant Community

Thank you for welcoming me :slight_smile:

Unfortunately, these results don’t help. I have Stream Deck doing a lot of things with Home Assistant by using the HA plugin in SD. The issue is mainly the timer thing.

I’ve been looking for a solution since Friday, but since I couldn’t fine one, I tough maybe someone here could help.

Thanks for trying :slight_smile:

1 Like

Create a template sensor with this:

{% if states('timer.YOUR_TIMER_NAME') != "idle" %}
{{ (as_timestamp(state_attr('timer.YOUR_TIMER_NAME', 'finishes_at')) - now().timestamp()) | timestamp_custom('%M:%S') }}
{% endif %}

This should create a sensor with the name you specified, and the state should be the time left.
This will only update once per minute, if you want more frequent updates then we need to make a triggered sensor.

1 Like

Thank you. I’ll try this out.

Just tested this. Worked perfectly. Thank you so much!!!