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

Light action if else problem

$
0
0

@steveknoefler wrote:

Hi
is this configuration under action correct? it will not work but the test show no errors.
Only the light go on if its off. if its on nothing happens. :frowning:
Has anyone may a alternative config?

thanks

  - alias: Wohnzimmer_Licht_Tag
    initial_state: 'on'
    trigger:
      - platform: state
        entity_id: timer.wohnzimmer_licht_timer
        to: 'active'       
    condition:
      condition: and
      conditions:
        - condition: sun
          after: sunrise
          after_offset: "0:15:00"
        - condition: time
          before: '23:15:00'
    action:
      - service: light.turn_on 
        data_template:
          entity_id: light.wohnraum_und_essbereich
          brightness: >-
            {% if is_state('light.wohnraum_und_essbereich', 'on') %}
              254 
            {% else %}
              254
            {% endif %}
          kelvin: >-
            {% if is_state('light.wohnraum_und_essbereich', 'off') %}
              2700
            {% endif %}            
          transition: >-
            {% if is_state('light.wohnraum_und_essbereich', 'off') %}
              1
            {% else %}
              3
            {% endif %} 

Posts: 11

Participants: 4

Read full topic


Viewing all articles
Browse latest Browse all 95414

Trending Articles



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