logo elektroda
logo elektroda
X
logo elektroda

Home Assistant button for OpenBeken BL0937/BL0942 energy counter reset

erdeidominik1999 2043 11
ADVERTISEMENT
  • #1 20827395
    erdeidominik1999
    Level 8  
    Posts: 47
    Help: 1
    Rate: 1

    Hello! Is there any way to create an MQTT button for resetting the total energy counter of BL0937?
  • ADVERTISEMENT
  • #2 20827399
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315
    I think you can follow our tutorial here (it may not be yet translated):
    https://www.elektroda.pl/rtvforum/topic4015423.html
    and just send any command you want via cmnd topic
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20858256
    erdeidominik1999
    Level 8  
    Posts: 47
    Help: 1
    Rate: 1

    >>20827399
    Thank you @p.kaczmarek2, it helped. 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.
  • #4 20858266
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315
    Thank you, both those families are planned, they are just lower priority. Currently I am working on RN8209C for a donator and I also have a slight build issue for T, you can read here:
    https://github.com/openshwprojects/OpenBK7231T_App/issues/987
    How much C experience do you have? I you know C, maybe you could also help with that HA discovery request you made some time ago.

    PS: Recently I got one realtek module from a donator, I just need to find some time for that
    Helpful post? Buy me a coffee.
  • #5 20859068
    erdeidominik1999
    Level 8  
    Posts: 47
    Help: 1
    Rate: 1

    p.kaczmarek2 wrote:
    How much C experience do you have? If you know C, maybe you could also help with that HA discovery request you made some time ago.

    I have some experience in C, but not that much, rather in C#. What can I help?
  • #6 20889326
    erdeidominik1999
    Level 8  
    Posts: 47
    Help: 1
    Rate: 1

    >>20858266
    After the end of January, I can help you. Right now, I'm very busy because I have my final exam at the university. Recently, I ordered a lot of smart plugs from AliExpress and smart switches, and all of them have a Realtek chip. So, I think Tuya will ship the products with Realtek in the future.
  • ADVERTISEMENT
  • #7 20937661
    erdeidominik1999
    Level 8  
    Posts: 47
    Help: 1
    Rate: 1

    erdeidominik1999 wrote:

    >>20858266
    After the end of January, I can help you. Right now, I'm very busy because I have my final exam at the university. Recently, I ordered a lot of smart plugs from AliExpress and smart switches, and all of them have a Realtek chip. So, I think Tuya will ship the products with Realtek in the future.


    Dear @p.kaczmarek2!
    What do you think if I create a UI for the external web application with Bootstrap? And then this minimal design can be changed with that.
  • #8 20937875
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315
    The Web App is minimal because we want to be able to host it entirely on OBK LittleFS, so I am not sure if we can grow it much more. Would you be able to make a "bootstrap skin" for OBK web app but keep ability to use it in a minimal version as well?

    Alternatively, you can look into improving this site:
    https://openbekeniot.github.io/webapp/devicesList.html
    Keep functionality (or extend it) and make it more readable.
    Helpful post? Buy me a coffee.
  • #10 20937914
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315
    It's not currently on LittleFS, but the idea is to give people ability to host it on LittleFS as an option.
    Here is related topic, but I haven't tried it myself in some time:
    https://www.elektroda.com/rtvforum/topic4031245.html
    Helpful post? Buy me a coffee.
  • #11 20942467
    erdeidominik1999
    Level 8  
    Posts: 47
    Help: 1
    Rate: 1
    It's a good idea to a new skin and functionality for the device list page, can we talk on a different platform for faster communication?
  • ADVERTISEMENT
  • #12 20942516
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315
    Yes, you can send me on private message some contact information outside forum, maybe Google Chat or something.
    Helpful post? Buy me a coffee.

Topic summary

✨ The discussion revolves around creating an MQTT button to reset the total energy counter of the BL0937 energy counter. A user was directed to a tutorial for sending commands via the cmnd topic. There is interest in supporting Realtek chips, with mentions of a smart plug using the RTL8710 chipset. The conversation also touches on potential future support for ESP chips and the development of a user interface for an external web application using Bootstrap. Participants discuss the minimal design of the web app and the possibility of enhancing its functionality while maintaining compatibility with OBK LittleFS.
Generated by the language model.

FAQ

