Light brightness decrease after off, need help

Hello!

I am new here. I made one automation, it work perfectly: If no motion detect, it decrease the brightness to 35%, and after 20 sec turn off light.

alias: '1'
description: ''
trigger:
  - type: no_motion
    platform: device
    device_id: 4b5b000ccef06839d7c38eed22dacb87
    entity_id: binary_sensor.mozgaserzekel_foldszint_elszoba_occupancy
    domain: binary_sensor
condition:
  - condition: state
    entity_id: light.yeelight_ceiling1_0x5e7889a
    state: 'on'
action:
  - type: turn_on
    device_id: e6a2bcc6e060ffae74aba27a716ed653
    entity_id: light.yeelight_ceiling1_0x5e7889a
    domain: light
    brightness_pct: 35
  - wait_template: ''
    timeout: '20'
    continue_on_timeout: true
  - choose:
      - conditions:
          - type: is_motion
            condition: device
            device_id: 4b5b000ccef06839d7c38eed22dacb87
            entity_id: binary_sensor.mozgaserzekel_foldszint_elszoba_occupancy
            domain: binary_sensor
        sequence:
          - type: turn_on
            device_id: e6a2bcc6e060ffae74aba27a716ed653
            entity_id: light.yeelight_ceiling1_0x5e7889a
            domain: light
            brightness_pct: 100
    default:
      - type: turn_off
        device_id: e6a2bcc6e060ffae74aba27a716ed653
        entity_id: light.yeelight_ceiling1_0x5e7889a
        domain: light
mode: single

If the brightness is 35% and it detect motion, the brightness immediately changed to 100%

I tired to combine it with “turn ON light” if it detect motion:

alias: '2'
description: ''
trigger:
  - platform: state
    entity_id: binary_sensor.mozgaserzekel_foldszint_elszoba_occupancy
condition: []
action:
  - choose:
      - conditions:
          - type: is_motion
            condition: device
            device_id: 4b5b000ccef06839d7c38eed22dacb87
            entity_id: binary_sensor.mozgaserzekel_foldszint_elszoba_occupancy
            domain: binary_sensor
          - type: is_power
            condition: device
            device_id: f8e08ace815fab5eeb9fdca12a332d5e
            entity_id: sensor.house_solar_power_consumption_2
            domain: sensor
            below: 140
        sequence:
          - type: turn_on
            device_id: e6a2bcc6e060ffae74aba27a716ed653
            entity_id: light.yeelight_ceiling1_0x5e7889a
            domain: light
            brightness_pct: 100
      - conditions:
          - type: is_no_motion
            condition: device
            device_id: 4b5b000ccef06839d7c38eed22dacb87
            entity_id: binary_sensor.mozgaserzekel_foldszint_elszoba_occupancy
            domain: binary_sensor
          - condition: device
            type: is_on
            device_id: e6a2bcc6e060ffae74aba27a716ed653
            entity_id: light.yeelight_ceiling1_0x5e7889a
            domain: light
        sequence:
          - type: turn_on
            device_id: e6a2bcc6e060ffae74aba27a716ed653
            entity_id: light.yeelight_ceiling1_0x5e7889a
            domain: light
            brightness_pct: 35
          - wait_template: ''
            timeout: '20'
            continue_on_timeout: true
          - choose:
              - conditions:
                  - type: is_motion
                    condition: device
                    device_id: 4b5b000ccef06839d7c38eed22dacb87
                    entity_id: binary_sensor.mozgaserzekel_foldszint_elszoba_occupancy
                    domain: binary_sensor
                sequence:
                  - type: turn_on
                    device_id: e6a2bcc6e060ffae74aba27a716ed653
                    entity_id: light.yeelight_ceiling1_0x5e7889a
                    domain: light
                    brightness_pct: 100
            default:
              - type: turn_off
                device_id: e6a2bcc6e060ffae74aba27a716ed653
                entity_id: light.yeelight_ceiling1_0x5e7889a
                domain: light
    default: []
mode: single

It works: turn on light, is solar producton below 140w
if no motion then brightness goes 35%, after 20 secs turn off

need help: if brightness is 35% and it detect motion, nothing happend, it stay 35%. After 20 secs the brightnrss goes 100%. it seems, the wait_template does not appear to be interrupted, it waits for 20 secs. What is wrong?

Thx

https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly

What is wrong? This is my first port here. Wrong category? Or? Pls help me a little :slight_smile:

Point 11.

Oh, thanks :slight_smile:

I fixed it, now is good?

1 Like