MQTT Bed Sensor/Scales for bed occupancy (although entirely adaptable for anything), for integrating with Home Assistant, OpenHAB, Domoticz and anything else supporting MQTT.
Has remote tare function which you can issue over MQTT if your sensor suffers from drift which many load cells seem to. This saves having to re-start the device everytime you want to tare.
Full guide available here
- HX711 library - available through Arduino IDE library manager
- PubSubClient library - available through Arduino IDE library manager
- ESP boards
This was built specifically with bed occupancy in mind so that automations can be triggered when in bed such as switching lights off, locking doors, setting alarms etc etc using Home Assistant. I found that load cells seem to "drift" a little over time, with this in mind a remote tare function was built in so that I can issue a tare command over MQTT which will reset it to zero without having to physically reset the device everytime.
- Load calibration sketch and ensure no additional weight is on the bed/scale
- Using serial monitor, observe starting measurements
- Place known weight on bed/scale e.g 5kg and observe new measurements printed on monitor
- Adjust calibration factor variable and repeat steps till values are correct. Take note of calibration factor
- Load sketch, ensure no additional weight is on the scales
- Fill in all variables in config.h file
- Observe output on serial monitor, place known weight on scales and ensure read-out is correct.
- Once happy, unplug and plug into main power supply and enjoy!
The original idea for this has been adapted from Zack over at Self Hosted Home's original build, so big thanks to him!