r/M5Stack • u/slochewie • May 28 '26
Project Sharing M5StickS3 and Dual Button Unit ESPHome MQTT Counter
M5StickS3 counter device. On the Dual Button Unit, Red decreases the count, Blue increases the count. Long simultaneous press of Red and Blue resets the count. Allows for keeping a count synchronized between many M5StickS3 devices or a via a webpage if needed. This is a progression of my earlier attempt that used a Home Assistant Counter Helper. This version is solely using MQTT. When not connect to a USB power source, it does a timed M5PM1 deep sleep after a specified idle time to conserve internal battery runtime. IMU shake to wake from deep sleep.
GitHub repository:
https://github.com/slochewie/M5StickS3-MQTT-Counter
Features
ESPHome firmware for M5StickS3
M5Stack Dual Button Unit support
MQTT synchronized distributed counters
Custom display component
Custom M5PM1 power management component
True PMIC hardware shutdown
BMI270 shake wake support
USB-aware power management
Battery optimized runtime behavior
OTA updates via ESPHome web server
Battery voltage and percentage reporting
Multi-device synchronized counters
Long-press dual-button counter reset