How do I create a log of weight measurements from my smart scale?

I’ve got a Mi Scale 2 that I was able to pair with Home Assistant just fine. It updates the weight value in HA every time I use it, but I’m kind of scratching my head about how to generate a long-term log in an externally-usable format.

Can I dump this number to some kind of external database? Generate a CSV file and upload it to a SMB share or something like that?

(As background, I have my HA instance running in a VM on Proxmox, so it’s no problem for me to spin up a dedicated VM if that’s what’s needed.)

It’s sitting in the state database and there’s such thing as a sql sensor.

So exactly what data do you want to display and how?

Basically at the end of the day you can get (whatever data you can imagine form a sql statement) out as a state and set of attributes…

Then you use a template to read out what you got from the sql sensor… Probably to a markdown card.

Then whenever you weigh a new measurement happens the sql sensor updates and markdown displays the net result.

Thats the how I’d choose… Doesn’t require setting up infrastructure.

I’m using the file integration and the notify service to save the values to a csv-file that I can easily pick up in e.g. Microsoft Power BI.

Once you have set up the csv file and automation properly, the notify action will add the latest values at the end of the file.

You can then use the ‘Download data’ option from the History to get and fill in previous data, i.e. from before the automation started adding the values to the csv file.

I know it’s a duplication of data from what’s in HA’s database, but it makes it way easier for me to handle these kinds of historic views.

1 Like