Earlier this year I made an occupancy sensor for my Sleep Number bed to integrate with Home Assistant. The hardware cost me about $80. It’s written in mircopython and runs on ESP32 (the M5Stack core to be precise). The sensor pushes instant state changes in addition to pressure data every 30s to MQTT for both sides of the bed. It ended up being much trickier than I thought because I had to make it continuously adapt to atmospheric pressure changes.
I originally wrote sleep2mqtt to use a configuration file so it could be easily shared, but it wasn’t until now that I finally put the project together with documentation so I could share it with people. I’ve seen that the SleepIQ API has been breaking lately for Home Assistant users, so now seemed like a good time.
The entire project is free for use under the MIT license: https://github.com/anotherhobby/sleep2mqtt