Elektroda.com
Elektroda.com
X

[BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

p.kaczmarek2 89277 1198
This content has been translated flag-pl » flag-en View the original version here.
  • marioalmeida
    Level 10  
    @p.kaczmarek2

    Is there a way to mark MQTT "IP" field as retain true?
  • p.kaczmarek2
    Moderator Smart Home
    ferbulous wrote:

    Tried assigning remaining pibs P7, P8, P9 & 15 for digitalinput & digitalinput_nopull up
    It does toggle the relays on when I assign digitalinput & relays off for digitalinput_n. Same goes for digitalinput_nopullup
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    Toggling the physical buttons doesn't trigger anything yet so far

    So it reads 1 all the time? Or 0?

    ferbulous wrote:

    How can I check for that?

    Check with multimeter and/or by looking at the traces.

    Dodano po 1 [minuty]:

    marioalmeida wrote:
    @p.kaczmarek2

    Is there a way to mark MQTT "IP" field as retain true?

    Mark from MQTT on OpenBeken side? It should be very easy, there is already a bRetain flag, just set it in code and submit a pull request.
  • marioalmeida
    Level 10  
    p.kaczmarek2 wrote:
    Mark from MQTT on OpenBeken side? It should be very easy, there is already a bRetain flag, just set it in code and submit a pull request.

    I searched in the OpenBK7231T_App repo but was not able to find bRetain flag, may be I am searching the wrong location.

    What will happen if addChangeHandler is executed twice with different repeating values, eg:-
    addChangeHandler Channel1 == 1 addRepeatingEvent 500 1 setChannel 1 0
    addChangeHandler Channel1 == 1 addRepeatingEvent 300 1 setChannel 1 0

    Will the second execution override the first one?

    How can I cancel running addRepeatingEvent event?
    Is the scripting ready @p.kaczmarek2 ?
    Is the any option to add child lock for a physical button?
  • Dark Man
    Level 12  
    p.kaczmarek2 wrote:
    Do you use the UI on the layout website or only with HA?

    in HA it is most important to me. The WWW GUI is only needed for tests

    p.kaczmarek2 wrote:
    EDIT: What do you have here?

    I have that:
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    Short name: obk42E97C5D, BK7231T chipset
  • Ari2
    Level 1  
    Hello,
    First, huge thanks to the developer to make it work. I have a few light switches on the BK7231T module (I discovered this after I bought them), and this saved my life.
    But, I found two problems with the firmware.
    1) When I disconnect (shut down) HA for a few hours, both switches disconnect (freeze?), and I can't access them from the browser. It happens all the time when HA is down for a longer time, and I have to turn off breakers at home to fix them. I think that maybe it is related to MQTT somehow, that packages are not reaching the broker.
    2) I tried to set up the watchdog to ping my HA instead of the router. But this is another problem. When I set up the HA IP, the firmware doesn't see that the HA is down. It still shows that all pings are working fine.

    I also have six or seven other switches with Tasmota, and they don't have any issues with stability when HA is not available.

    Does anybody have a similar experience?

    Thanks,
    Ari
  • p.kaczmarek2
    Moderator Smart Home
    marioalmeida wrote:

    I searched in the OpenBK7231T_App repo but was not able to find bRetain flag, may be I am searching the wrong location.

    Code: c
    Log in, to see the code


    marioalmeida wrote:

    What will happen if addChangeHandler is executed twice with different repeating values, eg:-
    addChangeHandler Channel1 == 1 addRepeatingEvent 500 1 setChannel 1 0
    addChangeHandler Channel1 == 1 addRepeatingEvent 300 1 setChannel 1 0

    Will the second execution override the first one?

    It executes them all, as far as I remember.


    marioalmeida wrote:

    How can I cancel running addRepeatingEvent event?

    I can add an option for that, maybe registering an event with a certain ID and then using this ID to cancel?


    marioalmeida wrote:

    Is the any option to add child lock for a physical button?

    How would you like it to work?




    Ari2 wrote:

    1) When I disconnect (shut down) HA for a few hours, both switches disconnect (freeze?), and I can't access them from the browser. It happens all the time when HA is down for a longer time, and I have to turn off breakers at home to fix them. I think that maybe it is related to MQTT somehow, that packages are not reaching the broker.

    Can you check latest release:
    https://github.com/openshwprojects/OpenBK7231T_App/releases/tag/1.12.44
    I have disabled that large debug MQTT publish with data like WiFi signal quality, heap size, etc and would like to see if your problem persists

    Ari2 wrote:

    2) I tried to set up the watchdog to ping my HA instead of the router. But this is another problem. When I set up the HA IP, the firmware doesn't see that the HA is down. It still shows that all pings are working fine.

    Is the HA machine down? Because ping checks for the machine with given IP, not just for HA instance running on given machine. Ping will report "online" even if HA is down but it's machine is still up.[/code]
  • marioalmeida
    Level 10  
    p.kaczmarek2 wrote:

    It executes them all, as far as I remember.

    Is it possible to cancel the previous execution?


    p.kaczmarek2 wrote:

    I can add an option for that, maybe registering an event with a certain ID and then using this ID to cancel?

    Please if you can, in that case, how to get the registering event ID?

    p.kaczmarek2 wrote:

    How would you like it to work?

    Based on a boolean channel state, if the channel is true, then child lock is on and avoid button click, only API/MQTT should work.
  • staszek_org
    Level 2  
    p.kaczmarek2 wrote:
    And what is the division of duties between the chief inspector and a single lead teacher?

    The easiest way would be to add the required stuff to OpenBeken, as it would also work right away on BL602 and W800 and other supported platforms.

    DDP has already been submitted for implementation by one of the US users and will be done as a very simple protocol.

    Could you please mention which functionalities of this WLED you use?


    @ darkman1 could use a UART log, so do older versions have this problem?


    I send DDP from ESP32 (works like a controller for 10 bulbs) with WLED installed:
    https://www.youtube.com/watch?v=d0ow9qJT8Ak
    https://kno.wled.ge/advanced/ddp/

    Then these bulbs are like virtual addressable LEDs (something like sk6812) for the main ESP32 controller, only connected wirelessly.
    And this is connected to the LEDFX installed on the computer so that it reacts to the music (I will just try with xLights).
    Of course, you can connect more controllers and 10 light bulbs each for more light sources.

    That is:
    A computer with LEDFX, xLights or Hyperion NG installed (if you add support for real time UDP) controls the ESP32 chip on which WLED is installed (so as to wirelessly receive commands from the computer), and then ESP32 continues to send wireless control instructions to specific incandescent lamps (DDP is a fast protocol, so good for it).

    For the computer, the bulbs themselves are seen as ESP32 with WLED installed and 1 pixel long SK6812 (or WS2812) LED strips directly connected (as if 10 separate addressable LEDs were wired, even though they are bulbs wirelessly connected via DDP).

    I have sent a more detailed description to priv.

    Regards. :)
  • blakadder
    Level 6  
    CB2S module issue, re-flashed with `python uartprogram D:\OpenBeken\hid_download\OpenBK7231N_QIO_1.12.44.bin -d COM11 -w --unprotect --startaddr 0x0`

    After WiFi config through AP it's stuck
    Code: markdown
    Log in, to see the code


    CEN reset after that results in:
    Code: markdown
    Log in, to see the code


    after a power cycle the module is back to AP
    Code: markdown
    Log in, to see the code
  • p.kaczmarek2
    Moderator Smart Home
    marioalmeida wrote:
    p.kaczmarek2 wrote:

    It executes them all, as far as I remember.

    Is it possible to cancel the previous execution?

    Without ID mechanism it won't be possible to determine which callback we are canceling. Unless... you'd want an option to cancel them all by event name?

    marioalmeida wrote:

    p.kaczmarek2 wrote:

    I can add an option for that, maybe registering an event with a certain ID and then using this ID to cancel?

    Please if you can, in that case, how to get the registering event ID?

    I will add it when I get some time, please check again then. What kind of syntax would you expect?



    @blakadder there is indeed a known issue with newer versions of CB2S modules. It didn't happen for me, or neither for, for example, for Jennifer who wrote the Qiachip Fan CB2S Controller teardown, but it already happened for one user in the dedicated CB2S topic.
    It seems that Tuya changed something in the wifi config stuff partition (which is used by BK7231 SDK code, not by Tuya code) and newer devices might have this crash.
    The temporary solution was to clear the other partitions in binary file by hand and flash full 2MB.
    See attachment here:
    https://www.elektroda.com/rtvforum/viewtopic.php?p=20148513#20148513
    Can you flash it and report here if it solved your issue? Thanks!
    PS: the better solution is on the way, I will add a button in AP mode saying "Nuke config partitions" or just do it automatically...
    PS2: you will have to change MAC by hand later



    Some progress update: HA autodiscovery and auto page refreshing is on the way!
  • blakadder
    Level 6  
    I did look for a "Reset configuration" button but couldn't find one. You indeed need to add one
  • marioalmeida
    Level 10  
    p.kaczmarek2 wrote:
    Without ID mechanism it won't be possible to determine which callback we are canceling. Unless... you'd want an option to cancel them all by event name?

    Better to have it by ID

    p.kaczmarek2 wrote:
    I will add it when I get some time, please check again then. What kind of syntax would you expect?

    Just the ID via MQTT with retain flag

    p.kaczmarek2 wrote:
    Some progress update: HA autodiscovery and auto page refreshing is on the way!

    Excited :D

    I have around 10 plugs (CB2S + BL0937) and 3 of them have strange issue.
    1 of them has random reboots, "Build on Aug 26 2022 06:28:51 version 1.12.42"
    all flags in cfg_generic are disabled
    Any steps to troubleshoot this issue? anything to look in the logs

    2 of them get disconnected from the network, not able to ping, only option is to toggle the circuit breaker, looks like similar problem reported by @Ari2, One device is upgraded to "Build on Sep 1 2022 06:04:47 version 1.12.44" and all flags in cfg_generic are disabled, uptime 1 day, no disconnects yet. The second device is still on "Build on Aug 26 2022 06:28:51 version 1.12.42".
    This is under observation
  • p.kaczmarek2
    Moderator Smart Home
    Huh, you both guys have the same CB2S issue. This is very strange. It worked before on CB2S well, both for me and for Jennifer (she did the Qiachip Fan CB2S article).

    @marioalmeida @blakadder I would ask you to try two things.
    1. as said in post #909 , https://www.elektroda.com/rtvforum/viewtopic.php?p=20174686#20174686 , try flashing that full 2MB bin that clears the config partitions that are internal to BK7231N (they come from BK7231 SDK, not from Tuya, but Tuya updated the SDK version they use)
    2. you can try using earlier OpenBeken version, just to make sure the issue is not caused by something else

    If you are unable to flash the 2MB bin, because you don't have the wires attached, you can wait for me to add this "nuke config partition" button (which will clear the internal BK partitions and stuff, not the OpenBeken one)

    I will try my best to help you, but remember, I am just one person and any testing/investigation help is welcome.
  • marioalmeida
    Level 10  
    p.kaczmarek2 wrote:
    Huh, you both guys have the same CB2S issue. This is very strange. It worked before on CB2S well, both for me and for Jennifer (she did the Qiachip Fan CB2S article).

    @marioalmeida @blakadder I would ask you to try two things.
    1. as said in post #909 , https://www.elektroda.com/rtvforum/viewtopic.php?p=20174686#20174686 , try flashing that full 2MB bin that clears the config partitions that are internal to BK7231N (they come from BK7231 SDK, not from Tuya, but Tuya updated the SDK version they use)

    Since its a bin file, I'll have to pry open, which is difficult as I have glued backed the plugs
    p.kaczmarek2 wrote:
    2. you can try using earlier OpenBeken version, just to make sure the issue is not caused by something else

    You mean any version before 1.12.44?
    p.kaczmarek2 wrote:
    If you are unable to flash the 2MB bin, because you don't have the wires attached, you can wait for me to add this "nuke config partition" button (which will clear the internal BK partitions and stuff, not the OpenBeken one)

    This seems to be a better option for me
    p.kaczmarek2 wrote:
    I will try my best to help you, but remember, I am just one person and any testing/investigation help is welcome.

    Definitely I can help in testing.
  • gamerayers
    Level 4  
    Hi All,
    After not being able to flash with direct wiring, I decided to take a chance and use Tuya Cloud Cutter. It worked great.
    I have a Tuya SL10 flashed with 1.12.34. Its a WB8P. RGB-CCT bulb. So it is a BK7231T.
    I have tried to get the CCT working, but so far, both dim and color temp work as dimmers.
    To old version of the bulb used: {"NAME":"Treatlife RGBW","GPIO":[0,0,0,0,38,37,0,0,41,39,40,0,0],"FLAG":0,"BASE":18} Template.
    I currently have the new version set as P7 - PWM1, P8-PWM2, P9-PWM3, P24-PWM4, P26 - PWM5, pin 23 is ADC, but not sure how that relates.
    I can deal with no color temp, but it would be nice to figure out.

    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    The issue is the MQTT setup. The below is COMPLETELY incorrect since it sets each as its own bulb. And even that doesn't work.
    I am a little lost in how to get this to configure properly for Home Assistant. Any help would be great. I have 8 of these bulbs and they have been collecting dust for about 18 months now since I have no use for Tuya.
    mqtt:
      light:
      - unique_id: "SmartBulb1 1"
        name: "SmartBulb1 1"
        state_topic: "SmartBulb1/1/get"
        command_topic: "SmartBulb1/1/set"
        brightness_command_topic: "SmartBulb1/1/set"
        on_command_type: "brightness"
        brightness_scale: 99
        qos: 1
        payload_on: 99
        payload_off: 0
        retain: true
        optimistic: true
        availability:
          - topic: "SmartBulb1/connected"
      - unique_id: "SmartBulb1 2"
        name: "SmartBulb1 2"
        state_topic: "SmartBulb1/2/get"
        command_topic: "SmartBulb1/2/set"
        brightness_command_topic: "SmartBulb1/2/set"
        on_command_type: "brightness"
        brightness_scale: 99
        qos: 1
        payload_on: 99
        payload_off: 0
        retain: true
        optimistic: true
        availability:
          - topic: "SmartBulb1/connected"
      - unique_id: "SmartBulb1 3"
        name: "SmartBulb1 3"
        state_topic: "SmartBulb1/3/get"
        command_topic: "SmartBulb1/3/set"
        brightness_command_topic: "SmartBulb1/3/set"
        on_command_type: "brightness"
        brightness_scale: 99
        qos: 1
        payload_on: 99
        payload_off: 0
        retain: true
        optimistic: true
        availability:
          - topic: "SmartBulb1/connected"
      - unique_id: "SmartBulb1 4"
        name: "SmartBulb1 4"
        state_topic: "SmartBulb1/4/get"
        command_topic: "SmartBulb1/4/set"
        brightness_command_topic: "SmartBulb1/4/set"
        on_command_type: "brightness"
        brightness_scale: 99
        qos: 1
        payload_on: 99
        payload_off: 0
        retain: true
        optimistic: true
        availability:
          - topic: "SmartBulb1/connected"
      - unique_id: "SmartBulb1 5"
        name: "SmartBulb1 5"
        state_topic: "SmartBulb1/5/get"
        command_topic: "SmartBulb1/5/set"
        brightness_command_topic: "SmartBulb1/5/set"
        on_command_type: "brightness"
        brightness_scale: 99
        qos: 1
        payload_on: 99
        payload_off: 0
        retain: true
        optimistic: true
        availability:
          - topic: "SmartBulb1/connected"
    
  • p.kaczmarek2
    Moderator Smart Home
    Hey @gamerayers , you are correct, this Yaml is a placeholder used for testing. At the current state of things, you should follow my tutorial and configure correctly bulb manually, here:
    LED WiFi RGBCW Tuya - teardown, BK7231N, programming with my Tasmota replacement
    The last version of Yaml, is in post #9, here:
    https://www.elektroda.com/rtvforum/viewtopic.php?p=20044837#20044837
    Here is a copy of that:
    p.kaczmarek2 wrote:
    IMPORTANT UPDATE
    I have updated led driver to broadcast received values by MQTT. My current configuration yaml:
    Code: yaml
    Log in, to see the code

    I have added support for rgb_state_topic with rgb_value_template, same for brightness_state_topic and color_temp_state_topic.

    You can also wait for Autodiscovery to be implemented, it's currently being worked on by Iprak. He will make OpenBeken devices discoverable by Home Assistant.

    PS: The config above might be in old HA version. To make it work with new version, I think you need to add unique_id field. It's easy.

    BTW:
    Quote:

    To old version of the bulb used: {"NAME":"Treatlife RGBW","GPIO":[0,0,0,0,38,37,0,0,41,39,40,0,0],"FLAG":0,"BASE":18} Template.

    Are you saying that old version was using ESP8266 module?
  • marioalmeida
    Level 10  
    @gamerayers , this is my setup FYR.
    Code: yaml
    Log in, to see the code


    Added after 14 [minutes]:

    p.kaczmarek2 wrote:
    1. as said in post #909 , https://www.elektroda.com/rtvforum/viewtopic.php?p=20174686#20174686 , try flashing that full 2MB bin that clears the config partitions that are internal to BK7231N (they come from BK7231 SDK, not from Tuya, but Tuya updated the SDK version they use)

    I tried re-flashing the 2MB file mentioned in post #101 https://www.elektroda.com/rtvforum/viewtopic.php?p=20148513#20148513 "bin file bk7231s_dump-2022- 8-16-23-31-23.bin", I am not sure if this is the correct version since there is no T/N mentioned, no luck.
    Then I tried with bin file "FullFW.bin" mentioned in post #98 https://www.elektroda.com/rtvforum/viewtopic.php?p=20148513#20148513 again with no luck. Finally I swapped the module CB2S with WB2S, no issue as of now, under observation.
  • p.kaczmarek2
    Moderator Smart Home
    @marioalmeida CB2S is BK7231N and the 2MB from that post is for CB2S.
    What do you mean by "no luck"?
    a) boot loop at start?
    b) crash after obk startup?
    c) crash after running obk for several minutes?
    Anything else?

    Btw, I am not sure if I mentioned it here, but the online devices database is up and running:
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
  • gamerayers
    Level 4  
    Thanks p.kaczmarek2 and marioalmeida.
    That is somewhat better. Seems there is some oddity in these lights. While they are RGB-CCT, they don't appear to have enough I/O to make it CCT. Looking through this, I can get PWM1, 2, 3, and 4 (output P24) working. but P26 isn't connect on the mainboard. There is a pin for ADC, but I also don't believe it is really connected either. I wonder if they are doing something weird with CCT that the PIN 24 is a warm white LED and then they use the RGB to get cool white. That is almost what it appears like.
    The previous iteration of this bulb was an ESP chip, but they replaced them at some point and the entire board is different now. The new iteration is a WB8P chip.

    I've had some weird issues with the MQTT still, and it may be because of the weird PMW setup. If I go to change brightness, while on warm white, the bulb turns blue and the brightness goes to 10% in home assistant. Just weird. I almost want it to simply be able to change RGBW brightnesses and then it would be perfect. But if I disable the Color temp, it seems to not allow for an easily selectable Warm White. So I am stuck with that.

    FYI, I now have 7 SL10 bulbs flashed using Tuya CloudCutter and the custom firmware. It worked great. I also have 1 SL20 which is a simple CCT bulb. It flashed the same way and has the same chip inside.

    Great work so far.
  • marioalmeida
    Level 10  
    p.kaczmarek2 wrote:
    What do you mean by "no luck"?
    a) boot loop at start?
    b) crash after obk startup?
    c) crash after running obk for several minutes?
    Anything else?

    its the same issue of freezing, need to toggle the circuit breaker.

    Added after 4 [minutes]:

    gamerayers wrote:
    If I go to change brightness, while on warm white, the bulb turns blue and the brightness goes to 10% in home assistant

    What is your color mapping?
    This is mine
    // BLUE
    setPinRole 26 PWM
    setPinChannel 26 3
    
    // GREEN
    setPinRole 24 PWM
    setPinChannel 24 2
    
    // WARM WHITE
    setPinRole 6 PWM
    setPinChannel 6 5
    
    // COLD WHITE
    setPinRole 8 PWM
    setPinChannel 8 4
    
    // RED
    setPinRole 9 PWM
    setPinChannel 9 1
  • p.kaczmarek2
    Moderator Smart Home
    @marioalmeida and you flashed whole 2MB? Well, this is strange. It has fixed the problem for that user.

    It seems like a strange CB2S-related issue. I have tried checking BK7231N SDK that we are using to find potential issues, but no luck right now. The solution must be somewhere there, because it's N-related problem, and theoretically one could compare file by file both SDKs and see what's the change.
  • marioalmeida
    Level 10  
    I'll try to swap the problematic module to some other plug, do you recommend to try with "FullFW.bin" firmware once again or do you have any other 2MB firmware with you?
  • ferbulous
    Level 15  
    @p.kaczmarek2
    Hi, so I'm testing the device group again but it's not working for me
    Added group 'nightlamp' which is the group for for my 4 tasmota bulbs & 1 tasmota switch.
    But turning off the tasmota/bulbs does not toggle the relays for the openbk device and vice versa.
    I don't see anything much in the logs though
  • p.kaczmarek2
    Moderator Smart Home
    @ferbulous I am leaving today for half a day, but when I come back, I will try to look into it.
    Can you show configurations for all devices?

    Can you try sending a DGR update by hand through console in order to check if packets sending work?

    
    DGR_SendBrightness roomLEDstrips 128
    DGR_SendPower testSocket 1 1
    

    I can guide you step by step through the configuration and debugging but I need more information.


    PS: my daily usage DGR config that works: (two white LED strips)
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
  • ferbulous
    Level 15  
    @p.kaczmarek2
    Here are the settings

    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    For the bedroomswitch,i use devgrouptie and assign the 3rd button for the group
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    How do I modify this command line for my device?
    DGR_SendBrightness roomLEDstrips 128
    DGR_SendPower testSocket 1 1
  • p.kaczmarek2
    Moderator Smart Home
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    This will send power state 0 for nightLamp assuming that nightlamp has 1 relays
    DGR_SendPower nightLamp 0 1

    This will send power state 1 for nightLamp assuming that nightlamp has 1 relays
    DGR_SendPower nightLamp 1 1

    If you have multiple relays, for example 4, you do something like:
    DGR_SendPower nightLamp 7 4

    This will send for nightlamp 4 relay states (4 is a number of relays) with power states encoded as binary 7, 7 is a binary 1 + 2 + 4 , it's 0b0111, so first 3 relays will be ON and fourth OFF
  • ferbulous
    Level 15  
    @p.kaczmarek2
    Testing on N device (moes 4 gang module), updated to latest (.50)
    Issues so far
    1) The device stopped responding after some time( can't get to the web ui)
    2) When it's online, i can get the relay on/off status but can't control it from homeassistant. I was able to toggle it on/off earlier, this was also on previous firmware .48
    3) Toggling on relay from openbk turns off the nightlamp group devices (invert?). Toggling off relay from openbk doesn't do anything. Toggling the tasmota devices doesn't toggle the openbkt.

    Some of the logs when i toggled on openbk relay
    Info:DGR:Received 31 bytes from 192.168.1.42
    
    Info:DGR:DGR_Parse: [192.168.1.42] seq 1024, flags 0
    
    Info:DGR:Next section - 128
    
    Info:GEN:No change in channel 0 (still set to 0) - ignoring
    
    
    Info:GEN:No change in channel 1 (still set to 0) - ignoring
    
    
    Info:GEN:No change in channel 2 (still set to 0) - ignoring
    
    
    Info:GEN:No change in channel 3 (still set to 1) - ignoring
    
    
    Info:GEN:No change in channel 4 (still set to 0) - ignoring
    
    
    Info:DGR:Power event - values 8, numChannels 5, chans=
    Info:DGR:[OFF]
    Info:DGR:[OFF]
    Info:DGR:[OFF]
    Info:DGR:[ON]
    Info:DGR:[OFF]
    Info:DGR:
    
    Info:DGR:Next section - 0
    
    Info:DGR:Received 25 bytes from 192.168.1.158
    
    Info:DGR:Received 25 bytes from 192.168.1.198
    
    Info:DGR:Received 25 bytes from 192.168.1.199
    
    Info:DGR:Received 25 bytes from 192.168.1.15
    
    Info:DGR:Received 25 bytes from 192.168.1.53
    
    Debug:HTTP:TCP will process packet of len 314
    
    Debug:HTTP:TCP will process packet of len 306


    As for DGR command line this is what I'm getting
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [DGT_SendPower nightLamp 1 1]
    Error:CMD:cmd DGT_SendPower NOT found (args nightLamp 1 1)
    
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [DGT_SendPower nightLamp 0 1]
    Error:CMD:cmd DGT_SendPower NOT found (args nightLamp 0 1)
    
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [DGT_SendPower nightLamp 7 4]
    Error:CMD:cmd DGT_SendPower NOT found (args nightLamp 7 4)




  • p.kaczmarek2
    Moderator Smart Home
    It seems there are multiple problems to solve. We will try one by one.

    ferbulous wrote:

    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [DGT_SendPower nightLamp 1 1]
    Error:CMD:cmd DGT_SendPower NOT found (args nightLamp 1 1)
    

    You have a typo in command name - DGT instead of DGR


    ferbulous wrote:

    Info:DGR:Received 25 bytes from 192.168.1.158

    Info:DGR:Received 25 bytes from 192.168.1.198

    Info:DGR:Received 25 bytes from 192.168.1.199

    Info:DGR:Received 25 bytes from 192.168.1.15

    Info:DGR:Received 25 bytes from 192.168.1.53

    If you say "toggling Tasmota don't toggle Beken", I need to know, if the Tasmota IP is on this list?
    Or to phrase it differently - are Tasmota packets seen by Beken?

    Question: do you Beken relay indices start with 1 or with 0? Code expects them to start with 0.

    ferbulous wrote:

    3) Toggling on relay from openbk turns off the nightlamp group devices (invert?). Toggling off relay from openbk doesn't do anything.

    Unless it's a byproduct by some other book, then you can use Relay_n pin types in OpenBeken to mitigate it.

    If issues persists, I will try to setup myself a 4 relays scenario and check this on my own.


    EDIT: What exactly are you trying to do? Do I understand correctly - you have 3 separate lamps and a single 4 button device and want to control 3 separate lamps by single device? I'd need to get in-depth explanation.
  • ferbulous
    Level 15  
    @p.kaczmarek2

    This is the output
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [DGR_SendPower nightLamp 7 4]
    Debug:HTTP:TCP will process packet of len 306
    
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [DGR_SendPower nightLamp 1 1]
    Info:DGR:Received 31 bytes from 192.168.1.42
    
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [DGR_SendPower nightLamp 0 1]
    Info:DGR:Received 31 bytes from 192.168.1.42


    p.kaczmarek2 wrote:
    Or to phrase it differently - are Tasmota packets seen by Beken?

    Looking at the logs from one of the device in the groups, beken device is listed (192.168.1.42)
    20:26:55.520 CMD: devgroupstatus
    20:26:55.528 MQT: stat/master_bedroom_3g/RESULT = {"DevGroupStatus":{"Index":0,"GroupName":"nightlamp","MessageSeq":112,"MemberCount":5,"Members":[{"IPAddress":"192.168.1.199","ResendCount":18,"LastRcvdSeq":138,"LastAckedSeq":112},{"IPAddress":"192.168.1.15","ResendCount":21,"LastRcvdSeq":117,"LastAckedSeq":112},{"IPAddress":"192.168.1.53","ResendCount":22,"LastRcvdSeq":122,"LastAckedSeq":112},{"IPAddress":"192.168.1.158","ResendCount":128,"LastRcvdSeq":2,"LastAckedSeq":112},{"IPAddress":"192.168.1.42","ResendCount":0,"LastRcvdSeq":12,"LastAckedSeq":112}]}}


    p.kaczmarek2 wrote:
    Unless it's a byproduct by some other book, then you can use Relay_n pin types in OpenBeken to mitigate it.

    Just modified to relay_n, but looks like it's the same issue like previously mentioned

    p.kaczmarek2 wrote:
    Question: do you Beken relay indices start with 1 or with 0? Code expects them to start with 0.

    How can I check for this?

    p.kaczmarek2 wrote:
    What exactly are you trying to do? Do I understand correctly - you have 3 separate lamps and a single 4 button device and want to control 3 separate lamps by single device? I'd need to get in-depth explanation.

    I have an ikea solhetta lamp that holds 4 gu10 bulbs in a row for my night lamp
    The single 4 button device is added to the group merely for testing purposes. I wanted to try if I could only assign 1 button/relay to the group so it doesn't toggle all the relays like with tasmota's devgrouptie.
    I will try with another 1 gang N device to test with this group
  • p.kaczmarek2
    Moderator Smart Home
    ferbulous wrote:

    I have an ikea solhetta lamp that holds 4 gu10 bulbs in a row for my night lamp
    The single 4 button device is added to the group merely for testing purposes. I wanted to try if I could only assign 1 button/relay to the group so it doesn't toggle all the relays like with tasmota's devgrouptie.
    I will try with another 1 gang N device to test with this group

    OK OK, wait a minute, I think I suspect where one issue might be.

    I haven't used devgrouptie, but now I'd worry that OpenBeken sends a packet with numRelays = 4 and binary (4 bits) mask for relays to all lamps and devgrouptie acts like each group is a separate group of relays with numRelays = 1 and binary (1 bit) mask.

    If that's the case, then it won't work now with this approach.

    The correct approach for you could be scripting "onChange" listener and doing DevGroupSend...

    but maybe let's check this first.

    Can you show pins configuration of each Tasmota bulb?
    I mean this:
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    And to phrase question differently: do you always have "1" on each bulb selected, or does bulb 1 has 1, bulb 2 has 2, bulb 3 has 3?