jcgoette / baby_buddy_homeassistant

This custom integration provides sensors for Baby Buddy API endpoints.
MIT License
59 stars 26 forks source link

Failed To Connect #113

Closed gavinsauder closed 11 months ago

gavinsauder commented 1 year ago

Trying to add integration to home assistant causes this error.

Host: https://babybuddy.sub.domain.com Port: 443 API: ****

This causes a failed to connect error. I'm using all the correct info but does not work.

jcgoette commented 12 months ago

https://github.com/jcgoette/baby_buddy_homeassistant/issues/111#issuecomment-1590982185

rwelsh09 commented 11 months ago

After reading through both threads you mention I haven't found a solution for connecting the integration to the add-on

rwelsh09 commented 11 months ago

Solution!

The port has to be manually set. This isn't mentioned in the setup instructions.

jcgoette commented 11 months ago

Cool. Sounds like something you should bring up on the addon's repository.

gavinsauder commented 11 months ago

This solution may work for the addon on. But I'm not using the addon. That solution does not work for my use case.

jcgoette commented 11 months ago

Is your BB actually located at a sub-subdomain like your post suggests?

gavinsauder commented 11 months ago

@jcgoette yes, thats correct. Its hosted in a docker container. It can be accessed directly just fine. But unable to add to HA integration.

jcgoette commented 11 months ago

Set logs to DEBUG and post what you see. There should be at least a line showing Client URL:

gavinsauder commented 11 months ago

I think this is what your asking for. I confirmed these are the correct urls before redacting them.

2023-08-07 19:32:42.861 DEBUG (MainThread) [custom_components.babybuddy.client] Initializing BabyBuddyClient 2023-08-07 19:32:42.861 DEBUG (MainThread) [custom_components.babybuddy.client] Client API Token, obfuscated: 1da7................................6328 2023-08-07 19:32:42.861 DEBUG (MainThread) [custom_components.babybuddy.client] Client URL: https://babybuddy.***.*********.com:443 2023-08-07 19:32:42.862 DEBUG (MainThread) [custom_components.babybuddy.client] GET URL: https://babybuddy.***.*********.com:443/api/

jcgoette commented 11 months ago

Does the Failed to connect error happen right after that line? Or is there more?

Is your HA instance reaching external web services for anything else?

gavinsauder commented 11 months ago

Ah I got it. My bad. My HA Instance is on a different vlan than my docker server/babybuddy. I needed to allow it through my firewall to enable access from HA to babybuddy. Your comment helped me realize my error. Thanks for your time.