YorkshireIoT / ha-google-fit

Home Assistant Google Fit Custom Component
MIT License
96 stars 10 forks source link

Add service to push data to Google Fit #108

Open HydrelioxGitHub opened 11 months ago

HydrelioxGitHub commented 11 months ago

Checklist

Is your feature request related to a problem? Please describe.

No

Describe the solution you'd like

I would like to call some services to update some data from Home Assistant to Google Fit.

For example get weight for a MiScale and push it to Google Fit.

Or use my bed sensor to provide sleep information in Google Fit

Describe alternatives you've considered

I don't think there is other options.

Additional context

I've not tested this custom integration as only read sensors from Google Fit is not my current need. So maybe I've made a mistake with this feature request.

YorkshireIoT commented 11 months ago

Hi @HydrelioxGitHub,

Right now (and I can't see this changing anytime soon) this integration is just focused on reading data from Google Fit.

Writing data in the way you've asked for has a number of challenges:

Data needs to be pushed to Google Fit in an exact format.

The only feasible way I can see this happening is if some barebones services were provided and it is up to the user to format the data in the correct way

Update existing scopes

Currently all permission scopes are read-only, and updating them to read/write would be a breaking change that would require all users to re-authenticate the integration. Where possible I try to avoid these (with the exception of adding new sensors).

This could be mitigated by adding a configuration option where a user needs to opt-in to enable write permissions for services.

Code Churn + Testing

Adding this would lead to a lot of reworking the existing code base. Everything seems pretty stable now without any major issues and I wouldn't want to break this functionality. So before this could ever be done I would want some decent testing in place so I could be confident things weren't going to break before releasing it.

Amount of effort

Finally, this sort of change would require a fair amount of time and effort which I don't have right now.

TLDR

There is no definite reason why this couldn't be done in some minimal way but right now it's not a priority. If enough people are clamouring for it, then this can be revisited.

lunarok commented 7 months ago

Would like this feature. Not sure I can help for the "core" way to implement it. But if it happens to be done and like for sensor there is a way to help with PR to extend with extra data to send, I will help. ie, when there is for exemple "push weight", I can help to extend with "push activity, push xxx"