logo elektroda
logo elektroda
X
logo elektroda

OpenBeken BK7231N + BL0942 MQTT Sensor Availability in Home Assistant, Missing avty_t

avgapon 81 0
ADVERTISEMENT
  • #1 21821590
    avgapon
    Level 1  
    Hi. I am totally new here, so maybe I am asking something obvious or silly. My apologies if that's the case.

    I've just reflashed a pretty generic Tuya smart plug based on BK7231N (T34, actually) + BL0942 to the latest OpenBeken firmware that has been downloaded by the GUI flasher (1.18.249).
    Everything went very well, everything works.
    Home Asssistant has auto-discovered the device and it was also perfect.

    Then, I pulled the plug from the wall socket and that's when I got a bit puzzled.
    Home Assistant shows the switch entity of the device as unavailable, but for all power sensors it keeps showing the last reported value.

    I checked with MQTT explorer and I think that the issue may be related to availability topic ("avty_t") in the discovery messages.
    I see relevant topics under homeassistant/switch (there's just one, homeassistant/switch/XXX_relay_1/config) and under homeassistant/sensor (there are several of them).
    The topic under "switch/" has a message with JSON payload that has
    "avty_t": "~/connected"
    field in it.
    But messages in the topics under "sensor/" do not have that field in their payloads.

    I guess that's why Home Assistant does not know / care about availability of those sensors.

    I wonder if I configured something wrong or if I haven't configured something that I should have.

    AI: Could you please share whether you customized any MQTT or discovery settings in OpenBeken, or are you using the default configuration?

    Almost default configuration.

    In Flags I have only flag 2 set.

    I also have a startup command:
    backlog startDriver NTP; ntp_setServer 192.168.0.1; ntp_timeZoneOfs +3; SetupEnergyStats 1 60 5;
    


    AI: Which versions of Home Assistant and your MQTT broker are you currently using?
    mosquitto-2.0.22
    HASS 2026.1.2

    Added after 31 [minutes]:

    Another observation is that discovery messages for "internal sensors" (like chip temperature, RSSI, etc) do have avty_t in them.
    Only energy related sensors don't have it.
    Makes me wonder if maybe SetupEnergyStats could be responsible for that.
  • ADVERTISEMENT
ADVERTISEMENT