TL;DR: Use 1 MQTT "cmnd" topic to reset BL0937/BL0942 totals; "just send any command you want via cmnd topic". Create a Home Assistant button that publishes the reset command to your device’s cmnd topic. [Elektroda, p.kaczmarek2, post #20827399]

Why it matters: This lets OpenBeken users add a one-click Home Assistant button to clear cumulative energy totals without touching firmware.

Quick-Facts

Quick Facts

How do I add a Home Assistant button to reset BL0937/BL0942 totals?

Use Home Assistant to publish the energy-reset command over MQTT. OpenBeken accepts commands on the device’s cmnd topic.
  1. Create a button or automation that calls mqtt.publish.
  2. Set the topic to your device’s cmnd topic.
  3. Set the payload to the energy reset command and test. This mirrors the recommended “send any command via cmnd topic” approach. [Elektroda, p.kaczmarek2, post #20827399]

Which MQTT topic should I publish to?

Publish to your device’s cmnd topic as configured in MQTT. “Just send any command you want via cmnd topic.” Use cmnd for control, not stat or tele. This ensures the device treats the message as a command. [Elektroda, p.kaczmarek2, post #20827399]

What command actually resets the BL0937/BL0942 total energy?

OpenBeken exposes a specific reset command for your BL0937/BL0942 build. Send that command as the payload to the device’s cmnd topic. Follow the linked tutorial and confirm the exact command string on your device. If the string is wrong, the counter will not reset. [Elektroda, p.kaczmarek2, post #20827399]

Can I trigger the reset without Home Assistant, using only MQTT?

Yes. Use Mosquitto_pub, Node-RED, or any MQTT client to publish the reset command. Target the device’s cmnd topic and send the payload. This is identical to the Home Assistant approach. [Elektroda, p.kaczmarek2, post #20827399]

The button does nothing—what should I check first?

Check three things. First, the topic is cmnd, not stat or tele. Second, your command string matches the firmware’s expected reset command. Third, the device is online and connected to your broker. If topic or command is wrong, nothing happens. Fix those and retry. [Elektroda, p.kaczmarek2, post #20827399]

Will OpenBeken support Realtek RTL8710 and ESP chips?

Yes—support is planned for two families: Realtek RTL8710 and ESP. They have lower priority right now. Work on RN8209C is active. Contributors with C skills can help move items faster. [Elektroda, p.kaczmarek2, post #20858266]

I have a Realtek-based plug. How can I contribute?

Offer hardware and testing details. Share your C experience if you can assist coding. Send a private message with your contact so collaboration can move to Google Chat or similar for faster responses. [Elektroda, p.kaczmarek2, post #20942516]

Can the external Web App be hosted on-device (LittleFS)?

Not currently. The external Web App isn’t on LittleFS yet. The goal is to make LittleFS hosting possible as an option. Review the related thread for approaches if you want on-device hosting. [Elektroda, p.kaczmarek2, post #20937914]

Why is the OpenBeken Web App so minimal?

It’s designed to fit entirely on LittleFS. “The Web App is minimal because we want to be able to host it entirely on OBK LittleFS.” A Bootstrap skin can be added, but a minimal mode must remain. [Elektroda, p.kaczmarek2, post #20937875]

I want to redesign the devices list page—what should I keep?

Keep existing functionality and improve readability. You may extend features while preserving core behavior. Reference: openbekeniot.github.io/webapp/devicesList.html. Submit changes that maintain usability for current users. [Elektroda, p.kaczmarek2, post #20937875]

Any known build issues that could affect features now?

A slight build issue affects the T variant and is tracked as GitHub issue #987. It shouldn’t block MQTT command sending. If you build from source, review that thread before testing changes. [Elektroda, p.kaczmarek2, post #20858266]

Are Tuya devices moving to Realtek chips?

One user reported multiple recent AliExpress orders containing Realtek-based plugs and switches. Treat this as a market signal, not a guarantee. Plan for RTL support where it fits your use. [Elektroda, erdeidominik1999, post #20889326]

How do I confirm the total energy counter actually reset?

After publishing the reset command, read the total energy again in Home Assistant or via MQTT. The original goal is a BL0937 total reset, so totals should reflect the change. [Elektroda, erdeidominik1999, post #20827395]

Can I schedule automatic resets in Home Assistant?

Yes. Create a time-based automation that calls mqtt.publish to your device’s cmnd topic. Use monthly or weekly triggers to match billing. Ensure the command payload matches your firmware’s reset command. [Elektroda, p.kaczmarek2, post #20827399]
Generated by the language model.
ADVERTISEMENT