Elektroda.com
Elektroda.com
X
Elektroda.com

Tasmota replacement for BL602, programming, pairing with Home Assistant.

p.kaczmarek2 18459 223
This content has been translated flag-pl » flag-en View the original version here.
  • p.kaczmarek2
    Level 28  
    I have started improving Tasmota Control support (Tasmota Control and Tasmota Remota, it's the same protocol).
    I. e. I try to support:
    Code:

    http://192.168.0.103/cm?cmnd=status

    Code:

    http://192.168.0.103/cm?cmnd=POWER2%20OFF

    etc
    I got working:
    - power ON/OFF LED strip and bulbs etc (almost)
    - control power of relays of single relay and multi relay devices
    - read power from power metering sockets
    Screenshot:
    Tasmota replacement for BL602, programming, pairing with Home Assistant.
    but I have a strange problem.
    I am testing with single color ESP8266 LED strip, but this LED strip doesn't show as a strip on Tasmota Control, same for Tasmota Remota.
    My question to you guys - are LED strips (single color or multi color) and/or RGB, CW, RGBCW bulbs supported by Tasmota control or Tasmota Remota?

    Question 2: Can anyone paste here me the JSON replies of Tasmota devices with a) single color led, b) RGB LED c) RGBCW led d) CW led, strips bulbs or anything, for::
    Code:

    http://192.168.0.103/cm?cmnd=status

    Code:

    http://192.168.0.103/cm?cmnd=status 8
  • roli1
    Level 6  
    I have a Gosund LED Strip Model SL2 flashed with Tasmota.
    The output of
    Code:

    http://192.168.0.103/cm?cmnd=status

    Code:

    {
    Status: {
    Module: 0,
    DeviceName: "LEDStrip",
    FriendlyName: [
    "LEDStrip"
    ],
    Topic: "LED_Strip",
    ButtonTopic: "0",
    Power: 0,
    PowerOnState: 3,
    LedState: 1,
    LedMask: "FFFF",
    SaveData: 0,
    SaveState: 1,
    SwitchTopic: "0",
    SwitchMode: [
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0
    ],
    ButtonRetain: 0,
    SwitchRetain: 0,
    SensorRetain: 0,
    PowerRetain: 1,
    InfoRetain: 0,
    StateRetain: 0
    }
    }


    and
    Code:

    http://192.168.0.103/cm?cmnd=status 8

    Code:

    {
    StatusSNS: {
    Time: "2022-11-10T20:42:07"
    }
    }

    In Tasmota remota the device is shown as RGBCW device
    Tasmota replacement for BL602, programming, pairing with Home Assistant.
  • p.kaczmarek2
    Level 28  
    Thanks, what about Tasmota Control?
    Futhermore, where is the RGB value stored? From a quick glance, I can't see it on your screenshots.
  • roli1
    Level 6  
    If i change the color the output in the Tasmota console is
    Code:

    11:42:33.021 MQT: stat/LED_Strip/RESULT = {"POWER":"ON","Dimmer":100,"Color":"255,0,157","HSBColor":"323,100,100","Channel":[100,0,62]}


    Added after 9 [minutes]:

    Code:

    http://10.0.0.59/cm?cmnd=HSBColor


    Code:

    {
    POWER: "OFF",
    Dimmer: 100,
    Color: "255,0,157",
    HSBColor: "323,100,100",
    Channel: [
    100,
    0,
    62
    ]
    }


    Code:

    http://10.0.0.59/cm?cmnd=Color

    Code:

    {
    Color: "255,0,157"
    }
  • p.kaczmarek2
    Level 28  
    Thank you, this is a very useful information.

    roli1 wrote:

    Code:

    {
    POWER: "OFF",
    Dimmer: 100,
    Color: "255,0,157",
    HSBColor: "323,100,100",
    Channel: [
    100,
    0,
    62
    ]
    }

    May I ask what happens if you set the dimmer down to 10 instead of 100?
    Or to be more specific, are the "Color" values already scaled by dimmer or are they 'raw', before calling?
  • roli1
    Level 6  
    If i change only the dimmer, color and hsb change also.

    Code:

    {
    POWER: "ON",
    Dimmer: 50,
    Color: "128,0,79",
    HSBColor: "323,100,50",
    Channel: [
    50,
    0,
    31
    ]
    }


    Code:

    {
    POWER: "ON",
    Dimmer: 10,
    Color: "26,0,16",
    HSBColor: "323,100,10",
    Channel: [
    10,
    0,
    6
    ]
    }
  • francwalter
    Level 6  
    Hallo
    I have now one of my BL602 in use since I flashed it, works great :)
    I made a widget in Tasker (an Android automation app) where I send:
    Code:
    http://192.168.0.221/cm?cmnd=Power TOGGLE

    This works good, as answer I just get the new Power state, e.g.
    Code:
    {"POWER":"ON"}
    which I can use to change the widget color and text.
    But often, due to problems of my phone with WiFi in our flat (too large for one wifi-router therefore a repeater and then the phone switches all the time between the two, disconnecting sometimes totally), I press the widget in vain so I switch the BL602 manually (yes, this is still possible, and often much faster than grabbing the phone). So the widget doesnt change although the state changed (ON or OFF).
    I would like to get just the power state now, to set the widget right, but I dont get it, in status, the power is always 1, e.g.:
    Code:
    http://192.168.0.221/cm?cmnd=Power%20OFF
    
    {"POWER":"OFF"}
    http://192.168.0.221/cm?cmnd=status
    {"Status":{"Module":0,"DeviceName":"OpenBL602-1","FriendlyName":["OpenBL602_4C1C1D01"],"Topic":"obl4C1C1D01","ButtonTopic":"0","Power":1,"PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":1,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0}}

    If I do a toggle again, Power still is 1.
    How can I just check whether the switch is on or off without switching it?
  • p.kaczmarek2
    Level 28  
    Hello @francwalter , which version are you using? I have recently upgraded JSON support to contain all necessary information.
  • francwalter
    Level 6  
    p.kaczmarek2 wrote:
    Hello @francwalter , which version are you using? I have recently upgraded JSON support to contain all necessary information.

    It says: Build on Oct 31 2022 09:32:43 version BL602_Test
    So I will try an OTA Update, never did yet, hopefully it works ...

    Added after 20 [minutes]:

    francwalter wrote:
    ...It says: Build on Oct 31 2022 09:32:43 version BL602_Test
    So I will try an OTA Update ...

    No, does not seem to work. I put it on my server (where I can use http) and put the link to the bin file into the OTA field, after pressing the Button: OTA (update software by WiFi), but it says just:
    Quote:

    but the OTA Update is not done. Anyway it is not a RBL file, the firmware is a BIN file, so that cannot work I guess :(

    In the app (Button: Launch Web Application) I could download the (same) bin from the dropdown, but then, when I select the downloaded OpenBL602_1.15.70.bin file, I can read:
    Quote:
    OpenBL602_1.15.70.bin len:789804
    Invalid OTA file was selected

    The file filter in the file selection dialog is .img though, so why is there a dropdown with the bin files when it needs a img (or rbl???) file?
    I am confused. Where can I read about OTA firmware update of BL602? Is it possible at all?
    I dont understand the instructions in OTA :( Where can I find the firmware as RBL-file?

    I dont want to solder again the pins, please dont let me do this :(
  • p.kaczmarek2
    Level 28  
    You have old version.
    Tasmota replacement for BL602, programming, pairing with Home Assistant.
    Many changes were added on, for example, Nov 10, 2022.

    Sadly OTA (as you can read in this thread) is not present on BL602, because it was not present in the SDK we used. They really didn't have OTA working, at least at the time of forking. Only BK7231T, BK7231N, W600 (601), W800 (801) have OTA working.
  • francwalter
    Level 6  
    p.kaczmarek2 wrote:
    ...
    Sadly OTA (as you can read in this thread) is not present on BL602, because it was not present in the SDK we used...

    Ok, I see. Thank. Maybe one day I will flash then by cable again, but a bit unlikely, too much work for too few advantage, I guess I will live with it ;)
    EDIT: or I could just get the index and with some JS:
    Code:
    document.getElementById("state").firstChild.firstChild.firstChild.firstChild.innerHTML

    This is OFF or ON, depending on the state.
    p.kaczmarek2 wrote:
    ...as you can read in this thread...
    Yes, now I found it :) When searching for OTA in this thread, it appears in # 162
  • bobbik
    Level 17  
    Hello. I admit that I only briefly looked at github and this thread, so I'll ask if:
    - ota for BL602 is still missing?
    - Is it possible to use the same GPIO for short and long button presses?
    - and multiclick? (Eg 3 clicks?)
    - are some simple automations possible?
    (E.g. using the button always turns on the W channel regardless of the last color but the last used brightness)
  • p.kaczmarek2
    Level 28  
    @bobbik OTA is only for BK7231T/N, W600/601, W800/801 etc. The BL602 didn't have it in the SDK used and there are only a few devices on the BL602 so there was no more attempt to add it. Unless you found some new device on the BL602?

    Button events can be freely scripted, you can attach any command to them, separately for click, separately for double click, hold start, and so on. You can create events in "Short startup command"

    You can also automate events. In the case of BK there are also fully-fledged LittleFS scripts, but on BL602 we haven't launched LittleFS yet because it was never needed, but I can add it if someone wants to do more complex mechanisms (in scripts you can check conditions, wait a certain amount of time and so on)

    What exactly do you need to do?
  • droege
    Level 9  
    Hi there again,

    after quite a long time, I have tested the new version again. I flashed today by wire the new version 1.15.120 in the BL602.
    First of all, I can report, that the MQTT Bug has been fixed. Great work. The device seems to be stable.
    Flashing from 1.12.x seems to result in a complete reset of all parameters, including wifi data, etc. I had to start from scratch configuring all the data.
    Which is fine, if this would be documented.
    A complete documentation of MQTT commands (including basecolor and finalcolor) is still missing. Would be great to have this, in order to support other system than Home Assistant. I'm using FHEM, wich works great, if only I could read the syntax somewhere.

    One feature, I'm still missing, I have requested many times, is:
    - recalculate and pulish dimmer values.
    As an explanation:
    final color computes from basecolor & dimmer a final color, if needed. Fine, if dimmer is changed on a given basecolor.
    But if you now set, given you have set basecolor to FF0000 (red) and dimmer to 50% (which results in 7f0000), a new basecolor, the dimmer is still on 50%.
    This is in my opinion wrong, as the RGB value contains a new dimmer value. Let's say you set a new basecolor (or finalcolor if you want) like FF0000, this means 100% red (or first channel). This is 100% of the first channel. No meaning of applying a previously set dimmer, as you set explicitly a new RGB value. Tasmota is working like this.

    Can you please reset the dimmer value (and publish via MQTT) with a new RGB_basecolor and overwrite the dimmer value with this. Because a new RGB is including a new dimmer value. You could also tell this a new finalcolor if you like. Both are fine, but I would like to get rid of a previously defined dimmer value by setting a new RGB. Tasmota is doing it like this.

    Thanks,
    kind regards,
    Olaf

    Added after 9 [minutes]:

    Hi again,

    sorry, I have another request.
    You have added a control bit, that allows to enable light whenever brightness, color, etc. is changed on the web-interface.
    Can you enhance this to MQTT.
    Whenever I change color or temperature on tasmota, the device is switched on, also via MQTT.
    Would be great, if you could extend this feature also to MQTT.
    And if you do this, can you report also via finalcolor, and not only on basecolor? A system has to choose , where to get the color information from. And if it is finalcolor (due to dimmer, etc.) this should be consistent.

    Thanks,
    best,
    Olaf