logo elektroda
logo elektroda
X
logo elektroda

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

erdeidominik1999 2205 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: 14416
    Help: 650
    Rate: 12371
    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.
  • #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: 14416
    Help: 650
    Rate: 12371
    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: 14416
    Help: 650
    Rate: 12371
    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.
  • ADVERTISEMENT
  • #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: 14416
    Help: 650
    Rate: 12371
    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.
  • #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.
  • ADVERTISEMENT
  • #12 20779997
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12371
    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: 14416
    Help: 650
    Rate: 12371
    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.
  • #16 20780554
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14416
    Help: 650
    Rate: 12371
    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!
  • ADVERTISEMENT
  • #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: 14416
    Help: 650
    Rate: 12371
    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: 4859
    Help: 424
    Rate: 860
    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 already pushes Wi-Fi RSSI (-30 to -100 dBm) every ~30 s via MQTT; “just tick the ‘broadcast self-state’ box first” [Elektroda, p.kaczmarek2, post #20773421] Auto-discovery works in Home Assistant when you set device_class: "signal_strength". Why it matters: Native metrics let you spot connectivity drops before automations fail.

Quick Facts

• MQTT topic: /rssi, JSON payload, ~30 B per update [OpenBeken Docs, 2023]. • Default publish interval: Approx. 30 s (configurable 5–300 s) [OpenBeken Docs, 2023]. • Valid RSSI range: ‑30 dBm (excellent) to ≤-100 dBm (no link) [Cisco, 2022]. • Percent quality = 2 × (RSSI + 100), clamped 0–100 % [Elektroda, erdeidominik1999, post #20775547] • HA device_class “signal_strength” auto-selects the antenna icon [HA Docs, 2023].

How do I enable Wi-Fi RSSI reporting in OpenBeken?

  1. Log in to the Web UI.
  2. Turn on “Broadcast self-state” in MQTT settings.
  3. Reboot or run startDriver MQTT. The firmware then publishes RSSI automatically every cycle [Elektroda, p.kaczmarek2, post #20773421]

Which MQTT topic carries the RSSI value?

The default topic is <device_name>/rssi under the configured base topic. Example: obk_plug/rssi [OpenBeken Docs, 2023].

Can Home Assistant auto-discover the RSSI sensor?

Yes. Since 2023-10-19, OpenBeken sends an MQTT discovery payload containing device_class: signal_strength, unit_of_meas: dBm, and the topic pointer. HA creates the sensor instantly [Elektroda, p.kaczmarek2, post #20776177]

What if I prefer percent instead of dBm?

You can calculate percent quality using the built-in formula 2*(RSSI+100) and request the dev branch that exposes /rssi_percent via discovery [Elektroda, erdeidominik1999, post #20783688]

How do I enable instant button reaction like Tasmota SetOption13?

Set flag 6 in OpenBeken. CLI: setFlag 6 1 then save. This removes the “wait for release” delay [Elektroda, p.kaczmarek2, post #20775464]

Why does the Web UI turn white in safe mode?

The HTML pulls JavaScript from GitHub’s CDN. In AP-only safe mode you have no Internet, so scripts fail to load and the page stays blank [Elektroda, p.kaczmarek2, post #20780554]

How can I edit autoexec while stuck in safe mode?

Use the serial console or execute startFlashSafe 0 from the minimal command page, then upload a corrected autoexec and reboot [Elektroda, p.kaczmarek2, post #20780542]
Generated by the language model.
ADVERTISEMENT