The gist should work as a custom component, but you’ll need to edit some of the values to make it work for you. Specifically, you’ll need to edit the client_id and secret. These values you’ll get by setting up an app and making sure the fit api is enabled. You should be able to use the https://home-assistant.io/components/calendar.google/ instructions as a guide
edit: I just edited the gist to add a fix that could be causing some warnings in the logs
I don’t have any immediate plans to. I’ve noticed it’s not super consistent in pulling steps, so that would require some work, also all the client logic would need to get pulled out and implemented in it’s own library that gets pulled in as a requirement in order for the component to be accepted. I don’t have any really useful automations that use it in my set-up, so I don’t really want to commit to maintaining and supporting it, but if someone wants to build it out, I’d be happy to offer any sort of assistance that I can
I was trying to achieve something similar. Mainly focused on weight, but happy to see if it can be extended for other attributes.
This is my custom_compoments/sensor/google_fit.py:
While it is focused on weight, it could be updated to other type of data by changing:
API_SCOPE = ‘https://www.googleapis.com/auth/fitness.body.read’
and
weight_datasources = self._get_datasources(‘com.google.weight’)
(as well as selecting the right attributes afterwards)
I hope it is useful.
If someone wants to partner to extend this and integrate it natively, happy to do so.
You know what it is now populating lol what is the poll time for these sensors I swear it been up for a few days and even this morning they were still unknown state.
Is it possible to get the latest version of your component?
@maurizio53 This component is working for me on 0.84.6 is this what you mean or are you running a beta release? If so you can’t surely expect support running on beta.
I have my sleep being synced with google fit also do you think you could help me to get this sensor also? I had a look at the google api and there is a call for sleep data but I can’t seem to find it at the moment.