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

Help with showing remaining time in UI

$
0
0

@Jamie_Pryer wrote:

Hey all,
Home Assistant 0.103.5

Im playing around with motion and timers, so that lights come on and go off.
The slider seems to work well, however i want to show in teh UI, how long until the timer is “finished” - eg. you have 1 minute until times is out and the lights go off.

i cant work out how to use the timer, to populate the value from the slider when its triggered dynamically based on when the automation is triggered?

config: 

timer:
  timer_motion_kitchen:
    duration: '00:15:00'  ##<---???????? what should this be, as i want it to be dynamic, based on the slider value used in the automation

input_number:
  timer_kitchen_motion_slider:
    name: Timer Kitchen Motion Timer
    initial: 5
    min: 5
    max: 120
    step: 5

############### kitchen ###############
- id: kitchenlightsonmotion
  alias: kitchen lights on motion
  trigger:
  - entity_id: binary_sensor.motion_sensor_kitchen_motion
    from: 'off'
    platform: state
    to: 'on'
  condition: 
    condition: state
    entity_id: sun.sun
    state: below_horizon
  action:
  service: timer.start
    data:
      entity_id: timer_motion_kitchen
  service: light.turn_on
    data:
      entity_id:
        - light.kitchen_deconz

- id: kitchenlightsoffafter30minnomotion
  alias: kithcen lights off no motion slider
  trigger:
    platform: state
    entity_id: binary_sensor.motion_sensor_kitchen_motion
    to: 'off' 
    for:
      minutes: "{{ states('input_number.timer_kitchen_motion_slider')|int }}"
  action:
  - service: light.turn_off
    data:
      entity_id:
        - light.kitchen_deconz

Posts: 3

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



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