Hello! Is there any way to report the wifi signal to home assistant?
Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamQuote:
6 [BTN] Instant touch reaction instead of waiting for release (aka SetOption 13)
p.kaczmarek2 wrote:Hello, have you checked our docs?
https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/flags.mdQuote: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?
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.
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;
}mdi:access-pointmdi:wifip.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:
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:
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
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;
}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]
device_class: signal_strength, state_topic: ~/rssi, and unit_of_measurement: dBm. [#20776177]2 * (rssi + 100) between those limits. [#20775547]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]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]signal_strength was enough for Home Assistant to assign an appropriate icon automatically, so a custom icon was unnecessary. [#20779543]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]2 * (rssi + 100) in between. For example, -75 dBm would convert to 50%. That exact C function was posted in the thread. [#20775547]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]