Cool! I just did similar about 2 weeks ago but used Node Red. I only setup a 5 minute version for now but will add 10, 15, and 20 minute versions in near future. They help giving kids time limits or warning until bedtime.
Thanks for contributing to the community with a new Blueprint.
I have a suggestion for you. Many people who are not familiar with directory structures will have problems installing this without the Home Assistant MY tools.
Adding a MY link for this Blueprint to your top post would help them a lot.
I tried to set this up and it doesn´t work, but I´m pretty sure it´s because I´m doing something wrong, could you please check what I need to change in my setup:
I just found the issue, as I was using WLED-ID instead of only the ID in the field dev_name.
Now that it´s working I have another question. It would be really cool to be able to dinamically set the duration from an automation, for example to say âhey google, set a timer for 7 minutesâ, is there any way to do this?
WLED Countdown Timer â Without MQTT, Using Live View Proxy
Hey everyone
Just dropping in to share an alternative way to run a countdown timer on WLED without needing MQTT or Node-RED.
Iâve been building a Home Assistant integration called WLED Live View Proxy, and it now supports sending full JSON commands to your WLED devices over WebSocket. Using this, I put together a flexible script that:
Reads the LED count dynamically from your WLED segment Displays a smooth green progress bar across the strip Last 10% of LEDs blink red at the end Automatically resets after the timer ends Works with any WLED setup and doesnât require MQTT
No MQTT, no polling, just JSON over WS using wled_liveviewproxy.send_command
Love to see that and it works quite straight forward. I do have a question to this: It looks like the LEDs running up with passing time. How can I revers this so that it is more like a countdown? Maybe more clear: starting with a strip fill of 100% going to 0%.
I actually made a little change (sorry, dont mean to hijack itâŚ)
Now, it counts without flashing, you get a few more inputs, and it will reset to default when finished.
alias: WLED Progress with Final Blink and Reset
mode: restart
fields:
duration:
name: Timer duration (seconds)
description: Total time in seconds for the progress effect
required: true
selector:
number:
min: 1
max: 600
unit_of_measurement: sec
default: 120
target_light:
name: WLED Light
description: Select your WLED light entity
required: true
selector:
entity:
domain: light
integration: wled_liveviewproxy
default: light.wlvp_tvvegg
progress_color:
name: Progress Color
description: Hex color for the progress effect (e.g., 00ff00 for green)
required: false
selector:
text:
default: "00ff00"
flash_color:
name: Flash Color
description: Hex color for the final blink effect (e.g., ff0000 for red)
required: false
selector:
text:
default: "ff0000"
brightness:
name: Brightness
description: Brightness level (0-255)
required: false
selector:
number:
min: 0
max: 255
default: 150
variables:
segment_id: 0
palette: 0
background_color: "000000" # Background/unfilled color
step_count: "{{ duration | int }}"
flash_count: 4 # Number of blinks for the final effect
flash_delay_ms: 300 # Delay for blink effect in milliseconds
percent_per_step: "{{ (100.0 / step_count) | float }}" # Percent increase per second
sequence:
# Request WLED state to get segment information
- alias: Request WLED state
action: wled_liveviewproxy.send_command
data:
targets:
entity_id: "{{ target_light }}"
command:
v: true
response_variable: wled_state
# Validate WLED state response
- alias: Validate WLED state
condition: template
value_template: "{{ wled_state is defined and wled_state.responses is defined }}"
# Prepare variables for progress and blink effects
- alias: Prepare variables
variables:
response_key: "{{ wled_state.responses.keys() | list | first }}"
segment: "{{ wled_state.responses[response_key].state.seg[segment_id] }}"
led_count: "{{ segment.stop - segment.start }}"
flash_leds_count: "{{ (led_count * 0.1) | round(0, 'ceil') }}"
flash_start_rel: "{{ led_count - flash_leds_count }}"
# Validate segment data
- alias: Validate segment
condition: template
value_template: "{{ segment is defined and led_count > 0 }}"
# Initialize: Set entire segment to background color and solid effect
- alias: Initialize segment to background
action: wled_liveviewproxy.send_command
response_variable: response
data:
targets:
entity_id: "{{ target_light }}"
command:
seg:
- id: "{{ segment_id }}"
fx: 0
bri: "{{ brightness }}"
i:
- 0
- "{{ led_count }}"
- "{{ background_color }}"
# Run progress effect incrementally
- alias: Run countdown timer
repeat:
count: "{{ step_count }}"
sequence:
- variables:
previous_percent: "{{ ((repeat.index - 1) * percent_per_step) | round(0, 'floor') }}"
current_percent: "{{ (repeat.index * percent_per_step) | round(0, 'floor') }}"
previous_leds_lit: "{{ (previous_percent / 100 * led_count) | round(0, 'floor') }}"
current_leds_lit: "{{ (current_percent / 100 * led_count) | round(0, 'floor') }}"
- alias: Update delta LEDs if changed
condition: template
value_template: "{{ current_leds_lit > previous_leds_lit }}"
- action: wled_liveviewproxy.send_command
response_variable: response
data:
targets:
entity_id: "{{ target_light }}"
command:
seg:
- id: "{{ segment_id }}"
i:
- "{{ previous_leds_lit }}"
- "{{ current_leds_lit }}"
- "{{ progress_color }}"
- delay:
seconds: 1
# Blink last 10% of LEDs
- alias: Blink last 10% LEDs
repeat:
count: "{{ flash_count }}"
sequence:
# Turn on flash color for last 10% of LEDs (keep first as progress color)
- alias: ON - Flash last 10% in specified color
action: wled_liveviewproxy.send_command
response_variable: response
data:
targets:
entity_id: "{{ target_light }}"
command:
seg:
- id: "{{ segment_id }}"
i:
- 0
- "{{ flash_start_rel }}"
- "{{ progress_color }}"
- "{{ flash_start_rel }}"
- "{{ led_count }}"
- "{{ flash_color }}"
- delay:
milliseconds: "{{ flash_delay_ms }}"
# Turn off flash color (set to background, keep first as progress)
- alias: OFF - Reset flash LEDs to background
action: wled_liveviewproxy.send_command
response_variable: response
data:
targets:
entity_id: "{{ target_light }}"
command:
seg:
- id: "{{ segment_id }}"
i:
- 0
- "{{ flash_start_rel }}"
- "{{ progress_color }}"
- "{{ flash_start_rel }}"
- "{{ led_count }}"
- "{{ background_color }}"
- delay:
milliseconds: "{{ flash_delay_ms }}"
# Reset to original state
- alias: Reset WLED segment
action: wled_liveviewproxy.send_command
response_variable: response
data:
targets:
entity_id: "{{ target_light }}"
command:
seg:
- id: "{{ segment_id }}"
frz: false
fx: "{{ segment.fx | default(0) }}"
pal: "{{ segment.pal | default(0) }}"
bri: "{{ segment.bri | default(255) }}"
description: Displays an incremental progress bar on a WLED light (without full redraw flicker), followed by a blinking effect on the last 10% of LEDs, and resets to the original state.
If I set a short timer e.g. 10 seconds, it is fine. But if I increase the duration of the timer the progress bar is âfasterâ. This results in a 10 minute timer that has finished after 8 mins.
I canât find the issue though. Is this a limitation of the integration since there are might some instabilities in the connection that sum up over time? My script is here: