logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

OpenBeken - WiFi RSSI for Home Assistant Discovery, device_class, yaml

erdeidominik1999 2442 22
Best answers

How can I report Wi‑Fi signal strength to Home Assistant, and can it be autodiscovered as dBm or percent?

Yes—OpenBeken already publishes RSSI over MQTT, and Home Assistant can autodiscover it as a `signal_strength` sensor with `dBm` units. You may need to enable the “broadcast self state” flag first [#20773421] For HA discovery, the suggested fields were `dev_cla: signal_strength`, `stat_t: ~/rssi`, and `unit_of_meas: dBm`, which made the RSSI sensor appear correctly in HA [#20775530][#20776517][#20783688] If you want a percentage value too, the thread suggests converting RSSI with `WifiGetRssiAsQuality()`: `<= -100` gives `0`, `>= -50` gives `100`, and values in between use `2 * (rssi + 100)` [#20783688] The `signal_strength` device class is enough for Home Assistant to assign the proper icon automatically, so a custom icon is not required [#20779543] The percent sensor was discussed as a future addition to autodiscovery, but it was not confirmed as already implemented in the thread [#20840418]
Generated by the language model.
ADVERTISEMENT
  • #1 20773414
    erdeidominik1999
    Level 8  
    Posts: 47
    Help: 1
    Rate: 1
    Hello! Is there any way to report the wifi signal to home assistant?
  • ADVERTISEMENT
  • #2 20773421
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    Hello @erdeidominik1999 . If you check our MQTT docs, here:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/mqttTopics.md
    You can clearly see that RSSI value is being published periodically on MQTT, however, you may need to enable "broadcast self state" flag first.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20773453
    erdeidominik1999
    Level 8  
    Posts: 47
    Help: 1
    Rate: 1
    Thank you, @p.kaczmarek2, and is there a way to autodiscover it in HA? Also to send in percent not only RSSI?
  • #4 20775324
    erdeidominik1999
    Level 8  
    Posts: 47
    Help: 1
    Rate: 1
    Is there a command like tasmota SetOption13 1 to set a button only for single press to reduce delay?
  • #5 20775464
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    Hello, have you checked our docs?
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/flags.md
    Quote:

    6 [BTN] Instant touch reaction instead of waiting for release (aka SetOption 13)

    as per RSSI, I can add it to HA discovery if you want. Do you know what would be the HA yaml type for that?
    Helpful post? Buy me a coffee.
  • #6 20775503
    erdeidominik1999
    Level 8  
    Posts: 47
    Help: 1
    Rate: 1
    p.kaczmarek2 wrote:
    Hello, have you checked our docs?
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/flags.md
    Quote:
    6 [BTN] Instant touch reaction instead of waiting for release (aka SetOption 13)

    as per RSSI, I can add it to HA discovery if you want. Do you know what would be the HA yaml type for that?


    Thank you I missed that flag, it works like a charm.
    I think this is what you search for: https://community.home-assistant.io/t/mqtt-vs-template-inconsistency/434145
  • #7 20775530
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    Yes, it seems it should be easy to add that to the HA discovery. The unit here is dBm. I will try to include it in the tomorrows update.
    Helpful post? Buy me a coffee.
  • #8 20775547
    erdeidominik1999
    Level 8  
    Posts: 47
    Help: 1
    Rate: 1
    p.kaczmarek2 wrote:
    Yes, it seems it should be easy to add that to the HA discovery. The unit here is dBm. I will try to include it in the tomorrows update.

    Thank you! Yes it's dBm. Can you also add a sensor with percent of wifi signal?
    This is the code:
    int WifiGetRssiAsQuality(int rssi) 
     { 
       int quality = 0; 
      
       if (rssi <= -100) {
         quality = 0;
       } else if (rssi >= -50) {
         quality = 100;
       } else {
         quality = 2 * (rssi + 100);
       }
       return quality;
     }


    And if you need it the icons for rssi:
    mdi:access-point
    , and for percent .
  • #9 20776177
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    Setting the icon does not work for me. Maybe I got JSON wrong:
    Screenshot showing a code snippet using the cJSON library.
    Still, with this code:
    Code: C / C++
    Log in, to see the code

    I got that result:
    Panel with toggles and RSSI value of -1 dBm.
    Ignore -1 value, it's a placeholder for simulator:
    Circuit simulation diagram with four bulbs and a WB3S chip.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #10 20776517
    erdeidominik1999
    Level 8  
    Posts: 47
    Help: 1
    Rate: 1
    p.kaczmarek2 wrote:
    Setting the icon does not work for me. Maybe I got JSON wrong:

    Still, with this code:
    Code: c Expand Select all Copy to clipboard
    case HASS_RSSI:
    cJSON_AddStringToObject(info->root, "dev_cla", "signal_strength");
    cJSON_AddStringToObject(info->root, "stat_t", "~/rssi");
    cJSON_AddStringToObject(info->root, "unit_of_meas", "dBm");
    //cJSON_AddStringToObject(info->root, "icon_template", "mdi:access-point");

    break;

    I got that result:

    Ignore -1 value, it's a placeholder for simulator:


    I think it should be icon only not icon_template, not?
  • #11 20779543
    ShellDude
    Level 4  
    Posts: 10

    I just did something very similar with a DIY BME280 sensor and an ESP32 module.

    If you specify the device_class, HA will assign the appropriate icon for you.

    Looks like you're covered with device_class signal_strength. This is the same one I used.
  • #12 20779997
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    Ok, so it's working correctly? What next can I add?
    Helpful post? Buy me a coffee.
  • #13 20780499
    erdeidominik1999
    Level 8  
    Posts: 47
    Help: 1
    Rate: 1
    Hello!
    Is there any way to edit the autoexec file if I boot to safe mode? I use deep sleep and in safe mode the web app loads only a white page.
  • #14 20780542
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    Hello @erdeidominik1999 , as far as I remember, there are two options:
    1. in safe mode you should get a "do unsafe boot" button on http gui, but i am not sure
    2. in safe mode, you can use this command:
    FAQ excerpt on removing autoexec.bat in safe mode.
    See more on our FAQ:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/faq.md
    Helpful post? Buy me a coffee.
  • #15 20780547
    erdeidominik1999
    Level 8  
    Posts: 47
    Help: 1
    Rate: 1

    p.kaczmarek2 wrote:
    Hello @erdeidominik1999, as far as I remember, there are two options:
    1. In safe mode, you should get a "do unsafe boot" button on the http GUI, but I am not sure.
    2. In safe mode, you can use this command:


    Yes, the first option works, but after boot, it also loads only a white page.
  • ADVERTISEMENT
  • #16 20780554
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    Are you sure, @erdeidominik1999 ? But do you know that Web App scripts are loaded from Github? So if you are connected to the AP of OBK, then Web App will not load?

    You need to have network connection via (for example) cable at the same time and it should work, I think.... if it's not working, let me know, there might be a bug that I need to fix
    Helpful post? Buy me a coffee.
  • #17 20780569
    erdeidominik1999
    Level 8  
    Posts: 47
    Help: 1
    Rate: 1

    p.kaczmarek2 wrote:
    You need to have a network connection via (for example) cable at the same time, and it should work, I think.... if it's not working, let me know, there might be a bug that I need to fix


    I will try this, thank you!
  • #18 20783688
    erdeidominik1999
    Level 8  
    Posts: 47
    Help: 1
    Rate: 1

    >>20779997

    Hello!
    I could test it only today, it works fine, the dBm is reported and auto discovered in HA, can you also add the signal in percent with auto discover?
    This is the code to generate:
    int WifiGetRssiAsQuality(int rssi) 
     { 
       int quality = 0; 
      
       if (rssi <= -100) {
         quality = 0;
       } else if (rssi >= -50) {
         quality = 100;
       } else {
         quality = 2 * (rssi + 100);
       }
       return quality;
     }

    Thank you!
  • #19 20840407
    erdeidominik1999
    Level 8  
    Posts: 47
    Help: 1
    Rate: 1

    Hello @p.kaczmarek2!
    Do you plan to implement this feature or is it a bad idea?
  • #20 20840418
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14622
    Help: 655
    Rate: 12638
    I will add this, please wait, or you can look at the current code and open a pull request with it. Sorry for the delay, right now I am working on ZMAI-90 support (RN8209 driver) for a donator.
    Helpful post? Buy me a coffee.
  • #21 20844058
    erdeidominik1999
    Level 8  
    Posts: 47
    Help: 1
    Rate: 1

    Okay @p.kaczmarek2, I didn't want to hurry you. I read in your description that you want to support Realtek chips. Now I got a smart plug with RTL8710 chipset, if you want I can help with it, but I don't know how to start with it. Also do you plan to support ESP chips in the future? Because I think your firmware is better than Tasmota.
  • #22 21377804
    divadiow
    Level 38  
    Posts: 5065
    Help: 438
    Rate: 893
    RTL87x0Cx is now supported as are ESP32 chips
  • #23 21408142
    erdeidominik1999
    Level 8  
    Posts: 47
    Help: 1
    Rate: 1
    >>21377804
    Thank you, the problem is that I have RTL8710BX.

Topic summary

✨ The discussion focuses on reporting WiFi RSSI values from OpenBeken devices to Home Assistant (HA) via MQTT. The RSSI is published periodically and requires enabling the "broadcast self state" flag. Integration with HA discovery is possible, with the RSSI reported in dBm and plans to add a sensor reporting WiFi signal strength as a percentage using a provided conversion function. The HA device_class "signal_strength" is recommended for automatic icon assignment. Users encountered issues with icon configuration, resolved by using device_class instead of icon_template. Additional topics include editing autoexec files in safe mode and network requirements for the web app. Support for Realtek RTL87x0Cx and ESP32 chips has been added, with ongoing work on RTL8710 and plans to support more chipsets. The firmware is considered a strong alternative to Tasmota.
Generated by the language model.

FAQ

TL;DR: OpenBeken users can send WiFi RSSI to Home Assistant over MQTT in dBm, and one maintainer confirmed, "RSSI value is being published periodically on MQTT" once the self-state broadcast flag is enabled. This FAQ helps Home Assistant and OpenBeken users get MQTT discovery, fast button response, and safe-mode recovery working. [#20773421]

Why it matters: If MQTT discovery, WiFi diagnostics, or instant button handling are misconfigured, Home Assistant can miss sensors, delay presses, or show only a blank recovery page.

Feature OpenBeken Tasmota
Instant button reaction Flag 6 enables press reaction without waiting for release Mentioned as SetOption13 equivalent
WiFi RSSI in HA Reported over MQTT; discovery support was added for dBm Used as the comparison baseline in the thread
WiFi quality in % Requested, formula provided, not yet confirmed as implemented in-thread User referenced percent-style behavior as desired

Key insight: For this thread, the two most important OpenBeken fixes were enabling self-state MQTT broadcasts for RSSI and using flag 6 for instant button response. [#20775464]

Quick Facts

  • OpenBeken publishes WiFi RSSI periodically on MQTT, but you may need to enable the "broadcast self state" flag first for the value to appear consistently. [#20773421]
  • The Home Assistant MQTT discovery settings shown as working were device_class: signal_strength, state_topic: ~/rssi, and unit_of_measurement: dBm. [#20776177]
  • The requested RSSI-to-quality mapping uses 0% at -100 dBm, 100% at -50 dBm, and 2 * (rssi + 100) between those limits. [#20775547]
  • OpenBeken’s Tasmota-style instant press option is documented as flag 6: "Instant touch reaction instead of waiting for release". [#20775464]
  • Safe-mode recovery may require an unsafe boot or console access, and the web app can show a white page when scripts cannot load from GitHub over the current network path. [#20780554]

How do I report WiFi RSSI from OpenBeken to Home Assistant over MQTT?

Enable MQTT in OpenBeken and make sure the device broadcasts its own state. OpenBeken already publishes RSSI periodically on MQTT, so Home Assistant can consume that topic once the self-state broadcast flag is active. The thread’s maintainer stated this behavior directly and pointed to the MQTT documentation for the RSSI topic. [#20773421]

What steps are required in OpenBeken to make the RSSI value appear in Home Assistant auto discovery?

You need to expose RSSI in the Home Assistant discovery payload with the right sensor fields. 1. Enable self-state broadcasting so RSSI is sent. 2. Publish discovery with dev_cla set to signal_strength and stat_t set to ~/rssi. 3. Set unit_of_meas to dBm so Home Assistant recognizes the sensor correctly. [#20776177]

Why is my OpenBeken WiFi signal not being published to MQTT unless I enable the "broadcast self state" flag?

Because OpenBeken can withhold periodic self-telemetry until that flag is enabled. In this thread, RSSI was already available, but the maintainer explicitly said you may need to enable the broadcast self state flag first. Without it, Home Assistant may never see periodic RSSI updates on MQTT. [#20773421]

Which Home Assistant MQTT sensor settings should I use for OpenBeken RSSI, including device_class and unit_of_measurement?

Use device_class as signal_strength and unit_of_measurement as dBm. The working discovery example also used stat_t set to ~/rssi, which tells Home Assistant where to read the signal value. That combination produced an auto-discovered RSSI sensor in the thread. [#20776177]

What is the Home Assistant device_class "signal_strength", and how does it affect MQTT sensor discovery and icons?

"device_class" is MQTT sensor metadata that tells Home Assistant what the value represents, which helps discovery, formatting, and default icon selection. In this thread, using signal_strength was enough for Home Assistant to assign an appropriate icon automatically, so a custom icon was unnecessary. [#20779543]

How can I expose OpenBeken WiFi signal quality as a percentage in Home Assistant instead of only dBm RSSI?

You can expose it by converting RSSI in dBm to a 0–100% value and publishing that as a second sensor. The requested approach was to keep the existing dBm sensor and add another auto-discovered sensor for percent, using the provided conversion code and an mdi:wifi icon if needed. The thread requested this, but did not confirm final implementation there. [#20783688]

What formula does OpenBeken use to convert RSSI in dBm to WiFi quality percent?

The proposed formula maps RSSI to quality with three bands: 0% at -100 dBm or lower, 100% at -50 dBm or higher, and 2 * (rssi + 100) in between. For example, -75 dBm would convert to 50%. That exact C function was posted in the thread. [#20775547]

Where is the OpenBeken equivalent of Tasmota SetOption13 for instant button reaction without waiting for release?

It is flag 6 in OpenBeken. The documentation excerpt quoted in the thread describes it as "Instant touch reaction instead of waiting for release", and the user confirmed it "works like a charm." That is the thread’s direct equivalent to Tasmota SetOption13. [#20775503]

OpenBeken vs Tasmota for smart switches and plugs: which firmware is better if I want fast button response and Home Assistant MQTT discovery?

The thread favors OpenBeken if you want both features in one setup. OpenBeken already had an instant button option through flag 6, and RSSI auto discovery in Home Assistant was later confirmed working in dBm. One user even said OpenBeken firmware was better for their use than Tasmota, though that is a user opinion, not a benchmark. [#20783688]

Why does the OpenBeken web app show only a white page in safe mode when deep sleep is enabled?

The white page can happen because the web app scripts load from GitHub, not only from the device. If you connect only to the OpenBeken access point, the page may stay blank because it lacks a second network path to GitHub-hosted assets. The maintainer suggested simultaneous external network access, such as wired internet, as the practical fix. [#20780554]

How do I edit the OpenBeken autoexec file when the device boots into safe mode?

Use safe-mode recovery first, then change startup commands after you regain normal access. 1. Try the unsafe boot button in the HTTP GUI. 2. If needed, use the safe-mode command shown by the maintainer. 3. Reboot normally and edit the startup commands once the interface loads correctly again. [#20780542]

What is OpenBeken safe mode, and when should I use an unsafe boot to recover from a bad configuration?

"Safe mode" is a recovery boot mode that starts OpenBeken with reduced startup behavior so you can regain control after a bad configuration, crash, or broken startup command. Use an unsafe boot when the device is stuck in recovery conditions but you need one normal boot to undo the faulty setup. [#20780542]

Why doesn’t the Home Assistant MQTT icon field work as expected for my OpenBeken RSSI sensor, and should I use icon or let device_class handle it?

You should usually let device_class: signal_strength handle the icon. In the thread, icon_template did not work as expected, another user suggested icon instead, and a later reply said Home Assistant assigns the appropriate icon automatically when the device class is set correctly. That makes manual icon fields optional here. [#20779543]

What is the OpenBeken autoexec file, and what kinds of startup commands should go there?

"autoexec" is a startup command file that runs OpenBeken actions automatically during boot, which makes it useful for persistent device logic, but risky if a bad command causes boot problems. In this thread, it was discussed specifically in the context of deep sleep and safe-mode recovery after a problematic configuration. [#20780499]

How can I start adding OpenBeken support for Realtek RTL8710BX devices, and what is the current status of RTL87x0Cx and ESP32 support?

Start by checking current source code and submitting a pull request if you can implement or test support. In the thread, later follow-up confirmed that RTL87x0Cx and ESP32 were already supported by January 5, 2025, while the remaining user issue was specifically RTL8710BX. That means RTL8710BX was still a separate concern there. [#21377804]
Generated by the language model.
ADVERTISEMENT