@fivestones Happy to help, here is a bit more information - I can provide even more if needed.
The URL to use is: https://homeassistanturl/api/webhook/health. Health in my example is what I named the webhook in Node Red, if it’s named something else the name goes here.
For node red export, you should be able to paste it into the import screen (right side menu). This represents the entire flow i’m using.
Thanks for that info. I’d be happy to add you on as a tester. If you get in touch via the contact link, I can get your email to add to the list.
I’ve been in touch with @akeslo, as a starting point, I’m working on some better documentation, so it’s easier to work with the output data, and to make it clearer how the API Export can be expected to work. I’ll then take some steps to look at direct integration, if that’d still be necessary, since it seems that maniupaliting the JSON output from the app may suffice.
It would be great if you can create this direct integration for Home Assistant ( a good push for your app too). Although the blog at sixtymeters is useful I think the setup with a webhook in NodeRed is too technical for most of us
I get that for sure! I’m still working on some updates and optimizations, and I’m incorporating a lot of user feedback. So the ability to directly connect to Home Assistant will be on of the big feature releases, and the ability to configure and sync to multiple URLs, since right now it’s only possible to configure one API configuration
It would be insteresting also to be able to push data from Auto Export directly to a MQTT broker so any system connected (Home Assistant, Node-red,….) could read those values. How about adding this feature @Lybron ?
There have been some delays along the road to finally get here but I have a beta that will post updates to the /api/states/<entity_id> endpoint.
Some of you have been in touch already by email, but if there’s anyone who would like access to the beta and you haven’t been in touch yet, just ping me.
Good news everyone. I’ve released Health Auto Export v6.0 with support for posting data to the Home Assistant entity endpoint and support for publishing to MQTT brokers.
If you run into any issues or have questions or suggestions, you’re welcome to get in touch.
Hey @Lybron … I have tried to get your app to send data to Home Assistant but cannot, I’m getting an error ‘Failed to publish’.
I’m using Nabu Casa (cloud)… maybe that has something to do with it? I’ve also tried it on my home network via the internal URL and that gives me the same error.
I managed to get this working with just Siri Shortcuts (no webhooks required), and while not optimal, figured I’d share my experience here because I think this method could be improved with added app support that could be done outside of any need for HealthKit approval.
In Shortcuts:
Shortcuts has a “Find health samples” template that queries any sample from your health data directly. So I have it grab the latest value for my weight, for example, and then send it off into Home Assistant’s existing shortcut support via the “Call Service” template, using the input_number.set_value service.
In Home Assistant:
I first needed a place for the data to go in Home Assistant, so I made an input_number helper via Configuration > Automations & Scenes > Helpers > Add Helper > Number. I’m not sure if this is the ideal service/entity to use (tried to send a state_changed event and hit some roadblocks) but at this point, the data is in Home Assistant, and I just send it into my own graph component from there.
Back to Shortcuts:
I then set up an automation to “Run Shortcut” daily after the time I usually weigh myself, and it will update directly from my phone to my instance. The downside of this is that shortcuts don’t yet support cron jobs more frequently than daily, so if you want more frequent updates, you’ll have to set up separate automations for each hour/minute you want during a day.
The method above requires an input_number to accept the data (If you know of a better way to do this please let me know)
Getting more than one type of health sample (fat %, steps, etc) would require either multiple shortcuts or special parsing beyond the method shown here
Future:
What I was thinking would make this process a little nicer would be adding another option in the app’s Siri Shortcut support to update a sensor directly rather than having to call a service. One of the nice things that would come from this in addition to health data, would be the ability to turn basically anything available to shortcuts from the phone into a sensor in Home Assistant (i.e. apps that don’t have good API integrations but support shortcuts - might be a nice way to get around refresh tokens, etc)
I also presume Apple will come out with some new Shortcut features at WWDC this year that might improve this method, so keep an eye out for those
Works great, thanks! Ended up porting over, autoexport is great but as you outlined is hindered by the limitations of iOS (forcing it to sync often is a bit of a pain).
thanks for that, i’m looking for the exact opposite, and in my opinion that’s not possible, right?
I would like to enrich my Apple Health data with the collected data in Home Assistant, I use the Xiaomi Miscale 2 integration and the Bodymiscale integration.