Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106468

Running Timer Blueprint/Script

$
0
0

I’d like to run a countdown timer that controls a WLED strip. I’ve got the general outline working, but it’s using a constant delay and increment, which is ugly - I’d rather set a duration, update at a sensible rate and check what proportion of the duration has passed. Can anyone point at a good example of doing that?

Current code:

alias: Countdown Timer Test
sequence:
  - device_id: 657f7d66421ee47a1c4e1a438be101ab
    domain: select
    entity_id: c081f43ba5e9e7f9aec80fa985608a59
    type: select_option
    option: Countdown On
  - repeat:
      sequence:
        - action: number.set_value
          metadata: {}
          data:
            value: "{{repeat.index * 5}}"
          target:
            entity_id: number.study_strip_segment_1_intensity
        - delay:
            hours: 0
            minutes: 0
            seconds: 0.5
            milliseconds: 0
      count: 20
  - device_id: 657f7d66421ee47a1c4e1a438be101ab
    domain: select
    entity_id: c081f43ba5e9e7f9aec80fa985608a59
    type: select_option
    option: Count Complete
  - delay:
      hours: 0
      minutes: 0
      seconds: 3
      milliseconds: 0
  - device_id: 657f7d66421ee47a1c4e1a438be101ab
    domain: select
    entity_id: c081f43ba5e9e7f9aec80fa985608a59
    type: select_option
    option: Countdown Off
description: |+

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 106468

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>