Hi all, Apple Health is similar to Alexa and Home Assistant in some ways. It is pretty much a database of health related metrics. Some of the data is gathered from iPhones but there are a number of hardware devices and associated apps that measure various attributes and can write to Apple Health.
E.g a blood glucose meter can use NFT to send data to it’s app and gives pairs like
timestamp: 5.7ml/mol
A set of bluetooth scales might record weight , bmi , percentage muscle/ fat/ water
A smart watch may record steps and heart rate ect.
usually some or all of this data can be written and synced to apple health.
This can be quite convenient, e.g Home Assistant supports some bluetooth scales which is good of course but then you get problems with bluetooth range and then you end up with a device dedicated to communicating to that device and then relaying the data via wifi to your main HA install. Does that make any sense? do you really need access to a set of bathroom scales 24/7 The scales don’t even need that , they can store the data till your iphone is in range and the app take in the data and passes it to apple health anyway.
Home assistant devs have essentially said Apple will not allow an app that is not primarily health focused to access Apple Health . So it’s not possible then? No HA can’t directly interact with Apple Health but there is an iPhone App which can periodically export Apple Health data to HA.
This isn’t free although it has a free trial for 7 days and then various subscription offers the best being euro 11.99 for lifetime subscription, which is a pretty good deal, considering how much access you get to different metrics and hardware devices. Since HA doesn’t need to interact directly it’s a gateway to lots of new data sources.
Here is where i am the mqtt export exports data to the mqtt broker in home assistant and listening to the topic brings in a mass of data (which I don’t know how to deal with) there is a catch using mqtt for this transfer of data in that the auto export app needs to be in the foreground on the iphone.
There is a dedicated HA export which uses a long lived access token and exports the data to https://yourhomeassistant:8123/api/states/hae.applehealth
I think this is working although i find some data fails but that maybe because there is no data for that metric in apple health.
So this is where I am stuck I’m probably getting data to HA successfully but no idea how to create a sensor to record say BMI or say Steps into a sensor that can be logged into HA of course once this data is in HA it can then be viewed and used for automations.
So I need help getting this working so far I have only found some one using it with innodb and node red to bring the data into Home assistant but its probably possible to define sensors to consume the data in HA directly.