Elektroda.com
Elektroda.com
X

Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota

p.kaczmarek2 6303 56
This content has been translated flag-pl » flag-en View the original version here.
  • Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    Hello, I'll show you how to make simple connections and automations between devices with Tasmota and OpenBeken (BK7231T / BK7231N / XR809 / T34 / BL602 / W600 / W601 / W800 / W801).
    Tasmota Device Groups, also known as DGR, is a protocol for connecting IoT devices to Tasmota's software into groups without the use of an external server - communication takes place directly between devices via multicast / broadcast UDP. DGR allows not only to combine devices into mentioned groups; it also allows you to control groups of, for example, LED lamps from the single switch (this allows you to eliminate the known problem called "switching off the switch from the chandelier cuts off the power and WiFi light bulb, so that they cannot be separately controlled from HA"), but more on that later.
    Here I will show two simple examples (in several versions).
    DGR assumes that the devices are in single LAN.

    (the title gif shows the operation of DGR in action; there are two 'smart plugs'; the user switches the state of one, orange here, and the other follows - it also turns off and switches)

    Device Groups documentation from Tasmota
    Device Groups primarily requires a group name - the group name is textual, such as "mySockets1".
    In addition, each device is set with flags that define what that device will transmit (when the state changes) and what it will receive (when the state of another device in the group changes).
    For example, we can do so that one switch transmits its power state, and others only receive this state. We can also both transmit and receive the power state.
    The same logic applies to LED color, brightness and temperature - with both send and receive options configurable.
    On Tasmota, DGR is activated by the command:
    
    SetOption85 1
    

    On Tasmota, the group name is set by the command:
    
    DevGroupName testSocket
    

    On Tasmota, the sending and receiving flags are determined by the command:
    
    DevGroupShare 1,1
    

    Flag values:
    Flag Role
    1 Power
    2 Light brightness
    4 Light fade / speed
    8 Light scheme
    16 Light color
    32 Dimmer settings (presets)
    64 Event

    Flags are bit flags, i.e. we combine them by adding, e.g. flag 1 and 2 together give 3.
    You will find everything here:
    https://tasmota.github.io/docs/Device-Groups/#operation
    In OBK, however, everything is on the GUI - no commands for beginners .

    Example 1 - Smart Sockets - BW-SHP6 (ESP8266 - Tasmota) and Mycket PE01-E (BK7231N)
    We have two sockets, one on ESP8266 and one on Beken:
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    We will now configure these two sockets so that the state change of one reflects the state of the other.
    We want to share the POWER state - flag 1.
    The group name will be "testSocket".
    Tasmota configuration - command to be executed:
    
    BackLog SetOption85 1; DevGroupName testSocket; DevGroupShare 1,1
    

    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    OpenBeken configuration - we only need to click in the GUI (Options-> Configure Device Groups):
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    In fact, that's it - from now on, any change in the state of one device will result in a change in the state of the other device (both the MQTT and the button on the housing, as well as clicking on the WWW panel).
    Demonstration:
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota

    Example 2 - single color LED strips - one on ESP8266, the other on WB3S
    Here are the heroes of this demonstration:
    - WiFi SmartLife single-color LED strip dimmer - test, teardown, diagram
    - WiFi LED strip dimmer 5V-28V - teardown, Tasmota, Home Assistant
    The configuration is similar to the previous one, but this time in DevGroupShare we also attach the strip brightness flag.
    Here is the Tasmota configuration:
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    And this is the OpenBeken configuration:
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    Results: both strips are changing their states together, both power and brightness.


    DGR scripting
    In OpenBeken we have script commands that allow you to operate "from the outside" on Tasmota Device Groups. They only require the initial, one-time start of DGR via "startDriver DGR" in the console.
    The command to change the brightness:
    
    DGR_SendBrightness stringGroupName integerBrightness
    

    Command to change the power state:
    
    DGR_SendPower stringGroupName integerChannelValues integerChannelsCount
    

    integerChannelValues is a decimal record of the values of channels (relays), eg for 4 relays where numbers 1 and 3 are turned on we write their states as bit 0101 or decimal 5. Count is the number of relays, here 4, in this example. For LED lamps it is always 1.
    We create longer scripts in OBK by creating the "autoexec.bat" file on the computer and transferring it to the Vue / JS web panel in LittleFS, here:
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    Remember that OTA cleans this sector (quite an unfortunate system, but developed by one of the contributors, motivated by a potential increase in LittleFS sector size for more advanced applications), so you should have a copy of the files or use "save fsblock" to save it and "read" to recover.
    If we type commands into the console but don't pass them to autoexec, the device will forget to execute them after rebooting.

    Example 3 - DGR scripting - control of two stripes with one switch
    Even more can be done with DGR. We will take an unused switch with two buttons:
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    We already know its configuration - the buttons are on pins 8 and 10. Let's write an event for it - these events are per-pin, 8 and 10 are the pin indexes:
    
    startDriver DGR
    addEventHandler OnClick 8 DGR_SendBrightness roomLEDstrips 0
    addEventHandler OnClick 10 DGR_SendBrightness roomLEDstrips 255
    

    From now on, one button turns on all the LEDs, and the other turns them off.
    (Dimmer values are from 0 to 255 in Tasmota)


    Example 4 - DGR scripting - control of two stripes with one switch - v2
    Only On / Off is not enough? You can get more.
    We will use channel 4 (which is what I chose at random) as a variable and add a stepwise brightness control.
    
    startDriver DGR
    addEventHandler OnClick 8 backlog setChannel 4 0; DGR_SendBrightness roomLEDstrips $CH4
    addEventHandler OnClick 10 backlog setChannel 4 255; DGR_SendBrightness roomLEDstrips $CH4
    addEventHandler OnHold 8 backlog addChannel 4 10 0 255; DGR_SendBrightness roomLEDstrips $CH4
    addEventHandler OnHold 10 backlog addChannel 4 -10 0 255; DGR_SendBrightness roomLEDstrips $CH4
    

    Now pressing the button gradually decreases / increases the brightness, and clicking it immediately turns off / on the stripes.
    the backlog is needed to be able to execute several commands at once.
    On the other hand addChannel 4 10 0 255 adds a value of 10 to channel 4, while 0 and 255 are the maximum and minimum value of this channel (so-called 'clamp'), values greater than 255 are set to 255 and less than 0 to 0 ...
    But you can go one step further ...


    Example 5 - DGR scripting - control of two stripes with one switch - v3
    The previous example still did not allow you to conveniently control the brightness from the switch GUI. This can also be fixed.
    New script:
    
    startDriver DGR
    setChannelType 4 dimmer256
    addEventHandler OnChannelChange 4 DGR_SendBrightness roomLEDstrips $CH4
    addEventHandler OnClick 8 backlog setChannel 4 0
    addEventHandler OnClick 10 backlog setChannel 4 255
    addEventHandler OnHold 8 backlog and channel 4 10 0 255
    addEventHandler OnHold 10 backlog addChannel 4 -10 0 255
    

    SetChannelType 4 Dimmer256 will make the bar appear:
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    The OnChannelChange event, on the other hand, will cause each change of channel 4 to send its new value to the DGR. Also one with GUI. So we can control all LEDs with one web panel.
    NOTE: If we send a new channel 4 value via MQTT, it will also be transferred to DGR.



    Example 6 - off timer
    This is still a small bonus.
    We will add a timer that turns off the lights after the set time.
    Let's say it will be on channel 5.
    We will set its value with a bar.
    
    setChannelType 5 dimmer256
    addRepeatingEvent 1 -1 addChannel 5 -1 0 10000
    addChangeHandler Channel5 == 0 setChannel 4 0
    

    We add this to the previous configuration.
    From now on, the second bar is the time in seconds - you can also change it to minutes (we change addRepeatingEvent 1 to 60 - an event every 60 seconds instead of one) - after this time the lights turn off.
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    It is a bit lacking to sign what's what - it will be added soon.

    The method with the ghost device
    It is also worth noting that both in Tasmota and in OpenBeken there is also a method of controlling the DGR group through a device - "dummy" / "ghost".
    For example, if we want to control 3 single-color LED strips and we have a two-button switch, we can configure this switch so that OpenBeken "thinks" that it is also an LED strip (set its PWM pin, etc.) and operate on its channels without scripting " DGR_SendBrightness ", while set mu in Options-> Configure Device Groups group and flags.
    It is important to remember that there are two ways - we can either use automatic DGR (the mentioned Options-> Configure Device Groups), or "manually" send packets via scripts (DGR_SendBrightness command etc).

    Summary
    OpenBeken is very easy to connect to Tasmota - even without Home Assistant. In OpenBeken, configuring DGR is even simpler, as the basics are available on the GUI itself, in Options-> Configure Device Groups. More advanced things are also possible through simple event mechanisms. More advanced scripts will also be available soon.
    This was the first part about Tasmota Devices Groups - in the second I will test groups with RGB and RGBCW 'bulbs'.
    NOTE: The functionality is at the testing stage - any bug reports from BK users are welcome!

    Cool? Ranking DIY
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 3935 posts with rating 4792, helped 179 times. Been with us since 2014 year.
  • #2
    speedy9
    Helpful for users
    A very interesting article.
    I keep wondering what to do with my Tuya devices. The most important thing for me is roller blind controllers, which unfortunately are not the best and do not have the option of working with momentary buttons and to close / open the roller blind with a physical button you have to hold it. They can be converted by Tuya convert and configure the appropriate mode of operation, but this involves disconnecting them from the Tuya application, and I do not want to admit, I honestly convert all devices and put my server to service.
  • #3
    ferbulous
    Level 15  
    Hi, thanks for the detailed write up
    I'm testing it again with switches only this time -> 1 gang N device and 3 gang Tasmota device but still not working for me

    Group name : openbk

    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota

    On the 3 gang switch I've enabled all this and additional setoption88 (to tie only relay 1 to 'openbk' group)

    16:23:59.114 CMD: devgroupname
    16:23:59.122 MQT: stat/kitchen_bathroom/RESULT = {"DevGroupName1":"openbk","DevGroupName2":"","DevGroupName3":"","DevGroupName4":""}
    16:24:09.999 CMD: devgroupshare
    16:24:10.001 MQT: stat/kitchen_bathroom/RESULT = {"DevGroupShare":{"In":"1","Out":"FFFFFFFF"}}
    16:24:26.396 MQT: tele/kitchen_bathroom/STATE = {"Time":"2022-10-11T16:24:26","Uptime":"0T00:35:14","UptimeSec":2114,"Heap":25,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"OFF","POWER2":"OFF","POWER3":"OFF","Wifi":{"AP":1,"SSId":"Suliana","BSSId":"F8:E9:03:C9:29:B9","Channel":11,"Mode":"11n","RSSI":80,"Signal":-60,"LinkCount":1,"Downtime":"0T00:00:07"}}
    16:24:26.440 MQT: tele/kitchen_bathroom/SENSOR = {"Time":"2022-10-11T16:24:26","ANALOG":{"CTEnergy":{"Energy":0.085,"Power":99,"Voltage":230,"Current":0.429}}}
    16:24:46.032 CMD: SetOption85
    16:24:46.038 MQT: stat/kitchen_bathroom/RESULT = {"SetOption85":"ON"}
    16:24:46.038 MQT: stat/kitchen_bathroom/RESULT = {"SetOption85":"ON"}
    16:26:07.887 CMD: SetOption88
    16:26:07.893 MQT: stat/kitchen_bathroom/RESULT = {"SetOption88":"ON"}
    16:26:18.414 CMD: devgrouptie
    16:26:18.423 MQT: stat/kitchen_bathroom/RESULT = {"DevGroupTie1":1,"DevGroupTie2":2,"DevGroupTie3":3,"DevGroupTie4":4}
    


    Looking at devgroupstatus, it doesn't list the ip address of the N device

    16:40:29.883 MQT: stat/kitchen_bathroom/RESULT = {"DevGroupStatus":{"Index":0,"GroupName":"openbk","MessageSeq":8,"MemberCount":0,"Members":[]}}


    I've also enabled in DGR in the console but it looks like it's already loaded

    Debug:CMD:cmd [startDriver DGR]
    Info:NTP:Drv DGR is already loaded.


    Or maybe some additional DGR scripting is required for this to work?
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    The relay is pin 8

    Another question, does device group still work for openbk devices only without tasmota devices?
    For example if I want to group a few openbk lights together without creating homeassistant group.
  • #4
    p.kaczmarek2
    Moderator Smart Home
    Hey @ferbulous , first of all, I do not understand your config now - are you trying to use DevGroupTie, which is not supported yet, or just a simple Devices Group?

    Are you able to check if OpenBeken sees any packets in the log?
    Here, anything?
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota

    What happens if you do (to set relay 1 to 1 of device with 1 relays):
    DGR_SendPower openbk 1 1

    or (to set relay 1 to 1 of device with 3 relays, remaining relays to 0):
    DGR_SendPower openbk 1 3

    Is Tasmota reacting to this packet?

    The DGR should work between OBKs.
  • #5
    ferbulous
    Level 15  
    @p.kaczmarek2
    I switched to 1gang tasmota device this time, group: test

    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota

    11:08:03.772 CMD: devgroupname
    11:08:03.778 MQT: stat/1_gang_outside_light_bilik_akeel/RESULT = {"DevGroupName1":"test","DevGroupName2":"","DevGroupName3":"","DevGroupName4":""}
    11:08:09.389 CMD: devgroupstatus
    11:08:09.396 MQT: stat/1_gang_outside_light_bilik_akeel/RESULT = {"DevGroupStatus":{"Index":0,"GroupName":"test","MessageSeq":11,"MemberCount":0,"Members":[]}}
    11:08:17.584 MQT: tele/1_gang_outside_light_bilik_akeel/STATE = {"Time":"2022-10-12T11:08:17","Uptime":"0T00:25:11","UptimeSec":1511,"Heap":24,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER":"ON","Wifi":{"AP":1,"SSId":"Huawei tenet","BSSId":"48:EE:0C:60:26:E8","Channel":8,"Mode":"11n","RSSI":76,"Signal":-62,"LinkCount":1,"Downtime":"0T00:00:05"}}
    11:08:19.098 CMD: devgroupshare
    11:08:19.104 MQT: stat/1_gang_outside_light_bilik_akeel/RESULT = {"DevGroupShare":{"In":"1","Out":"1"}}


    This is the log when I toggled the relay on tasmota switch

    '
    Info:MAIN:Time 1094, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1095, free 80448, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 8/38
    Info:MAIN:Time 1096, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1097, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1098, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1099, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1100, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:GEN:dhcp=0 ip=192.168.2.235 gate=192.168.2.1 mask=255.255.255.0 mac=d8:1f:12:a9:c6:e4 
    Info:MAIN:Time 1101, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1102, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1103, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1104, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1105, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1106, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1107, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1108, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1109, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1110, free 86320, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:GEN:dhcp=0 ip=192.168.2.235 gate=192.168.2.1 mask=255.255.255.0 mac=d8:1f:12:a9:c6:e4 
    Info:MAIN:Time 1111, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1112, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1113, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1114, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    


    Added this command into the console
    DGR_SendPower openbk 1 1


    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [DGR_SendPower openbk 1 1]
    Info:MAIN:Time 1401, free 86520, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1402, free 86520, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1403, free 85240, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1404, free 85240, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38
    Info:MAIN:Time 1405, free 86536, MQTT 1(63), bWifi 1, secondsWithNoPing -1, socks 7/38


    Still not working yet, toggling the relay on openbk or tasmota is not changing the other devices relay.
  • #6
    p.kaczmarek2
    Moderator Smart Home
    This requires more logging.

    Please update to latest version, then type in console: "loglevel 6" so you get "loglevel set 6" in console and try again. On web App, also change log level to highest.
    Then at least try to check if OBK can see any DGR packets.
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    This is the first step, I need to know if your device is AT LEAST able to receive packets.
  • #7
    ferbulous
    Level 15  
    @p.kaczmarek2
    Hi, so it looks like with the T (led bulb) device, paired with tasmota works. Toggling on/off tasmota works with T, but then T becomes inaccessible. I'll keep testing it
  • #8
    p.kaczmarek2
    Moderator Smart Home
    So what was wrong before that it did not work?

    So far only N platform got stability upgrade for LWIP update, there were no reports of problems on T platform so far. Were you using it along with "Broadcast self state every minute" flag?
  • #9
    ferbulous
    Level 15  
    Seems like only N device (switch) that i have is not working for the devicegroup, i’ll put up some log info here later
    I’ll need to test more on T & N device that i have
  • #10
    p.kaczmarek2
    Moderator Smart Home
    @ferbulous [Edited all out] wait, I will get an N device and try

    Edit: Sorry, that's not it. Look:
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    My N device reacts to POWER packet sent by second T device.
  • #11
    ferbulous
    Level 15  
    @p.kaczmarek2
    Hi,did some more testing on a new N device (downlight led) that I just received.

    Device Group Enabled:
    If I enable device group on openbk, toggling relay from tasmota -> openbk works. But not from openbk -> tasmota.
    But with device group enabled, if I publish any mqtt payload (toggle, change colors) the device stopped responding,web ui inaccessible

    Device Group Disabled:
    Publish any mqtt payload (toggle, change colors) just works.
    Also, I'm not quite sure why autodiscovery isn't working this time, I can see openbk device listed when I'm using mqtt-explorer.
    I've also tried adding openbk on fresh new HA installation but it's still the same.

    And sometimes this happens, repeated toggles

    OpenBK Version: 1.13.144



  • #12
    p.kaczmarek2
    Moderator Smart Home
    Can you perform one, specific test and tell me the results?
    It related to:
    ferbulous wrote:

    Device Group Enabled:
    If I enable device group on openbk, toggling relay from tasmota -> openbk works. But not from openbk -> tasmota.

    I would like you to:
    1. create an unique device group with an unique name that is not used anywhere, just on single BK7231N device and single Tasmota device, only share power
    2. reboot both devices (restart)
    3. Then again, check if toggling tasmota->openbk works. Check if also openbk->tasmota works.
  • #13
    ferbulous
    Level 15  
    p.kaczmarek2 wrote:
    Can you perform one, specific test and tell me the results?
    It related to:
    ferbulous wrote:

    Device Group Enabled:
    If I enable device group on openbk, toggling relay from tasmota -> openbk works. But not from openbk -> tasmota.

    I would like you to:
    1. create an unique device group with an unique name that is not used anywhere, just on single BK7231N device and single Tasmota device, only share power
    2. reboot both devices (restart)
    3. Then again, check if toggling tasmota->openbk works. Check if also openbk->tasmota works.


    Hi, openbkt -> tasmota does indeed work when I toggled from the openbk ui
    But togggling on/off from homeassistant that's sending the mqtt payload caused openbk to be unresponsive.



  • #14
    p.kaczmarek2
    Moderator Smart Home
    @ferbulous can you submit an issue on our Github so the person that done N stability improvement (LWIP update) can see it? You could really help us also if you provide some logs. On my side, I am not able to replicate N crashing anymore.
  • #15
    p.kaczmarek2
    Moderator Smart Home
    DGR support has been updated. Multiple fixes has been added by our OpenBK developer @btsimonh , including his strange discovery that some Tasmota devices may send 6 channels for RGBCW lights instead of 5 channels (I have honestly no idea why!). The flickering issue may also have been fixed.

    More updates coming soon.
  • #16
    ferbulous
    Level 15  
    @p.kaczmarek2 @btsimonh thanks for the new updates.
    Everything works, no ‘flickering’ issues but openbk crashing when receiving mqtt payload is still an odd one
  • #18
    ferbulous
    Level 15  
    p.kaczmarek2 wrote:
    Does it crash if you disable DGR?


    No, only when DGR is enabled and after an mqtt payload is sent to openbk device
  • #19
    ferbulous
    Level 15  
    Hi @p.kaczmarek2
    I'm trying to manually send device group command in the tasmota console
    I couldn't get color change command to work (tasmota lights does change but not openbk lights)
    Is there a different command for colors with openbk?


    devgroupsend 5=50 (0 ~ 244 values for brightness)
    devgroupsend 128=@^ (toggle relay)

    Brightness & relay toggle works for both tasmota/openbk


    devgroupsend 7=12 (12 for cold white, 13 for warm white

    Only for tasmota, but not openbk.
    If I manually changed the colors from the tasmota device (from ui or homeassistant dashboard), openbk would change as expected, just not from console command.
  • #20
    p.kaczmarek2
    Moderator Smart Home
    @ferbulous thank you, this is something new that I wasn't even been aware of!
    So it is able to send a fixed color as a single byte?
    From what I see, here the handler I just wrote:
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    I see there is a list:
    Quote:

    Set color to
    1 = red
    2 = green
    3 = blue
    4 = orange
    5 = light green
    6 = light blue
    7 = amber
    8 = cyan
    9 = purple
    10 = yellow
    11 = pink
    12 = white (using RGB channels)
    + = next color
    - = previous color

    I will implement this list later today in OBK... I wasn't aware about that feature.

    EDIT: Is the list I posted correct? There is no value '13'. I got the list from here:
    https://tasmota.github.io/docs/Commands/#commands
  • #21
    ferbulous
    Level 15  
    Thanks @p.kaczmarek2
    I just started playing around the with device group commands.
    I wanted to pick CT values (155 or 500) but i haven’t figure how to do that so i just went with devgroupsend 7 that has fixed colors list.

    Added after 9 [minutes]:

    p.kaczmarek2 wrote:
    EDIT: Is the list I posted correct? There is no value '13'. I got the list from here:
    https://tasmota.github.io/docs/Commands/#commands


    It's not listed there, but it is the color for warm white (500) after checking the tasmota settings.
    If I keep adding more numbers after 13 like 14,15~ it just gives me more random colors. Corrections, it just loops back to previous color list if you add more numbers.
    Seems like for my tasmota (v12, it starts with 0 instead of 1. Maybe you could verify with yours?

    0 15 1 red
    1 16 2 green
    2 17 3 blue
    3 18 4 orange
    4 19 5 light green
    5 20 6 light blue
    6 21 7 amber
    7 22 8 cyan
    8 23 9 purple
    9 24 10 yellow
    10 25 11 pink
    11 26
    12 27 12 white (using RGB channels CT 153)
    13 28 13 warm white (CT 500)
    14 29 CT 250


    On another note, is there web request/http example to change the color temperature/color for openbk?
  • #22
    p.kaczmarek2
    Moderator Smart Home
    @ferbulous thank you for providing the extensive list information. It could be even more helpful if you were able to provide the RGB codes for all the colors, but for now, I will use a standard ones. Would you be able to recheck things after next OBK update?

    ferbulous wrote:

    On another note, is there web request/http example to change the color temperature/color for openbk?

    There is a web request for everything - or should I rather say - for every command possible, because you can execute commands through web requests.
    Example:
    
    http://192.168.0.114/cm?cmnd=led_dimmer%20100
    


    Please also remember that you can also define a command alias (or an alias for a set or command, or for a script execution) and also start it remotely via HTTP.
  • #23
    ferbulous
    Level 15  
    p.kaczmarek2 wrote:
    thank you for providing the extensive list information. It could be even more helpful if you were able to provide the RGB codes for all the colors, but for now, I will use a standard ones. Would you be able to recheck things after next OBK update?


    Hi, this should be the codes:

    --- table updated---

    Color numbers taken from Tasmota wiki Actual Color Numbers TestedRepeating numbers(not required)Colors RGB & CT Codes
    1 0 15 Red "Color":"5100000000","HSBColor":"0,100,32","White":0,"CT":500,"Channel":[32,0,0,0,0]
    2 1 16 Green "Color":"0051000000","HSBColor":"120,100,32","White":0,"CT":500,"Channel":[0,32,0,0,0]
    3 2 17 Blue "Color":"0000510000","HSBColor":"240,100,32","White":0,"CT":500,"Channel":[0,0,32,0,0]
    4 3 18 Orange "Color":"510B000000","HSBColor":"8,100,32","White":0,"CT":500,"Channel":[32,4,0,0,0]
    5 4 19 Light green "Color":"00510B0000","HSBColor":"128,100,32","White":0,"CT":500,"Channel":[0,32,4,0,0]
    6 5 20 Light blue "Color":"000B510000","HSBColor":"232,100,32","White":0,"CT":500,"Channel":[0,4,32,0,0]
    7 6 21 Amber "Color":"511C000000","HSBColor":"20,100,32","White":0,"CT":500,"Channel":[32,11,0,0,0]
    8 7 22 Cyan "Color":"0051310000","HSBColor":"156,100,32","White":0,"CT":500,"Channel":[0,32,19,0,0]
    9 8 23 Purple "Color":"360B510000","HSBColor":"277,87,32","White":0,"CT":500,"Channel":[21,4,32,0,0]
    10 9 24 Yellow "Color":"5151000000","HSBColor":"60,100,32","White":0,"CT":500,"Channel":[32,32,0,0,0]
    11 10 25 Pink "Color":"5100360000","HSBColor":"320,100,32","White":0,"CT":500,"Channel":[32,0,21,0,0]
    N/A 11 26 White-ish? "Color":"5151510000","HSBColor":"0,0,32","White":0,"CT":500,"Channel":[32,32,32,0,0]
    12 12 27 COLD WHITE (CT 153) "Color":"0000005100","HSBColor":"0,0,0","White":32,"CT":153,"Channel":[0,0,0,32,0],
    N/A 13 28 WARM white (CT 500) "Color":"0000000051","HSBColor":"0,0,0","White":32,"CT":500,"Channel":[0,0,0,0,32]
    N/A14 29 CT 327 "Color":"0000002829","HSBColor":"0,0,0","White":32,"CT":327,"Channel":[0,0,0,15,16]
  • #24
    p.kaczmarek2
    Moderator Smart Home
    If 1 is red, and 2 is green and 3 is blue, then what does the index 0 does in new Tasmota?

    I am short on time today, but I added the table to OBK code. Sadly I haven't managed to look at your table at that time, so I will update the OBK code later to match given values directly.
    Here is the table that is in the latest update:
    
    static byte g_color[][3] = {
    	// 0 = idk?
    	{ 125, 0, 255 },
    	// 1 = red
    	{ 255, 0, 0 }, 
    	// 2 = green
    	{ 0, 255, 0 },
    	// 3 = blue
    	{ 0, 0, 255 },
    	// 4 = orange
    	{ 255, 165, 0 },
    	// 5 = light green
    	{ 144, 238, 144 },
    	// 6 = light blue
    	{ 173, 216, 230 },
    	// 7 = amber
    	{ 255, 191, 0 },
    	// 8 = cyan
    	{ 0, 255, 255 },
    	// 9 = purple
    	{ 221, 160, 221 },
    	// 10 = yellow
    	{ 255, 255, 153 },
    	// 11 = pink
    	{ 255, 192, 203 },
    	// 12 = white (using RGB channels CT 153)
    	{ 255, 255, 255 },
    	// 13	= warm white (CT 500)
    #define SPECIAL_INDEX_WARM_WHITE_CT500	13
    	// 14	= CT 250
    #define SPECIAL_INDEX_CT250				14
    
    };
    

    If you have some time, please update one of the devices to latest version and check if it works as expected. I am unable to do this at the moment due to the lack of time. I will look into it more later.

    PS: Futhermore, I have ported OBK to Windows last days. Not sure if I already mentioned that. But soon it will be possible to run OBK on Windows and design scripts, test configs and play around without even having any devices. Great thing for demonstration purposes for new users. Even LittleFS is emulated on Windows now. Device groups also are.
  • #25
    ferbulous
    Level 15  
    p.kaczmarek2 wrote:
    If 1 is red, and 2 is green and 3 is blue, then what does the index 0 does in new Tasmota?

    For my tasmota bulb with an SM2135 LED driver, the color number sequence seems to start with 0 instead of 1, so 0 is red, 1 is green etc
    Then there's color number 11 & 14 with its own RGB values as listed in the table. (i've updated the table with better description)
    I'm not quite sure if bulbs with PWM would be the same since i don't have one yet or maybe the color numbers are not updated

    I do notice some of the listed example in the tasmota page is wrong
    DevGroupSend 4=90 128=1 - send an update to set the light brightness to 90 and turn relay 1 on

    When it should be DevGroupSend 5=90
  • #26
    p.kaczmarek2
    Moderator Smart Home
    Thank you for your continued assistance, @ferbulous
    I have updated the table according to your input, although I haven't managed to test it myself yet:
    https://github.com/openshwprojects/OpenBK7231...mmit/a12b37c07402049728cd461869510001464cb677
    If there are really two standards, it would be also possible to add a flag, something like "[LED] Start color indices at 1 instead of 0" and let users decide, but I don't know if that's needed.
    Is there anything else I may help you with?
    If you can find another feature that is missing, I will also try to add it, sooner or later.
  • #27
    ferbulous
    Level 15  
    p.kaczmarek2 wrote:
    If there are really two standards, it would be also possible to add a flag, something like "[LED] Start color indices at 1 instead of 0" and let users decide, but I don't know if that's needed.


    Thanks for the continuous update! I will update later to test it out
    I don't believe that option is needed yet, l'll try to grab tasmota bulb with only pwm pins and confirm if the start color indeed just starts with 0 or not.
  • #28
    p.kaczmarek2
    Moderator Smart Home
    I have found a source of DGR + RGBCW bulb + MQTT crash scenario, did you experience that one issue, @ferbulous ?
    Quick fix - to test:
    https://github.com/openshwprojects/OpenBK7231T_App/releases/tag/1.15.22
    Flash to only one device for now.
    Better fix will be added later.
  • #29
    ferbulous
    Level 15  
    @p.kaczmarek2
    Thanks, The mqtt crash is now fixed! Great work on patching this issue.
    I’ve also tested devgroupsend 7 and it works to send the colors

    My suggestions for future updates:
    1) DGR_SendColor command
    2) Check box to disable reset on power cycle/brownout similar to tasmota’s SetOption65. I accidently reset my wall switch earlier after i had to flip the breakers when it wasn’t responding.
  • #30
    p.kaczmarek2
    Moderator Smart Home
    That's a good news, but the current fix is not a final one.

    There is already a colour sender:
    Tasmota Device Groups - connection of OpenBeken (BK7231T / BK7231N) with Tasmota
    but I heard some reports that C and W may be swapped, when a Tasmota RGBCW bulb does a DGR transmit to OBK, OBK gets values swapped... is this true, can you check?

    Regarding SetOption65... hmm, there is an option to change default "correct boot" timer from 30 seconds down to given value, wouldn't it be enough? Or do you want to disable the "back to AP" totally?