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

Using 'input_number' for Light Transition in Automation Fails

$
0
0

@norsemanGrey wrote:

Hi, I am trying to make some light wake-up automation, but I am having an issue with the transition time for which I want to use an input. Hard-coding a value works fine, but when I try to use the following the automation does not work. I have seen the same being used elsewhere so not sure why it does not work for me. Any ideas?

transition: "{{ (states.input_number.wakeup_transition.state|int) }}"

I have also tried the following without success:

transition: "{{ states('input_number.wakeup_transition')|int }}"

Full code from automation.yaml:

- alias: "Wake-Up"
  trigger:
    platform: template
    value_template: "{{ states('sensor.time') == ((states.input_datetime.wakeup_time.attributes.timestamp - (states.input_number.wakeup_transition.state|int)) | int | timestamp_custom('%H:%M', False)) }}"
  condition:
    - condition: state
      entity_id: input_boolean.wakeup_enabled
      state: 'on'
    - condition: or
      conditions:
        - condition: state
          entity_id: input_boolean.wakeup_weekend
          state: 'on'
        - condition: time
          weekday:
            - mon
            - tue
            - wed
            - thu
            - fri
  action:
    - service: light.turn_on
      entity_id: light.bedroom_light
      data:
        transition: 30
        brightness: 255

Posts: 2

Participants: 2

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>