Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add_body_composition service ignores entity_id parameter #146

Open
cornholio1234 opened this issue Mar 7, 2024 · 12 comments
Open

add_body_composition service ignores entity_id parameter #146

cornholio1234 opened this issue Mar 7, 2024 · 12 comments

Comments

@cornholio1234
Copy link

We habe two garmin accounts for me and my wife.
I can add both accounts and HA is fetching the data for both, but updating the weight using the service will always end up in the first account linked.
I played around and found out that the entity_id is not relevant at all. I can just enter random characters and the first account is updated with the values. Any idea how to improve this behavior to allow multiple accounts linked?

service: garmin_connect.add_body_composition
data:
  weight: 57.1
  timestamp:  2024-03-07T11:47:00
  entity_id: abc
@cornholio1234
Copy link
Author

#133 <- just saw this is just a more detailled duplicate of issue 133

@cornholio1234
Copy link
Author

cornholio1234 commented Mar 8, 2024

Just a reply on myself: I have added the integration twice - in different folders and adjusted some files so HASS sees now two integrations. This way I have two separate services I can call (one for each user). This is not nice but at all it is working. Maybe this is helpful for someone ...
image

@JossPer0
Copy link

HI, issue 133 was mine. If this works I will give it a try, but not sure how to add twice. Any steps would be very helpful.

@cornholio1234
Copy link
Author

Hi Joss, just duplicate the folder. Then go through the files and adjust the name/domain like in my picture. It is only a couple of references. Restart hass and add another (now Garminconnect2) device with the secondary credentials

@JohnNeville
Copy link

I had this issue as well!

@borpin
Copy link

borpin commented Dec 27, 2024

I'll add a 'me too'. This needs a unique device ID so the sensors created are unique to the device. Ideally, a name at setup time can be added so the sensors would be sensor.garmin_connect_<name>_weight.

@lug-gh
Copy link

lug-gh commented Jan 11, 2025

@cornholio1234 Have you customised anything other than domain and name? I did it as you wrote, but I can't add ‘Garmin Connect2’ as an integration, I get the error message {’message‘: “Invalid handler specified”} in the Home Assistant, and no image is found for the integration.

image

Edit: I have also changed the following strings to garmin_connect2, now the integration works. It still doesn't have a picture, but that doesn't matter.
image

@cornholio1234
Copy link
Author

Hi, looks like you found it - guess it was the one in const.py - i did not adjust the integration in the services.yaml but it seems to make no difference. (I have no icon for the second instance too).

@lug-gh
Copy link

lug-gh commented Jan 12, 2025

@cornholio1234

Unfortunately, I rejoiced too soon. Although I now have the garmin_connect2, the weight is uploaded to the first Garmin account of garmin_connect. I'm really wondering why this is the case, after all I explicitly specify garmin_connect2.

data:
  entity_id: sensor.weight_2
  weight: "{{trigger.to_state.state}}"
  timestamp: "{{ as_timestamp(now())  | timestamp_local}}"
  bmi: "{{ (trigger.to_state.state | float(0) / 1.86**2 )| round(1, default=0) }}"
action: garmin_connect2.add_body_composition

@cornholio1234
Copy link
Author

cornholio1234 commented Jan 12, 2025

for me it looks like this:
grafik
Maybe I renamed the services too ... or a older HA version handled the duplicate different. Sorry it is quite some time ago.
the douplicate won't be updated automatically too, so my main one is 0.2.26 and my garmin2 is 02.22.
I would try renaming the services too and add a garmin device again from scratch...

@lug-gh
Copy link

lug-gh commented Jan 12, 2025

for me it looks like this: grafik Maybe I renamed the services too ... or a older HA version handled the duplicate different. Sorry it is quite some time ago. the douplicate won't be updated automatically too, so my main one is 0.2.26 and my garmin2 is 02.22. I would try renaming the services too and add a garmin device again from scratch...

My services also have other names, Home Assistant does this automatically. However, I first logged in to garmin_connect2 with my account for testing, then logged out and logged in with the other account. I guess that despite logging out, some remnants of my account remained. I have now done it again, but with garmin_connect3, and there I only let my girlfriend log in. Now it works, really.

@cyberjunky
Copy link
Owner

Entity id used or at least the service code has been put inside the sensor class code, which wasn't the case. Can you test release 0.2.27, thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants