logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

BK7231T - WB3S UME Outdoor Security Floodlight: Motion-Activated LED, PIR Sensor, CW Lights

mbetter 4746 43
Best answers

How can I make this BK7231T floodlight turn both white LED channels on from the PIR sensor with a delay, and how can I control the PIR sensitivity autonomously?

Use a motion-triggered script or automation that turns on both LED channels together, then delays and turns them off, instead of binding the PIR to only one channel [#20768158] A working pattern shared for the same style of WB3S floodlight uses a PIR input on P6, a cwww light on P8/P9, and scripts such as `waitThenDIM` / `waitThenOff` to keep the light on for a configurable time before dimming or shutting off [#20803268] The Tuya dump shows the PIR-related settings separately: `pirin_pin` is the motion output, while `pirsense_pin: 26` is the sensitivity control pin [#20790634][#20790668] That sensitivity pin appears to be PWM-controlled; the original app exposes it as Near/Medium/Far, which corresponded to about 100% / 50% / 0% duty cycle in testing [#20862391][#20862428] So, in practice, set the two LED PWM channels together in a script, use a delayed off timer, and drive `pirsense_pin` with PWM to match the Tuya sensitivity setting [#20768158][#20803268][#20862428]
ADVERTISEMENT
  • Helpful post
    #1 20764976
    mbetter
    Level 5  
    Posts: 24
    Help: 2
    Rate: 4
    This is a motion-activated outdoor LED floodlight.

    LED floodlight with two light panels and a motion sensor.

    It features a W3BS module, two CW LED lights, a PIR motion sensor, and an ambient light sensor.

    Close-up view of W3BS electronic module with wires soldered to pins. Close-up of an internal module with wires inside an LED floodlight.

    I was able to solder wires to the RX1 and TX1 pins on the module (as in the photo). The four wires in the lower right (VCE, GND, W, C) lead to a JST connector on the other board. I unplugged this and connected VCE and GND (9V worked, this goes to the AMS1117 regulator). The GND pin of the USB serial adapter was connected to the common ground with the power supply, and the 3.3V pin on the USB adapter was not used.

    I didn't succeed in flashing with the GUI flasher (got stuck immediately on reading 0x00), but was able to flash using "uartprogram" from hid_download.

    The SoC pins are connected as follows:
    P6Motion sensor
    P8LED (cool)
    P9LED (warm)
    P23/ADC3Ambient light sensor


    The motion sensor goes HIGH when motion is detected. The ambient light sensor readings range from 0 (brightest) to 3000 (darkest).

    My configuration is as follows:
    
    {
      "vendor": "UME",
      "bDetailed": "0",
      "name": "Tuya Smart LED Outdoor Security Floodlight",
      "model": "N/A",
      "chip": "BK7231T",
      "board": "TODO",
      "flags": "1024",
      "keywords": [
        "TODO",
        "TODO",
        "TODO"
      ],
      "pins": {
        "6": "dInput_NoPullUp;3",
        "8": "Rel;1",
        "9": "Rel;2",
        "23": "ADC;5"
      },
      "command": "",
      "image": "https://obrazki.elektroda.pl/2082550400_1696896808.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/topic4007225.html"
    }
    

    This allows me to control the brightness and color temperature with the two PWM channels (CW mode).

    User interface for remote control of LED floodlight with motion sensor.

    A few outstanding questions:
    * How to tie the two CW LED channels to the motion sensor. If I assign the motion sensor to one of the LED channels, then the sensor only controls that LED and not the other, giving the wrong color temperature.
    * How to add a time delay so that the light stays on for some time after motion is detected.
    * The original firmware offers the possibility of adjusting the sensitivity of the motion sensor (four levels). I haven't figured out how this works.

    I can program this control logic in my openHAB installation, but would rather have the device handle it autonomously.
  • ADVERTISEMENT
  • #2 20768158
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12661
    mbetter wrote:

    * How to tie the two CW LED channels to the motion sensor. If I assign the motion sensor to one of the LED channels, then the sensor only controls that LED and not the other, giving the wrong color temperature.

    Add a change handler to the target channel of the ADC, when value is higher than a chosen constant (it will also act as a sensitivity), then run a command, let's say, led_enableAll 1

    mbetter wrote:

    * How to add a time delay so that the light stays on for some time after motion is detected.

    along with the led_enableAll 1 command, you can create a repeating event with single repeat and delay time of your choice, let's say, 30 seconds, and in that event, do led_enableAll 0

    This may not be a perfect solution, because you the delay will start when there is a change (and not as long as the value is over threshold), but if you need more advanced system, I can easily write a driver for you.

    Also see:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md
    Helpful post? Buy me a coffee.
  • #3 20776478
    piotrszulc1
    Level 10  
    Posts: 37
    Help: 3
    Rate: 8

    Hi, I believe the hardware setup you described is similar (if not identical) to the one used in LSC outdoor lamp. It also uses WB3S and the pins seem to match.
    I have recently created a script that does what you need, please see this GitHub issue.
  • #4 20788588
    mbetter
    Level 5  
    Posts: 24
    Help: 2
    Rate: 4

    p.kaczmarek2 wrote:
    Add a change handler to the target channel of the ADC, when value is higher than a chosen constant (it will also act as a sensitivity), then run a command, let's say, led_enableAll 1


    Thanks, I was able to get it working with a script along these lines. However, the ADC is an ambient light sensor, not a proximity sensor. I still don't know how to adjust the sensitivity for the proximity sensor, as that seems to give a 0/1 value.

    Added after 34 [seconds]:

    piotrszulc1 wrote:
    Hi, I believe the hardware setup you described is similar (if not identical) to the one used in LSC outdoor lamp. It also uses WB3S and the pins seem to match. I have recently created a script that does what you need, please see this GitHub issue.


    Thanks for that, I was able to get it working with a script based on yours.
  • #5 20788839
    piotrszulc1
    Level 10  
    Posts: 37
    Help: 3
    Rate: 8

    As for the PIR sensor, I have the same problem - there seems to be no way to control its sensitivity. However, the original Tuya firmware had this option, so it must be possible. I suspect the PIR sensor is connected to one of the I2C buses. Have you tried scanning I2C for devices? There's a description on how to do it here: https://www.elektroda.com/rtvforum/topic4000858.html#20739000.
    Even if you do find a device there, there's still a matter of:
    1) guessing which PIR sensor type exactly this is
    and
    2) determining if any existing driver supports it.

    For 1), it might be helpful to open the lamp physically, trace the I2C connections, and read the markings on the sensor. Still, this is something I don't want to do yet.
    For 2), you can ask the openbk author. If not, try switching to ESPHome, where you can define your own sensor (https://esphome.io/components/sensor/custom.html), which can use an external library (from https://registry.platformio.org/).
  • #6 20789157
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12661
    I will be happy to write a driver for you. Please check the connection of the PIR sensor and try to determine which part number is it, so we can find a datasheet
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #7 20790017
    mbetter
    Level 5  
    Posts: 24
    Help: 2
    Rate: 4

    The lamp is already installed and I'm not able to open it up again, unfortunately.

    To scan for I2C, I would have to guess the SDA and SCK pins, right? That sounds very time-consuming. Maybe it could be scripted?
  • ADVERTISEMENT
  • #8 20790096
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12661
    Maybe they are stored in Tuya config, give it a try:
    https://www.youtube.com/watch?v=WunlqIMAdgw
    Helpful post? Buy me a coffee.
  • #9 20790634
    mbetter
    Level 5  
    Posts: 24
    Help: 2
    Rate: 4

    Ok, that worked, got this config:
    
    {
    	"Jsonver":"Jsonver_1594302982573",
    	"brightmin":"10",
    	"title20":"0",
    	"dimval":"0",
    	"dusk":"157",
    	"cdsval":"4",
    	"pirsense_lv":"1",
    	"wfcfg":"spcl",
    	"colormin":"10",
    	"lockt":"6",
    	"preheatt":"20",
    	"pmemory":"1",
    	"pairt":"6",
    	"cmod":"cw",
    	"evenfall":"1800",
    	"cwtype":"0",
    	"day":"0",
    	"pirin_lv":"1",
    	"rstbr":"50",
    	"colormax":"100",
    	"c_pin":"8",
    	"pirhduty":"2",
    	"notdisturb":"0",
    	"night":"2180",
    	"module":"module_1594302982573",
    	"pirrange":"1",
    	"cwmaxp":"100",
    	"dmod":"0",
    	"brightmax":"100",
    	"trigmod":"1",
    	"wfct":"3",
    	"pwmhz":"600",
    	"pirsense_pin":"26",
    	"defbright":"100",
    	"rstnum":"3",
    	"rstcor":"c",
    	"dimt":"1",
    	"deftemp":"100",
    	"c_lv":"1",
    	"pirfreq":"1000",
    	"trigdelay":"15",
    	"pirmod":"0",
    	"pirlduty":"9",
    	"wt":"20",
    	"prodagain":"0",
    	"remdmode":"1",
    	"pirmduty":"6",
    	"cagt":"20",
    	"w_lv":"1",
    	"dimmod":"1",
    	"colorpfun":"0",
    	"pirin_pin":"6",
    	"rgbt":"0",
    	"colormaxp":"100",
    	"onoffmode":"0",
    	"w_pin":"9",
    	"pirwarn":"0",
    	"rsttemp":"100",
    	"evening":"2100",
    	"category":"0502",
    	"defcolor":"c",
    	"crc":"44",
    	"cdv":"1.0.0",
    	"dev_swv":"1.1.7",
    	"s_id":"null",
    	"dtp":"0",
    	"sync":"0",
    	"attr_num":"0",
    	"mst_tp_0":"0",
    	"mst_ver_0":"null",
    	"mst_tp_1":"0",
    	"mst_ver_1":"null",
    	"mst_tp_2":"0",
    	"mst_ver_2":"null",
    	"mst_tp_3":"0",
    	"mst_ver_3":"null",
    	"dminfo_name":"null",
    	"dminfo_code":"null",
    	"dminfo_report_code":"null",
    	"dminfo_sn":"null "
    }
    


    Description:
    
    Device configuration, as extracted from Tuya: 
    - LED Cool (Channel 4) on P8
    - LED Warm (Channel 5) on P9
    Device seems to be using module_1594302982573 module.
    And the Tuya section starts at UNCOMMON POSITION 0
    


    Added after 4 [minutes]:

    hmm "pirsense_pin":"26", that looks interesting. I'm configuring it as ADC, hoping that it's the raw PIR sensor reading.
  • #10 20790668
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12661
    Those are interesting:
    
    	"pwmhz":"600",
    	"pirsense_pin":"26",
    	"pirfreq":"1000",
    	"pirlduty":"9",
    	"pirmduty":"6",
    	"pirin_pin":"6",
    

    I would say that pirin_pin is output (1 or 0) and pirsense_pin is PWM that controls the sensitivity of PIR?
    @piotrszulc11 what do you think?
    Helpful post? Buy me a coffee.
  • #11 20791461
    mbetter
    Level 5  
    Posts: 24
    Help: 2
    Rate: 4

    Pin 26 as ADC gave a small range of values, something like 1490-1530, which seems odd but possibly correlated with motion activity.

    Setting it as PWM was a little hard to test, as the LED controls were immediately replaced with an RGB picker. Is there a way of preventing that? I need to test more but it didn't seem like I could control sensitivity that way.
  • #12 20791743
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12661
    Maybe for now we can settle with "show raw PWMs" flag, before I come up with something better?
    Helpful post? Buy me a coffee.
  • #13 20803268
    piotrszulc1
    Level 10  
    Posts: 37
    Help: 3
    Rate: 8
    I was able to set this up using esphome - I have now a slider that controls exact values to be sent via this PWM.
    Control panel with sliders for device settings using esphome.
    Screenshot of system logs for PIR sensor configuration using ESPHome.

    The esphome yaml contains this:
    
    output:
      - platform: libretiny_pwm
        id: output_pirsense
        pin: P26
        frequency: 1000 Hz
    
    ...
    
      - platform: template
        id: pirduty_pwm
        restore_value: yes
        name: P26 output PWM
        icon: "mdi:chip"
        entity_category: config
        min_value: 0
        max_value: 255
        initial_value: 0
        step: 1
        optimistic: true
        on_value:
          then:
            lambda: !lambda |-
              id(output_pirsense).set_level(x/255);
    


    I was not sure what max_value should I set here. And how to actually test this (inside of a building)? I tried to move away a bit while changing the PWM, but I see little difference in how PIR sensor detects...

    By the way, I have bought a dual-led Brennenstuhl WFD 3050 P, which seems to be using exactly the same setup and was cloudcuttable using ume-motion-security-light profile. So we know know of 3 models with the same setup. I also have Nedis floodlight (WIFILOFS20FBK) and it also was cloudcut with the same profile, so I bet it's the same (have not tried flashing yet).

    Added after 9 [minutes]:

    Actually, I was wrong, Brennenstuhl's setup (which I use for testing at the moment) might be identical, but UPK settings seem a bit different than yours:
    
            "pirfreq": 1000,
            "pirhduty": 0,
            "pirin_lv": 1,
            "pirin_pin": 6,
            "pirlduty": 100,
            "pirmduty": 50,
            "pirmod": 1,
            "pirrange": 0,
            "pirsense_lv": 1,
            "pirsense_pin": 26,
    


    This seems to be a kind of calibration of PIR sensor, but how to use it... ?
  • ADVERTISEMENT
  • #14 20861005
    Kosygor
    Level 10  
    Posts: 28
    Help: 1
    Rate: 2

    Hi there. I just bought Brennenstuhl WF2050P Floodlight aiming to integrate it into HA. If there is any data I can share, I will.
  • #15 20861052
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12661
    Do you have an oscilloscope?
    Helpful post? Buy me a coffee.
  • #16 20861818
    Kosygor
    Level 10  
    Posts: 28
    Help: 1
    Rate: 2

    Not a "real" one, but I have Fnirsi DSO-TC3 and some Chinese Saleas logic analyzers knockoff.
  • #17 20861876
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12661
    What happens on this pin:
    
            "pirsense_pin": 26,
    

    when you adjust the sensitivity of the PIR in Tuya app?
    Helpful post? Buy me a coffee.
  • #18 20862391
    Kosygor
    Level 10  
    Posts: 28
    Help: 1
    Rate: 2

    Just to clarify, it is PIN No. 5 according to the WB3S datasheet.
    If so: I have installed the Brennenstuhl Connect app, and I have 3 settings for "Distance":
    Near: it outputs around 3V
    Medium: 3V 50% duty
    Far: 0V
    Kind of obvious, but keep in mind that I have used pretty long wires to pins 1-16, so probably 3V is really 3V3. < Ready for further testing.
  • #19 20862397
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12661
    So far is 0% duty cycle, medium is 50% duty cycle, and near is 100% duty cycle?

    So basically duty cycle is used to determine the sensitivity?
    Helpful post? Buy me a coffee.
  • #20 20862428
    Kosygor
    Level 10  
    Posts: 28
    Help: 1
    Rate: 2

    Yes, I have additionally confirmed that with a logic analyzer.
  • #21 20862441
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12661
    This should work with OpenBeken easily, I think you can now try to first do 2MB backup of flash and then flash OpenBeken:
    https://github.com/openshwprojects/BK7231GUIFlashTool
    Here are our tutorials: https://www.youtube.com/@elektrodacom
    Helpful post? Buy me a coffee.
  • #22 20862539
    Kosygor
    Level 10  
    Posts: 28
    Help: 1
    Rate: 2

    Ok, I have just got back from testing, so I will share my findings before I flash it:

    Pin No. 2 / ADC3 / P23 - light sensor with a range of 0 V = max light and 1.9 V = completely dark
    App settings - voltage above which PIR input triggers light (*-setting without name):
    Dark triggered at 1.9V
    * 1.65V
    Evening - 1.0V
    * 0.1V
    Day - ignoring setting
    I know they are inconsistent; should have gone with a potentiometer rather than a flashlight...

    Pin No. 7 / PWM0 / P6 - I can confirm that it triggers Hi when movement is detected

    Pin No. 13 / PWM3 / P9 - PWM for white balance
    Warm white = 0%
    Balanced = 50%
    Cold White 100%

    Pin No. 14 / PWM2 / P8 - PWM for emitted light intensity:
    App setting / PWM duty:
    1% - 5%
    50% - 52%
    100% - 100%

    If the existing solution will not work, I will move this data to another thread.
  • #23 20866509
    szaman89
    Level 10  
    Posts: 16
    Help: 1
    Rate: 5
    >>20803268
    Could you share your esphome configuration?
  • #24 20866739
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12661
    Kosygor wrote:

    Ok, I have just got back from testing, so I will share my findings before I flash it:

    I think I know how to support this device. Please make 2MB backup and flash OBK:
    https://github.com/openshwprojects/OpenBK7231T_App
    https://github.com/openshwprojects/BK7231GUIFlashTool
    Helpful post? Buy me a coffee.
  • #25 20866799
    piotrszulc1
    Level 10  
    Posts: 37
    Help: 3
    Rate: 8
    >>20866509
    Here you go:
    
    esphome:
      name: lsc-floodlight-1
      friendly_name: LSC Floodlight 1
    
    bk72xx:
      board: wb3s
        framework:
          version: dev
    
    logger:
    
    web_server:
    
    captive_portal:
    
    mdns:
    
    api:
      password: ""
    
    ota:
      password: ""
    
    wifi:
      ssid: !secret wifi_ssid
      password: !secret wifi_password
      use_address: 192.168.2.219
      manual_ip:
        static_ip: 192.168.2.219
        gateway: 192.168.2.1
        subnet: 255.255.255.0
      ap:
        ssid: "lsc-floodlight-1"
        password: !secret fallback_wifi_password
        ap_timeout: 5min
    
    button:
      - platform: restart
        name: Restart
    
    debug:
      update_interval: 30s
    
    globals:
      - id: manual_mode
        type: bool
        restore_value: yes
        initial_value: 'false'
      - id: light_sensitivity
        type: int
        restore_value: no
        initial_value: '0'
    
    script:
      - id: fullOnWhenMotion
        then:
          - logger.log:
              format: "fullOnWhenMotion"
          - light.turn_on:
              id: light_led
              brightness: 100%
      - id: waitThenDIM
        then:
          - logger.log:
              format: "waitThenDIM (%d, %d)"
              args: ["id(full_light_duration_s).state", "id(dim_light_percent).state"]
          - delay: !lambda "return id(full_light_duration_s).state;"
          - if:
              condition:
                - light.is_on: light_led
              then:
                - light.dim_relative:
                    id: light_led
                    relative_brightness: !lambda "return id(dim_light_percent).state;"
                - script.execute: waitThenOff
      - id: waitThenOff
        then:
          - logger.log:
              format: "waitThenOff (%d)"
              args: ["id(dim_light_duration_s).state"]
          - if:
              condition:
                - light.is_on: light_led
              then:
              - delay: !lambda "return id(dim_light_duration_s).state;"
              - light.turn_off: light_led
    
    text_sensor:
      - platform: debug
        reset_reason:
          name: Reset Reason
      - platform: libretiny
        version:
          name: LibreTiny Version
    
    sensor:
      - platform: uptime
        name: Uptime
      - platform: adc
        id: ambient
        name: Ambient
        unit_of_measurement: "V"
        state_class: "measurement"
        update_interval: 5s
        pin: P23
    
    binary_sensor:
      - platform: gpio
        id: pir_sensor
        name: Motion
        device_class: motion
        pin:
          number: P6
          mode:
            input: true
        on_press:
          then:
            - if:
                condition:
                  - lambda: !lambda return (!id(manual_mode) && (id(ambient).state > id(light_sensitivity)));
                then:
                  - script.stop: waitThenDIM
                  - script.stop: fullOnWhenMotion
                  - script.execute: fullOnWhenMotion
        on_release:
          then:
            - if:
                condition:
                  - lambda: !lambda return (!id(manual_mode) && (id(light_led).current_values.is_on()));
                then:
                  - logger.log:
                      format: "Executing on_release"
                  - script.execute: waitThenDIM
    
    output:
      - platform: libretiny_pwm
        id: output_pirsense
        pin: P26
        inverted: True
      - platform: libretiny_pwm
        id: out_warm
        pin: P9
      - platform: libretiny_pwm
        id: out_cold
        pin: P8
    
    light:
      - platform: cwww
        id: light_led
        name: Light
        restore_mode: RESTORE_AND_OFF
        cold_white_color_temperature: 6500 K
        warm_white_color_temperature: 2700 K
        warm_white: out_warm
        cold_white: out_cold
    
    switch:
      - platform: template
        id: manual_mode_switch
        name: "Manual mode"
        lambda: !lambda |-
          return id(manual_mode);
        turn_on_action:
          then:
            if:
              condition:
                - lambda: "return !id(manual_mode);"
              then:
                - globals.set:
                    id: manual_mode
                    value: 'true'
                - script.stop: waitThenDIM
                - script.stop: waitThenOff
                - light.turn_on: light_led
        turn_off_action:
          then:
            if:
              condition:
                - lambda: "return id(manual_mode);"
              then:
                - script.stop: waitThenDIM
                - script.stop: waitThenOff
                - light.turn_off: light_led
                - globals.set:
                    id: manual_mode
                    value: 'false'
    
    number:
      - platform: template
        id: full_light_duration_s
        restore_value: yes
        name: Full light duration
        icon: "mdi:clock"
        entity_category: config
        unit_of_measurement: "s"
        min_value: 0
        max_value: 600
        initial_value: 10
        step: 1
        optimistic: true
    
      - platform: template
        id: dim_light_duration_s
        restore_value: yes
        name: Dim light duration
        icon: "mdi:clock"
        entity_category: config
        unit_of_measurement: "s"
        min_value: 0
        max_value: 60
        initial_value: 10
        step: 1
        optimistic: true
    
      - platform: template
        id: dim_light_percent
        restore_value: yes
        name: Dim light percent
        icon: "mdi:clock"
        entity_category: config
        unit_of_measurement: "%"
        min_value: 0
        max_value: 100
        initial_value: 50
        step: 1
        optimistic: true
    
      - platform: template
        id: pirduty_pwm
        restore_value: yes
        initial_value: 50
        name: PIR sensitivity
        icon: "mdi:chip"
        entity_category: config
        min_value: 0
        max_value: 100
        step: 10
        optimistic: true
        on_value:
          then:
            lambda: !lambda |-
              id(output_pirsense).set_level(x/100);
    
    select:
      - platform: template
        id: light_sensitivity_setting
        name: "Ambient light trigger"
        entity_category: config
        restore_value: yes
        options:
         - "Day"
         - "Dusk"
         - "Evenfall"
         - "Evening"
         - "Night"
        initial_option: "Evenfall"
        optimistic: true
        set_action:
          - logger.log:
              format: "Chosen option: %s"
              args: ["x.c_str()"]
        on_value:
          then:
            lambda: !lambda |-
              if (i == 1)
              {
                id(light_sensitivity) = 0.157f;
              }
              else
              if (i == 2)
              {
                id(light_sensitivity) = 1.800f;
              }
              else
              if (i == 3)
              {
                id(light_sensitivity) = 2.100f;
              }
              else
              if (i == 4)
              {
                id(light_sensitivity) = 2.180f;
              }
              else id(light_sensitivity) = 0.0f;
    


    Edit: I've noticed that I posted the wrong yaml (not for LSC), so edited the post and now it should be correct.
  • #26 20942487
    lionboy
    Level 10  
    Posts: 69
    Help: 1
    Rate: 4
    Hello,

    I have a simillar device only my is powered by Battery:

    
    esphome:
      name: lumina-hol3
    
    external_components:
      - source: github://Xmister/libretuya-esphome@deep-sleep-compat
        components: [ esp32, deep_sleep ]
    
    bk72xx:
      board: generic-bk7231n-qfn32-tuya
      framework:
        version: dev
    
    logger:
    
    web_server:
    
    captive_portal:
    
    mdns:
    
    api:
      password: ""
    
    ota:
      password: ""
    
    wifi:
      ssid: !secret wifi_smart
      password: !secret wifi_smart_pass
      ap:
        ssid: "Lumina_Hol_3"
        password: ""
    
    button:
      - platform: restart
        name: Restart
    
    debug:
      update_interval: 30s
    
    globals:
      - id: manual_mode
        type: bool
        restore_value: yes
        initial_value: 'false'
      - id: light_sensitivity
        type: int
        restore_value: no
        initial_value: '0'
    
    script:
      - id: fullOnWhenMotion
        then:
          - logger.log:
              format: "fullOnWhenMotion"
          - light.turn_on:
              id: light_monochromatic
              brightness: 50%
      - id: waitThenDIM
        then:
          - logger.log:
              format: "waitThenDIM (%d, %d)"
              args: ["id(full_light_duration_s).state", "id(dim_light_percent).state"]
          - delay: !lambda "return id(full_light_duration_s).state;"
          - if:
              condition:
                - light.is_on: light_monochromatic
              then:
                - light.dim_relative:
                    id: light_monochromatic
                    relative_brightness: !lambda "return id(dim_light_percent).state;"
                - script.execute: waitThenOff
      - id: waitThenOff
        then:
          - logger.log:
              format: "waitThenOff (%d)"
              args: ["id(dim_light_duration_s).state"]
          - if:
              condition:
                - light.is_on: light_monochromatic
              then:
              - delay: !lambda "return id(dim_light_duration_s).state;"
              - light.turn_off: light_monochromatic
    
    text_sensor:
      - platform: debug
        reset_reason:
          name: Reset Reason
      - platform: libretiny
        version:
          name: LibreTiny Version
    
    sensor:
      - platform: uptime
        name: Uptime
      - platform: adc
        id: ambient
        name: Ambient
        unit_of_measurement: "V"
        state_class: "measurement"
        update_interval: 5s
        pin: P23
    
    binary_sensor:
      - platform: gpio
        id: pir_sensor
        name: Motion
        device_class: motion
        pin:
          number: P6
          mode:
            input: true
        on_press:
          then:
            - if:
                condition:
                  - lambda: !lambda return (!id(manual_mode) && (id(ambient).state > id(light_sensitivity)));
                then:
                  - script.stop: waitThenDIM
                  - script.stop: fullOnWhenMotion
                  - script.execute: fullOnWhenMotion
        on_release:
          then:
            - if:
                condition:
                  - lambda: !lambda return (!id(manual_mode) && (id(light_monochromatic).current_values.is_on()));
                then:
                  - logger.log:
                      format: "Executing on_release"
                  - script.execute: waitThenDIM
    
    output:
      - platform: libretiny_pwm
        id: output_pirsense
        pin: P8
        inverted: True
      - platform: libretiny_pwm
        id: output_cold
        pin: P24
        frequency: 1000 Hz
    
    
    light:
      - platform: monochromatic
        id: light_monochromatic
        name: Lumina Hol 3
        output: output_cold
    
    switch:
      - platform: template
        id: manual_mode_switch
        name: "Manual mode"
        lambda: !lambda |-
          return id(manual_mode);
        turn_on_action:
          then:
            if:
              condition:
                - lambda: "return !id(manual_mode);"
              then:
                - globals.set:
                    id: manual_mode
                    value: 'true'
                - script.stop: waitThenDIM
                - script.stop: waitThenOff
                - light.turn_on: light_monochromatic
        turn_off_action:
          then:
            if:
              condition:
                - lambda: "return id(manual_mode);"
              then:
                - script.stop: waitThenDIM
                - script.stop: waitThenOff
                - light.turn_off: light_monochromatic
                - globals.set:
                    id: manual_mode
                    value: 'false'
    
    number:
      - platform: template
        id: full_light_duration_s
        restore_value: yes
        name: Full light duration
        icon: "mdi:clock"
        entity_category: config
        unit_of_measurement: "s"
        min_value: 0
        max_value: 600
        initial_value: 10
        step: 1
        optimistic: true
    
      - platform: template
        id: dim_light_duration_s
        restore_value: yes
        name: Dim light duration
        icon: "mdi:clock"
        entity_category: config
        unit_of_measurement: "s"
        min_value: 0
        max_value: 60
        initial_value: 10
        step: 1
        optimistic: true
    
      - platform: template
        id: dim_light_percent
        restore_value: yes
        name: Dim light percent
        icon: "mdi:clock"
        entity_category: config
        unit_of_measurement: "%"
        min_value: 0
        max_value: 100
        initial_value: 50
        step: 1
        optimistic: true
    
      - platform: template
        id: pirduty_pwm
        restore_value: yes
        initial_value: 50
        name: PIR sensitivity
        icon: "mdi:chip"
        entity_category: config
        min_value: 0
        max_value: 100
        step: 10
        optimistic: true
        on_value:
          then:
            lambda: !lambda |-
              id(output_pirsense).set_level(x/100);
    
    select:
      - platform: template
        id: light_sensitivity_setting
        name: "Ambient light trigger"
        entity_category: config
        restore_value: yes
        options:
         - "Day"
         - "Dusk"
         - "Evenfall"
         - "Evening"
         - "Night"
        initial_option: "Evenfall"
        optimistic: true
        set_action:
          - logger.log:
              format: "Chosen option: %s"
              args: ["x.c_str()"]
        on_value:
          then:
            lambda: !lambda |-
              if (i == 1)
              {
                id(light_sensitivity) = 0.157f;
              }
              else
              if (i == 2)
              {
                id(light_sensitivity) = 1.800f;
              }
              else
              if (i == 3)
              {
                id(light_sensitivity) = 2.100f;
              }
              else
              if (i == 4)
              {
                id(light_sensitivity) = 2.180f;
              }
              else id(light_sensitivity) = 0.0f;
    


    I succesfully manage to adapt you code to my device, you can finde details on this post if anyone want to know about this:

    Now i am waiting to implement Deep Sleep on this libretiny version because is very hard to manage battery without deep sleep,
    From 3 device on 1 a change CBU with ESP8685-WROOM-06-H4 and with deep sleep implemented i am at 4 day's without charging.

    https://www.elektroda.com/rtvforum/topic4031757.html

    Thanks

    Added after 1 [hours] 49 [minutes]:

    At me i have a problem with that lux because is show me max value when is light and zero when is night and on Volts don't go much more then 0.8

    Added after 1 [hours] 21 [minutes]:

    >>20866799
    I don't understand why at me is this and don't go up then 1.88

    
    [16:17:58][D][sensor:093]: 'Ambient': Sending state 1.57200 V with 2 decimals of accuracy
    [16:18:03][D][sensor:093]: 'Ambient': Sending state 1.87300 V with 2 decimals of accuracy
    [16:18:08][D][sensor:093]: 'Ambient': Sending state 1.88100 V with 2 decimals of accuracy
    [16:18:13][D][sensor:093]: 'Ambient': Sending state 1.88300 V with 2 decimals of accuracy
    


    
    {
    	"Jsonver":"1.0.8",
    	"brightmin":"10",
    	"gmwb":"75",
    	"title20":"0",
    	"dimval":"0",
    	[b]"dusk":"265",[/b]
    	"gmwg":"70",
    	"cdsval":"2",
    	"pirsense_lv":"1",
    	"wfcfg":"spcl",
    	"colormin":"10",
    	"lockt":"7",
    	"preheatt":"20",
    	"pmemory":"1",
    	"gmkb":"60",
    	"cmod":"c",
    	[b]"evenfall":"460",[/b]
    	"cwtype":"0",
    	[b]"day":"0",[/b]
    	"pirin_lv":"1",
    	"rstbr":"10",
    	"colormax":"100",
    	"c_pin":"24",
    	"pirhduty":"0",
    	"notdisturb":"0",
    	[b]"night":"2180",[/b]
    	"module":"CBU",
    	"pirrange":"0",
    	"ctrl_lv":"1",
    	"cwmaxp":"100",
    	"dmod":"0",
    	"brightmax":"100",
    	"trigmod":"0",
    	"wfct":"3",
    	"pwmhz":"1000",
    	"pirsense_pin":"8",
    	"defbright":"100",
    	"rstnum":"5",
    	"rstcor":"c",
    	"dimt":"1",
    	"deftemp":"100",
    	"c_lv":"1",
    	"pirfreq":"20000",
    	"trigdelay":"10",
    	"keyfunc":"0",
    	"ctrl_pin":"26",
    	"pirmod":"0",
    	"pirlduty":"16",
    	"pirir":"7",
    	"wt":"0",
    	"prodagain":"1",
    	"remdmode":"0",
    	"pirmduty":"7",
    	"cagt":"20",
    	"dimmod":"1",
    	"colorpfun":"0",
    	"pirin_pin":"6",
    	"gmwr":"100",
    	"rgbt":"0",
    	"colormaxp":"100",
    	"gmkg":"60",
    	"onoffmode":"1",
    	"pirwarn":"0",
    	"rsttemp":"100",
    	[b]"evening":"1400",[/b]
    	"category":"0501",
    	"gmkr":"80",
    	"defcolor":"c",
    	"crc":"46"
    }
    


    
    select:
      - platform: template
        id: light_sensitivity_setting
        name: "Ambient light trigger"
        entity_category: config
        restore_value: yes
        options:
         - "Day"
         - "Dusk"
         - "Evenfall"
         - "Evening"
         - "Night"
        initial_option: "Evenfall"
        optimistic: true
        set_action:
          - logger.log:
              format: "Chosen option: %s"
              args: ["x.c_str()"]
        on_value:
          then:
            lambda: !lambda |-
              if (i == 1)
              {
                id(light_sensitivity) = 0.265f;
              }
              else
              if (i == 2)
              {
                id(light_sensitivity) = 0.460f;
              }
              else
              if (i == 3)
              {
                id(light_sensitivity) = 1.400f;
              }
              else
              if (i == 4)
              {
                id(light_sensitivity) = 2.180f;
              }
              else id(light_sensitivity) = 0.0f;
    


    Maybe i miss something because i don't get it why one lamp go max to 1.8 amd amother one go max to 1.55

    Thanks

    Added after 2 [minutes]:

    At me there are a new PIN and i don't know what this pin do:

    "ctrl_pin":"26",

    Added after 1 [minutes]:

    >>20866739
    I can give from my device 2 MB full dump
    Attachments:
    • ltchiptool_bk72xx_2024-01-27_15-40-11.bin (2 MB) You must be logged in to download this attachment.
  • #27 20950930
    airdrummingfool
    Level 3  
    Posts: 4

    Hello, I have a device that appears to be very similar to the devices being discussed here. It is an Amico Smart LED Motion Sensor Floodlight with BK7231T / WB3S. I was able to upload custom firmware with CloudCutter, and now I have it running the latest version of OBK.

    I would love to get a full configuration set up and then shared, but I'm running into some issues and I can't tell if it's incorrect configuration or just a defective device. I'm working on the PIR sensor input (P6), which does trigger when I walk in front of it, but it also triggers randomly, sometimes repeatedly for many minutes at a time. I tried using a pullup configuration ("6": "dInput_n;57") and also the configuration from this thread ("6": "dInput_NoPullUp;3") but neither fixed the phantom triggering problem. I also tried setting the PIR sensitivity to low (P26 PWM 1000hz 100% duty cycle), but it didn't seem to work (though I'm not positive I configured the sensitivity pin correctly).

    I've also found what seems like a bug somewhere in the Home Assistant Discovery configuration. I have OBK connected to Home Assistant via MQTT, and the device successfully shows up using Discovery. However, the PIR sensor shows as ON in Home Assistant when it is low/off in OBK. If I manually publish a "1" via MQTT for the discovery topic of the PIR sensor, HA shows the sensor as OFF. I grabbed the discovery config that OBK published and it looks like the values for on and off might be reversed - pl_on should be 1 and pl_off should be 0, I think?
    Code: JSON
    Log in, to see the code


    Please let me know if there's any information I can share or anything I can try to help get the configuration ironed out for these devices!
  • #28 20952296
    lionboy
    Level 10  
    Posts: 69
    Help: 1
    Rate: 4
    Can you upload 2 Mb dump file here?

    Thanks
  • #29 20952388
    airdrummingfool
    Level 3  
    Posts: 4
    Is this what you're looking for, or do you need a full flash dump? I've redacted some sensitive info (like wifi) but otherwise this should be the full storage data JSON:

    Code: JSON
    Log in, to see the code
  • #30 20952591
    lionboy
    Level 10  
    Posts: 69
    Help: 1
    Rate: 4

    Hello,

    Please like this video:

    https://www.youtube.com/watch?v=WunlqIMAdgw

    For ESPHome, the configuration is only for PWM light:

    
    esphome:
      name: upk2esphome-bk7231t
    bk72xx:
      board: generic-bk7231t-qfn32-tuya
    logger:
    web_server:
    captive_portal:
    mdns:
    api:
      password: ""
    ota:
      password: ""
    wifi:
      ssid: !secret wifi_ssid
      password: !secret wifi_password
      ap:
    button:
      - platform: restart
        name: Restart
    debug:
      update_interval: 30s
    text_sensor:
      - platform: debug
        reset_reason:
          name: Reset Reason
      - platform: libretiny
        version:
          name: LibreTiny Version
    sensor:
      - platform: uptime
        name: Uptime
    output:
      - platform: libretiny_pwm
        id: output_cold
        pin: P24
      - platform: libretiny_pwm
        id: output_warm
        pin: P9
    light:
      - platform: cwww
        id: light_cwww
        name: Light
        cold_white_color_temperature: 6500 K
        warm_white_color_temperature: 2700 K
        cold_white: output_cold
        warm_white: output_warm
    


    Thanks

Topic summary

✨ The discussion centers on the BK7231T-based WB3S UME Outdoor Security Floodlight featuring motion-activated LED control with a PIR sensor, ambient light sensor (ADC), and cold white (CW) LED lights. Users successfully soldered to RX1/TX1 pins for serial flashing using "uartprogram" after GUI flasher failures. The PIR sensor output is a digital 0/1 signal on pin P6, while ambient light sensing uses ADC on pin P23. PWM outputs control white balance and brightness (pins P9 and P8). Sensitivity adjustment for the PIR sensor is challenging; the original Tuya firmware uses PWM duty cycle on pin 26 (pirsense_pin) at 1000 Hz to modulate sensitivity, but OpenBK and ESPHome implementations struggle to replicate this fully. I2C scanning for the PIR sensor was suggested but is complicated without opening the device. Users shared ESPHome YAML configurations for PWM light control and discussed flashing OpenBK firmware for enhanced customization. Phantom triggering of the PIR sensor outdoors, likely due to environmental noise such as wind, remains an unresolved issue despite attempts with pull-up/down configurations and PWM frequency adjustments (600 Hz vs. 1000 Hz). Suggestions include improved input filtering, noise mitigation, and sampling algorithms. The Brennenstuhl WF2050P and Amico Smart LED Motion Sensor Floodlight were confirmed to use similar hardware and firmware approaches. Community members offered to develop drivers and test devices to improve PIR sensor handling and sensitivity control.

FAQ

TL;DR: If your WB3S floodlight stalls at 0x00, power it from 9 V through the board regulator and flash with uartprogram; one tester said the GUI flasher “got stuck immediately,” but UART flashing worked. This FAQ is for BK7231T/WB3S motion floodlights that need reliable pin mapping, PIR sensitivity, and autonomous motion logic in OpenBeken or ESPHome. [#20764976]

Why it matters: These lamps share a reusable hardware pattern, so one verified map and control method can save hours of reverse-engineering across UME, Brennenstuhl, LSC, Nedis, and Amico variants.

Option Strength Limitation Best use
OpenBeken Native BK7231T workflow, Tuya config extraction, local scripts PIR handling may need custom logic or tuning Lightweight autonomous control
ESPHome Strong Home Assistant integration, easy scripted delays, PWM slider entities More YAML, some pull-up/pull-down behavior was questioned on WB3S Rich HA-centric automation
Tuya stock firmware Working app UI for distance, lux, and delay settings Cloud dependency, limited local control Reference behavior and calibration

Key insight: P26 is the practical PIR sensitivity control point on this hardware family. The thread’s strongest evidence shows Tuya changes sensitivity by driving P26 with PWM duty levels, while P6 remains the motion output and P23 remains the ambient-light ADC.

Quick Facts

  • Verified common pin map on several BK7231T/WB3S floodlights: P6 = motion input, P8/P9 = CW LEDs, P23 = ambient ADC, P26 = PIR sensitivity PWM. [#20862539]
  • The ambient sensor is inverted in practice: it reads about 0 V or 0 counts in bright light and up to 1.9 V or roughly 3000 counts in darkness. [#20862539]
  • Tuya config values exposed useful defaults: pirfreq 1000 Hz, trigdelay 15 s, pirsense_pin 26, and pirin_pin 6 on one UME-type lamp. [#20790634]
  • Measured Tuya distance control on P26 mapped to PWM: Near ≈ 3.0–3.3 V / 100% duty, Medium ≈ 50% duty, Far ≈ 0% duty. [#20862391]
  • False triggers were reproduced on both stock Tuya and flashed firmware outdoors, then disappeared indoors, pointing to over-sensitivity or environmental triggering rather than flashing alone. [#20963705]

How do I flash a WB3S/BK7231T UME outdoor security floodlight when the GUI flasher gets stuck at reading 0x00, and what wiring and power setup works with uartprogram from hid_download?

Use uartprogram from hid_download instead of the GUI flasher. One successful setup was: 1. Solder to RX1 and TX1 on the WB3S module. 2. Unplug the JST lead and feed VCE and GND with 9 V, which then goes through the AMS1117 regulator. 3. Share ground with the USB-UART adapter, but do not use the adapter’s 3.3 V pin. That exact wiring flashed successfully after the GUI tool stopped at 0x00. [#20764976]

What is a WB3S module, and how does it relate to the BK7231T chip used in Tuya floodlights?

WB3S is the plug-in Wi‑Fi module, and BK7231T is the SoC on that module. "WB3S is a Wi‑Fi module that hosts the BK7231T controller, exposing pins for UART flashing, GPIO, ADC, and PWM control." In this floodlight family, the board is identified as WB3S, while the firmware and pin mapping target the BK7231T chip. That is why tools, configs, and ESPHome/OpenBeken board choices refer to both names. [#20952388]

What is a PIR sensor, and how is it different from the ambient light sensor on these BK7231T floodlights?

The PIR sensor detects motion, while the ambient sensor measures brightness. "PIR sensor is a motion sensor that changes state when movement is detected, usually as a digital 0/1 signal; the ambient light sensor is a light-level sensor that outputs a varying analog value." On these lamps, P6 goes HIGH on motion, but P23/ADC3 changes across a range, from bright conditions near 0 to dark conditions around 3000 counts or about 1.9 V. [#20764976]

How can I map the pins on a UME or Brennenstuhl BK7231T floodlight for motion input, CW LEDs, ambient light ADC, and PIR sensitivity PWM?

Map the common family pins as P6 = motion, P8/P9 = CW LED PWM, P23 = ambient ADC, and P26 = PIR sensitivity PWM. A later hardware check on a Brennenstuhl unit confirmed P6 high on movement, P9 as white-balance PWM, P8 as light-intensity PWM, and P23 as the light sensor. Tuya storage also exposed pirsense_pin: 26 and pirin_pin: 6, which matches the practical mapping used in ESPHome. [#20862539]

What's the best way in OpenBeken to make both CW LED channels turn on together from motion without breaking the selected color temperature?

Drive the light as one logical CW/CW light, then trigger both channels together with a command or script. A direct OpenBeken suggestion was to use a change handler and run led_enableAll 1, instead of binding motion to only one LED channel. That avoids the bad result where only warm or only cool turns on and shifts color temperature. If you need the previous white balance preserved, keep P8 and P9 under the light entity and let motion call the combined enable action. [#20768158]

How do I add an off-delay in OpenBeken or ESPHome so a PIR floodlight stays on for 15 to 30 seconds after motion ends?

Add a delayed action after the motion event or motion release. In OpenBeken, one suggested pattern was led_enableAll 1 plus a single-repeat delayed event, for example 30 seconds, that runs led_enableAll 0. In the Tuya-derived config, one lamp already stored trigdelay: 15, which is a useful starting point. ESPHome examples in the thread used delay: inside scripts, then dimmed or switched off after user-set durations. [#20768158]

Why does the ambient light sensor on P23 read 0 in bright conditions and up to around 3000 or about 1.9 V in darkness on these lamps?

Because this sensor path is inverted: brighter light lowers the reading, and darkness raises it. One tester measured 0 = brightest and about 3000 = darkest on the ADC scale. Another tester measured about 0 V in maximum light and roughly 1.9 V in complete darkness on the same sensor path. That behavior matches the Tuya threshold fields such as dusk, evenfall, evening, and night, which all represent darker conditions with larger values. [#20862539]

How does the PIR sensitivity control work on pirsense_pin P26, and what PWM duty cycles correspond to near, medium, and far distance settings in the Tuya app?

P26 works as a PWM-driven sensitivity input, not as the main motion output. The clearest measurement showed Tuya’s distance settings as Near ≈ 3 V, Medium ≈ 3 V at 50% duty, and Far ≈ 0 V. A logic-analyzer follow-up confirmed that meant Near = 100% duty, Medium = 50% duty, and Far = 0% duty. In practice, P6 still reports motion, while P26 sets how sensitive the PIR front end is. [#20862428]

Where can I find PIR sensitivity, trigger delay, and pin assignments in the extracted Tuya storage JSON or UPK config for these floodlights?

Look in the extracted Tuya JSON or UPK user_param_key section. Useful keys include pirsense_pin, pirin_pin, pirfreq, pirlduty, pirmduty, pirhduty, pirrange, and trigdelay. One dumped config exposed pirsense_pin: 26, pirin_pin: 6, c_pin: 8, w_pin: 9, pirfreq: 1000, and trigdelay: 15. Those fields gave enough information to build a working local config without reopening the lamp. [#20790634]

What causes phantom PIR triggering on BK7231T/WB3S floodlights after flashing OpenBeken or ESPHome, and how do I troubleshoot pull-up, pull-down, PWM frequency, and noise issues?

Phantom triggering can come from real over-sensitivity or environmental noise, not only bad firmware. One tester saw false triggers on both OpenBeken and stock Tuya outdoors, but not indoors, then concluded wind was triggering the sensor. Practical checks were: 1. Try input modes with pull-up, no pull, and pull-down where supported. 2. Test PIR PWM at 1000 Hz and optionally 600 Hz. 3. If needed, add external resistor biasing and inspect for supply or ground noise. This is an edge case where the hardware can remain problematic even when the pin map is correct. [#20963705]

How should I scan for possible I2C devices on a Tuya floodlight when I suspect the PIR sensitivity might be controlled over I2C rather than a simple GPIO?

Start by extracting Tuya config first, because it may reveal the control pins without blind scanning. That suggestion solved one case: after reviewing the dumped config, the user found pirsense_pin: 26 and stopped treating PIR control as a pure I2C mystery. If you still suspect I2C, you would need to guess or trace possible SDA and SCL pins, then scan them systematically. The thread treats that as time-consuming unless you can open the lamp and inspect the sensor board. [#20790096]

OpenBeken vs ESPHome for WB3S motion floodlights — which is better if I need autonomous motion logic, PIR sensitivity control, and Home Assistant integration?

Choose ESPHome if you want fast Home Assistant integration and easy scripted behavior; choose OpenBeken if you want a lighter native BK7231T workflow and Tuya-oriented recovery tools. The strongest ESPHome example exposed P26 as a slider, used P6 for motion, P23 for ambient sensing, and added autonomous delay scripts. OpenBeken, however, was the preferred route when users wanted local device logic without relying on openHAB or cloud behavior. Both worked on this hardware family. [#20866799]

How do I build an ESPHome config for an LSC, UME, Brennenstuhl, Nedis, or Amico BK7231T floodlight with P6 motion input, P23 ambient ADC, P8/P9 CW outputs, and P26 PIR PWM control?

Use binary_sensor on P6, adc on P23, libretiny_pwm outputs on P8 and P9, and a PWM output on P26 for PIR sensitivity. One working config used a cwww light with cold_white = P8, warm_white = P9, plus a template number that called output_pirsense.set_level(x/100). It also added scripts for full brightness, dimming, and delayed off. That layout was reported working on LSC-type hardware and later linked to Brennenstuhl, Nedis, and similar lamps. [#20866799]

Why is Home Assistant MQTT Discovery showing the PIR sensor state reversed for an OpenBeken binary sensor, and how should pl_on and pl_off be configured?

The reported issue was that Discovery published reversed payloads for that PIR entity. The captured JSON showed pl_on: "0" and pl_off: "1", while the tester expected the opposite because Home Assistant displayed ON when OpenBeken showed the pin low. For a normal active-high motion signal, pl_on should be the asserted value and pl_off the idle value. On that device, the report suggested pl_on = 1 and pl_off = 0 were the correct mapping. [#20950930]

What is a working OpenBK solution to make the PIR operate correctly on the Brennenstuhl WF2050P and similar BK7231T floodlights, including sensitivity and false-trigger handling?

Use the shared pin map, set PIR sensitivity on P26 with PWM, and add software delay or filtering around P6. The most complete thread evidence confirmed Brennenstuhl WF2050P uses the same family layout, with Tuya-style distance control on P26 and motion on P6. For reliable behavior, keep P26 at 0%, 50%, or 100% duty for far, medium, or near, then add delayed-off logic in firmware. If false triggers remain outdoors, treat them as a real sensitivity problem and lower duty or test placement, because some units still triggered from wind. [#21328667]
ADVERTISEMENT