jcgoette / baby_buddy_homeassistant

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

Only shows 4 entities #86

Closed TaddyJ closed 1 year ago

TaddyJ commented 1 year ago

Hi, I had Baby Buddy working fine for ages on Hass. Then it broke for a while and I was too lazy to fix it. recently I did tho and I've lost access to all the different sensors etc. The only things I have access to now are Diaper color/type, Feeding method/type.. I try searching for other sensors and I get nothing unfortunately. Even when I do a search through everything and I type in "sleep" I get everything else but a baby buddy sensor..

Not sure if I'm doing something wrong or its currently broken. I would like to set up notifications based on last sleep etc. attached is a picture of all it shows in the settings.

image

jcgoette commented 1 year ago

Not much to go on here...

TaddyJ commented 1 year ago

In devices & Services; image

Logs;

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 181, in _async_update_data return await self.update_method() File "/config/custom_components/babybuddy/init.py", line 198, in async_update if children_list[ATTR_COUNT] < len(self.child_ids): KeyError: 'count'

Resetting; Yeah I have. it says I need a path. but default I leave blank or put " " as stated but nothing

jcgoette commented 1 year ago

Did you use " " or "" as path?

TaddyJ commented 1 year ago

I did " " Should I leave it without a space?

TaddyJ commented 1 year ago

I just tried re adding it again with both combinations of "" and " ". each time it says "Failed to connect. I leave it out completely and it connects but with no sensors. just the 4 as stated in the previous post.

Is it maybe because I played around with a second child before (Now deleted). It may not have a default path?

jcgoette commented 1 year ago

I don't think that should matter if you removed the integration and added from scratch. Any additional logs? Do you have DEBUG log levels on?

TaddyJ commented 1 year ago

Yeah re added from scratch. Unfortunately I cannot put either "" or " " into the Path section. It will only add if I leave it blank completely.

I'll turn on debugging but if it cant pull it because its not properly integrated. not sure debugging will help.

TaddyJ commented 1 year ago

With Debugging enabled. image

Logger: custom_components.babybuddy Source: custom_components/babybuddy/init.py:198 Integration: Baby Buddy (documentation, issues) First occurred: December 30, 2022 at 6:28:48 PM (1060 occurrences) Last logged: 12:12:16 PM

Unexpected error fetching babybuddy data: 'count' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 181, in _async_update_data return await self.update_method() File "/config/custom_components/babybuddy/init.py", line 198, in async_update if children_list[ATTR_COUNT] < len(self.child_ids): KeyError: 'count'

jcgoette commented 1 year ago

Hmm. Based on error and the code in that section, it looks like you don't have any children in your BB instance?

foxalerts23 commented 1 year ago

I have the same problem. Plenty of data in babybuddy, 2 kids.

Unexpected error fetching babybuddy data: 'count' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 181, in _async_update_data return await self.update_method() File "/config/custom_components/babybuddy/init.py", line 198, in async_update if children_list[ATTR_COUNT] < len(self.child_ids): KeyError: 'count'

TaddyJ commented 1 year ago

Hmm. Based on error and the code in that section, it looks like you don't have any children in your BB instance?

I do... haha. I've been tracking him for over a year!

That being said and similar to Foxalerts, Even tho they have since been deleted. I have experimented with multiple "Children" for tracking my wifes expressing etc.

Maybe when there is multiple children the "Path" is coded different... and if it is maybe, or even if its not... the doccumentation is pretty scarce for my smooth brain to figure out where to even find the "Path" to try to fix it myself??

jcgoette commented 1 year ago

Path is just related to this.

@foxalerts23, have you also added and deleted children?

TaddyJ commented 1 year ago

Path is just related to this.

Possibly... To be honest I'm not really able to understand the commit/contribution side of things.

Is there a way for you to tell me where to find the "Path" for where my "Child" would be located so I can add it manually?

Another option would be that instead of trying to look for a child in the default path.. Maybe with its ability to pull data based on the api, Could it ask you what child based on the information returned. That way for people like Fox he can have multiple instances for each children if he wants?

jcgoette commented 1 year ago

It does pull from BB API.

The path option probably doesn't apply to you (unless you host your BB instance in a path, e.g., https://www.TaddyJ.com/BabyBuddy/)

jcgoette commented 1 year ago

Also, with log levels set to DEBUG, I would expect to see something with GET URL and GET response.

TaddyJ commented 1 year ago

There ya go.... Pulling https://myurl/ port 443 (Path left blank) and the API its pulled 16 different entities.

Not sure why I cant do that across my local network tho...

jcgoette commented 1 year ago

Not sure what you mean, but it sounds like this is resolved. 🙂

foxalerts23 commented 1 year ago

Path is just related to this.

@foxalerts23, have you also added and deleted children?

I did add a child. I deleted the integration (which worked previously) and attempted to re-install. Let me know if I should start a new issue/question.

TaddyJ commented 1 year ago

Not sure what you mean, but it sounds like this is resolved. 🙂

It appears to be... But I'm not sure why its able to work with an external url rather than an internal IP address as a host.

TaddyJ commented 1 year ago

Not sure if this should be closed out if Foxalerts is still having a similar issue. And because I found a work around doesnt really mean there still isnt the underlying issue of why I have to use an external facing address rather than a local IP/Port..

jcgoette commented 1 year ago

Did you update BB and it stopped working? If so, read through https://github.com/jcgoette/baby_buddy_homeassistant/issues/60.