Elektroda.com
Elektroda.com
X
Elektroda.com

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

p.kaczmarek2 52443 945
This content has been translated flag-pl » flag-en View the original version here.
  • ferbulous
    Level 11  
    p.kaczmarek2 wrote:
    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.


    Just making sure we're on the same page here
    I wanted to add 1 button and exclude the other 3 buttons to the device group on the openbk switch, not sure if this is supported yet

    My current setup:
    3gang bedroom switch (relay 1-ceiling lights, relay 2-fan , relay 3- night lamp)
    The relay (pin 14) for the night lamp is set to output high so the tasmota bulbs stays online all the time. pin 15 is set as fake relay 3, otherwise pressing button 3 would toggle relay 1.



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

    I enabled setoption88 and devgrouptie'd the 3rd button to devgroup1name1: nightlamp, otherwise it would trigger all relays
    Quote:
    (SetOption88 1). When option 88 is enabled, the DevGroupTie sets which relay each device group is tied to. Each device group can only be tied to a single relay


    Code:
    05:54:58.380 CMD: devgroupname
    
    05:54:58.387 MQT: stat/master_bedroom_3g/RESULT = {"DevGroupName1":"nightlamp","DevGroupName2":"","DevGroupName3":"","DevGroupName4":""}
    05:55:02.547 CMD: devgrouptie
    05:55:02.554 MQT: stat/master_bedroom_3g/RESULT = {"DevGroupTie1":3,"DevGroupTie2":2,"DevGroupTie3":3,"DevGroupTie4":4}


    Here's the template for gu10 bulbs (same with other 3 bulbs)
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    p.kaczmarek2 wrote:
    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?

    I'm not sure how to check on this
  • p.kaczmarek2
    Level 27  
    ferbulous wrote:

    Here's the template for gu10 bulbs (same with other 3 bulbs)
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant

    p.kaczmarek2 wrote:
    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?

    I'm not sure how to check on this

    Thanks, I think now I understand. I thought that you control each bulb with each relay, but I was wrong.
    Ok, can you show Tasmota configuration for remaining devices? Fan and nightlamp?

    Btw, the RGBCW Youtube tutorial for OpenBeken is now released, so far version with english subtitles and pl audio, the fully translated version is coming soon:


    Dodano po 7 [minuty]:

    so it basically means that only relay 3 applies "nightlamp" group and other are not in DGR groups?

    ferbulous wrote:

    Just making sure we're on the same page here
    I wanted to add 1 button and exclude the other 3 buttons to the device group on the openbk switch, not sure if this is supported

    Code:
    05:54:58.380 CMD: devgroupname
    
    05:54:58.387 MQT: stat/master_bedroom_3g/RESULT = {"DevGroupName1":"nightlamp","DevGroupName2":"","DevGroupName3":"","DevGroupName4":""}
    05:55:02.547 CMD: devgrouptie
    05:55:02.554 MQT: stat/master_bedroom_3g/RESULT = {"DevGroupTie1":3,"DevGroupTie2":2,"DevGroupTie3":3,"DevGroupTie4":4}


    It seems that I now fully understand....
    You want to tie relay 3 to device groups "DevGroupName1" called "nightlamp", so changing relay 3 sends the POWER on/off to all 4 bulbs in that group?

    basically I need to add a "DevGroupTie" support for you, I can do that, but you'd need to test.

    Second option:
    1. disable all automatic device groups on beken (disable all "send"/"receive" flags, clear the group name in settings in WWW panel, etc)
    2. do:
    Code:

    addChangeHandler Channel3 != 0 DGR_SendPower "nightlamp" 1 1
    addChangeHandler Channel3 == 0 DGR_SendPower "nightlamp" 0 1

    adjust "Channel3" to the Channel number you have tied to button/relay
    This might work, but it obviously won't receive feedback and won't sync back like DGR
  • ferbulous
    Level 11  
    p.kaczmarek2 wrote:
    You want to tie relay 3 to device groups "DevGroupName1" called "nightlamp", so changing relay 3 sends the POWER on/off to all 4 bulbs in that group?


    Correct, a devgrouptie feature for openbk

    p.kaczmarek2 wrote:
    addChangeHandler Channel3 != 0 DGR_SendPower "nightlamp" 1 1
    addChangeHandler Channel3 == 0 DGR_SendPower "nightlamp" 0 1


    Code:
    Debug:API:POST to api/cmnd
    
    Debug:CMD:cmd [addChangeHandler Channel3 != 0 DGR_SendPower "nightlamp" 1 1]
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [addChangeHandler Channel3 == 0 DGR_SendPower "nightlamp" 0 1]
    Info:EVENT:CMD_AddChangeHandler: added Channel3 with cmd DGR_SendPower "nightlamp" 0 1


    Disabled device group(removed name) and added the command above,
    But changing the relay/toggle push button from openbkt doesn't change the nightlamp device relays

    I also added the command for another N device (1 gang) but also nothing changes to the group
    p.kaczmarek2 wrote:
    addChangeHandler Channel1 != 0 DGR_SendPower "nightlamp" 1 1
    addChangeHandler Channel1 == 0 DGR_SendPower "nightlamp" 0 1


    On further testing
    Device group enabled - Only get status relay, but I can't change it and the device is unresponsive after a few minutes. I'll try hooking up to tx2 to get the log output when that happens again.
    Device group disabled - Working nicely, I can get relay status and change it from homeassistant and device stays online.

  • p.kaczmarek2
    Level 27  
    ferbulous wrote:

    Correct, a devgrouptie feature for openbk

    Now everything is clear. I will add this to my TODO list, maybe try to do this in following days if lucky, but right now I am adding DDP for lighting.


    ferbulous wrote:

    I also added the command for another N device (1 gang) but also nothing changes to the group

    Is the problem with DGR_Send or with change callback?
    Try:
    Code:

    DGR_SendPower "nightlamp" 0 1
    DGR_SendPower "nightlamp" 1 1

    in console.
    Also, just to make sure, you do that with DGR driver enabled? If not, do "startDriver DGR" first, obviously...
    Those commands are not registered unless driver is started (automatically or not)
  • ferbulous
    Level 11  
    p.kaczmarek2 wrote:
    Now everything is clear. I will add this to my TODO list, maybe try to do this in following days if lucky, but right now I am adding DDP for lighting.

    Thanks for that! Much appreciated

    p.kaczmarek2 wrote:
    Also, just to make sure, you do that with DGR driver enabled? If not, do "startDriver DGR" first, obviously...
    Those commands are not registered unless driver is started (automatically or not)

    It looks like it's already activated in the logs

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

    Not related to device group, but since the openbkt tutorial involves an E14 led teardown
    Do you have any advice how I should proceed to teardown this GU10 bulb safely?
    The cables inside is too short to pull out the pcb, I believe the chip inside is a BL602

    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
  • marioalmeida
    Level 9  
    marioalmeida wrote:
    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?


    @p.kaczmarek2 Some update.
    I re-flashed the FullFW.bin once again on two of the plugs BK7231N, this time looks good, the device is up and running for 4+hrs, usually it would freeze within first 30minutes. I still have random network disconnect but this time it will join back to the network in few seconds.

    Code: text
    Log in, to see the code
  • p.kaczmarek2
    Level 27  
    ferbulous wrote:

    Not related to device group, but since the openbkt tutorial involves an E14 led teardown
    Do you have any advice how I should proceed to teardown this GU10 bulb safely?
    The cables inside is too short to pull out the pcb, I believe the chip inside is a BL602

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

    I don't have that kind of socket at home, but I already did a teardown of such bulb about twice for research purposes.
    As far as I remember, it should be possible to take out the "legs" of the bulb, they are attached on long goldpins.
    https://www.elektroda.pl/rtvforum/topic3896404.html
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    It's tricky to do that, I have already failed once and the gold pin broke off instead of coming out of the "leg"

    I will try to add more debugging tools soon to investigate the rare N platform issue
  • ferbulous
    Level 11  
    p.kaczmarek2 wrote:
    It's tricky to do that, I have already failed once and the gold pin broke off instead of coming out of the "leg"


    What was your method to successfully remove them?
    Do I pull right away or a twist and pull? Once removed, can you assemble them again or some adhesive requires for the bottom pins?
  • p.kaczmarek2
    Level 27  
    As you can see, the goldpins are in square shape, so no twisting, just pulling.
    I think you should be to put them back on together later.
    Still, it worked only for one of my bulbs. In the case of second one, the gold pin broke:
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
  • ferbulous
    Level 11  
    p.kaczmarek2 wrote:
    Still, it worked only for one of my bulbs. In the case of second one, the gold pin broke:


    Thanks, i noticed that gold pin in the center, which tool did you use for this?
    My pliers just can't get a grip on the legs
  • the_ccm
    Level 1  
    Hello, I'm really new on this subject and just flashed a Tuya device ATMS1601

    there's a push button on P7, so I did in config :
    btn 2 1 => on channel 2 and will toggle channel 1 right ?

    EDIT : didn't look well on the PCB, it was P6, so now when I push button relay is changing state.

    there's is a relay on P24, so I did :
    rel 1

    I setup MQTT, and I can change the relay state by issuing :
    mosquitto_pub -t obk8D4419BF/1/set -m 1
    or
    mosquitto_pub -t obk8D4419BF/1/set -m 0
    => this is working

    so here are my questions :

    1) I would like to read the relay state, but the device does not send any MQTT message ?
    I did :
    mosquitto_pub -t obk8D4419BF/1/get -m 0

    but no response ?


    thanks in advance,
  • ferbulous
    Level 11  
    I use a different plier this time, as i was pulling the leg i noticed cracks on the bottom base.

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

    Seems like the bottom protuded metal that connects to the leg pins are dragging the base as i was pulling it. Making this job a lot more difficult than it should

    [BK7231T] My HTTP server, configurator, MQTT support from Home Assistant
  • marioalmeida
    Level 9  
    the_ccm wrote:
    mosquitto_pub -t obk8D4419BF/1/get -m 0


    For get command, you need to subscribe instead of publish
  • brianandrus
    Level 2  
    I recently found they updated the circuit board inside the FEIT wifi dimmer switch to one that looks easier to get at and uses the BK7231TQN32 chip.

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

    Unfortunately, I am running into issues getting it to flash. I have been able to connect to RX2/TX2 and see the logs, and I can reset by grounding CEN. However, Beken Writer fails every time I try to read/write to it.

    I'm guessing I am overlooking something simple. Are there any steps beyond connecting the HW-597 and flashing? I'm starting to wonder if the pinouts on the board are not quite true to their labels.
  • omelchuk890
    Level 4  
    brianandrus wrote:
    Unfortunately, I am running into issues getting it to flash. I have been able to connect to RX2/TX2 and see the logs, and I can reset by grounding CEN. However, Beken Writer fails every time I try to read/write to it.

    https://www.elektroda.com/rtvforum/topic3875654.html
    Quote:
    From the bottom, we have prepared pads for programming signals, including:
    - UART1 port (programming via bootloader)
    - UART2 port (debug log output with information about what the device is doing)
    - SPI pins (programming if bootloader fails)
    - CEN pin (system reset)