logo elektroda
logo elektroda
X
logo elektroda

MQTT Not add item with Accents in "Configure Names" Configuration

tadeu1 381 15
ADVERTISEMENT
  • #1 21798559
    tadeu1
    Level 5  
    When I add a Brazilian accent to a letter on configure names, for example Full Name: Luz - Salão de Festas
    and try to discover at MQTT the firmware not send, if I take out the accent and leave Salao de Festa, it appears on MQTT.
    At Tasmota it works for example with space and ~ç´` etc
  • ADVERTISEMENT
  • #2 21799107
    p.kaczmarek2
    Moderator Smart Home
    I think it should currently work only with ASCII chars (single byte characters), are those characters ASCII?
    Helpful post? Buy me a coffee.
  • #3 21799354
    tadeu1
    Level 5  
    Yeah, is there
    Binário Hex Char
    11000110 C6 ã

    But if you use it, it doesn't work.
  • ADVERTISEMENT
  • #4 21800237
    p.kaczmarek2
    Moderator Smart Home
    So, if you have this character in name, and do HASS discovery, can you use HA MQTT "listen" tool to see what's published, so we can investigate? Or is there no message at all?

    I will try to replicate with self test.

    Added after 52 [minutes]:

    print_string_ptr may be culprit (from CJSON)
    Helpful post? Buy me a coffee.
  • #5 21800299
    insmod
    Level 31  
    I don't see that symbol in extended ascii table
  • #6 21800308
    p.kaczmarek2
    Moderator Smart Home
    I added a self test but I am confused:
    Code: C / C++
    Log in, to see the code

    It seems to pass as is already.
    https://github.com/openshwprojects/OpenBK7231T_App/pull/1934


    Or maybe it got saved as ?

    Added after 2 [minutes]:

    Yes it did, retrying.
    Screenshot of C code in an editor modifying a character array with ASCII values

    Added after 24 [minutes]:

    This passes:
    Code: C / C++
    Log in, to see the code


    Maybe it breaks because I can't have special char there?
    Code: C / C++
    Log in, to see the code


    Added after 1 [minutes]:

    SO it would mean:
    - we already can have special chars in quotes ids list for HA
    - but we can't use them (obviously) in internal entity names, so i need to prune them

    Added after 11 [minutes]:

    I probably could patch STR_ReplaceWhiteSpacesWithUnderscore to prune those characters

    Added after 16 [minutes]:

    Like this:
    MQTT Not add item with Accents in "Configure Names" Configuration
    and then rename command to "sanitize"

    Added after 10 [minutes]:

    @tadeu1 @divadiow can you check?
    https://github.com/openshwprojects/OpenBK7231T_App/pull/1934
    Set full name:
    Salão de Festas
    Set single pin with relay.
    Expected behaviour:
    - uniq_id for HA will have special chars stripped, so it will work , it will turn into Sal_o_de_Festas_relay_1
    - the ids string for HA (the one I expect to be human-readable) will have this string as is
    I am not sure whether we need to escape this char futher
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #7 21800481
    tadeu1
    Level 5  
    >>21800308 It's on version 1.18.234?
  • #8 21800497
    p.kaczmarek2
    Moderator Smart Home
    No, you need to download "artifacts" from PR by clicking green check mark.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #9 21800511
    tadeu1
    Level 5  
    >>21800497 Sorry, I have never done this before. I feel dumb; I'll try to read about how to do that.
  • #10 21800538
    p.kaczmarek2
    Moderator Smart Home
    Here is a guide showing how to download online builds from OBK PR:
    https://www.elektroda.com/rtvforum/topic4033833.html

    This is indeed a new mechanism, so people don't know about it yet, that's one of the reasons why OBK is so flexible and easy to develop.
    Helpful post? Buy me a coffee.
  • #11 21800909
    tadeu1
    Level 5  
    >>21800497



    Thumbnail with photo icon and text “Luz_-_Sal_o_de_Festa BK7231N • 9 entidades”

    Device name change form with error in the ShortName field

    Now it's working.

    Device name change panel showing Luz - Salão de Festa

    Text on dark background with “luz_salao_de_festa” and details “BK7231N • 9 entidades”
  • #12 21800943
    p.kaczmarek2
    Moderator Smart Home
    So, it's okay now? Is it ready to merge? I see short name got corrected, but short name is used for MQTT, I don't think there is a way around it. Long name is for display, I think.
    Helpful post? Buy me a coffee.
  • #13 21801040
    tadeu1
    Level 5  
    I just put the character in the short name to test. No one wants to use an accent there (I hope); the full name is OK. Tks
  • #14 21801304
    p.kaczmarek2
    Moderator Smart Home
    Ok so I am adding this to release. Do you have any other ideas for fixes or suggestions?
    Helpful post? Buy me a coffee.
  • #15 21801328
    tadeu1
    Level 5  
    I'm new to this firmware. I just applied to 4 different units and added to the forum.

    Now I'm trying to understand about power stuff. For example, same power outlet, one with BL602 and the other with ESP-02S.

    Using a bulb the ESP is almost fixed 15 W and with the BL602 or other with open BK it changes between 13 W and 18 W. It's weird and I don't know why.

    I'll go deeper into the options; there are so many functions different from Tasmota.

    I don't know if you have plans for translation, but I can help with pt-BR.
  • #16 21801364
    p.kaczmarek2
    Moderator Smart Home
    First of all, if you want to measure power of Wi-Fi module, you need to turn off the LEDs in the firmware first.

    Then, make sure you use PowerSave 1 feature of OBK. It's a great feature that can prolong the life of many devices. I really recommend it. Check this topic to see what happens if you overload Tuya power supply (or sometimes it happens just on its own, those devices are cheap):
    https://www.elektroda.com/rtvforum/topic3898805.html


    Helpful post? Buy me a coffee.

Topic summary

The issue concerns the inability of MQTT firmware to transmit device names containing Brazilian accented characters when configured under "Configure Names." For example, a name like "Luz - Salão de Festas" does not appear in MQTT discovery, whereas removing accents ("Salao de Festa") allows proper transmission. It is noted that Tasmota firmware supports accented characters, spaces, and special symbols such as ~, ç, ´, and `. A response suggests that the current MQTT implementation may only support ASCII characters (single-byte), implying that accented characters, which are typically multi-byte, are not handled correctly.
Summary generated by the language model.
ADVERTISEMENT