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

Reinstall causes only base to be added, no collar/sensor entities - log mentions no _breed attribute #67

Open
loafbutts opened this issue Apr 17, 2023 · 18 comments

Comments

@loafbutts
Copy link

Hello again! I think an update on Fi's end may have broken the integration again.

I just activated a new collar on my Fi account, and reinstalled the integration to update my entities, but unfortunately it only found the base, not the collars, etc. Even the entities for the older collar are gone. There's an error in the log very similar to past incidents of Fi changing something and gumming up the works, this time with the spoiler attribute being "_breed".

Relevant log entry:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 455, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 563, in _async_add_entity
device_info = entity.device_info
File "/config/custom_components/tryfi/device_tracker.py", line 91, in device_info
"model": self.pet.breed,
File "/usr/local/lib/python3.10/site-packages/pytryfi/fiPet.py", line 291, in breed
return self._breed
AttributeError: 'FiPet' object has no attribute '_breed'

@loafbutts
Copy link
Author

Just me on this one? I've tried re-adding the integration since, and now it doesn't populate any entities at all, not even the base.

@loafbutts
Copy link
Author

loafbutts commented May 24, 2023

Found a workaround! Simply going into /config/custom_components/tryfi/ , editing binary_sensor.py, device_tracker.py, light.py, select.py, and sensor.py (line appears 3 times in that last one), and changing the line

"model": self.pet.breed,

so that it reads

"model": "Dog",

in each file, then re-adding the integration, got all of my devices and entities to re-populate. All of them seem to be working fine again, and the workaround survived a hard reboot. I assume somewhere in the integration that would normally populate the dogs' breeds now simply shows "Dog" instead, but it's a small price to pay to get the integration up and running again, IMHO. Hope this helps a few people out of similar troubles.

@cladkins
Copy link

Just gave this a shot with Dog and Labradoodle. No joy.

@matthai5
Copy link

matthai5 commented Aug 3, 2023

Same issue here, only base is working.

@mattfox27
Copy link

same issue

@eternistarr
Copy link

eternistarr commented Nov 21, 2023

Same thing here. All my collars became unavailable. I cleared out the integration and readded it only base stations show up

@mattfox27
Copy link

Found a workaround! Simply going into /config/custom_components/tryfi/ , editing binary_sensor.py, device_tracker.py, light.py, select.py, and sensor.py (line appears 3 times in that last one), and changing the line

"model": self.pet.breed,

so that it reads

"model": "Dog",

in each file, then re-adding the integration, got all of my devices and entities to re-populate. All of them seem to be working fine again, and the workaround survived a hard reboot. I assume somewhere in the integration that would normally populate the dogs' breeds now simply shows "Dog" instead, but it's a small price to pay to get the integration up and running again, IMHO. Hope this helps a few people out of similar troubles.

Is this fix still working?

@loafbutts
Copy link
Author

The integration has remained functional for me since I made that post, but I'm still on the same install. No idea if it would still work if I tried to reinstall again. I'm not sure why it wouldn't work for cladkins back in July, unless a Fi update had already broken the workaround by then.

@mattfox27
Copy link

mattfox27 commented Nov 24, 2023

The integration has remained functional for me since I made that post, but I'm still on the same install. No idea if it would still work if I tried to reinstall again. I'm not sure why it wouldn't work for cladkins back in July, unless a Fi update had already broken the workaround by then.

Ya I just wanted to check before trying your fix, ill give it a shot

Do you put your pets name in "model": "Dextrer" or just like "model": "Dog",

@mattfox27
Copy link

The integration has remained functional for me since I made that post, but I'm still on the same install. No idea if it would still work if I tried to reinstall again. I'm not sure why it wouldn't work for cladkins back in July, unless a Fi update had already broken the workaround by then.

So I made the changes and restarted HA and now it works awesome!!!! Cool thanks for the help

@eternistarr
Copy link

Found a workaround! Simply going into /config/custom_components/tryfi/ , editing binary_sensor.py, device_tracker.py, light.py, select.py, and sensor.py (line appears 3 times in that last one), and changing the line

"model": self.pet.breed,

so that it reads

"model": "Dog",

in each file, then re-adding the integration, got all of my devices and entities to re-populate. All of them seem to be working fine again, and the workaround survived a hard reboot. I assume somewhere in the integration that would normally populate the dogs' breeds now simply shows "Dog" instead, but it's a small price to pay to get the integration up and running again, IMHO. Hope this helps a few people out of similar troubles.

This didn't work for me :(

@mattfox27
Copy link

mattfox27 commented Dec 14, 2023

It worked for me...try restarting HA

@sbabcock23
Copy link
Owner

Released new version 0.0.21 with better error handling. Please @mattfox27 or @eternistarr if the latest version resolves the issue.

@mattfox27
Copy link

mattfox27 commented Dec 14, 2023 via email

@eternistarr
Copy link

Released new version 0.0.21 with better error handling. Please @mattfox27 or @eternistarr if the latest version resolves the issue.

No joy. I removed the integration completely and re added it.
Screenshot_20240102-153057

@mattfox27
Copy link

It's working for me

@eternistarr
Copy link

So I tried pairing the new update with that fix above changing
"model": self.pet.breed,

so that it reads

"model": "Dog",

This also didn't work. The Integration stopped working soon as the cats nano chip was added to tryfi. I don't see any errors in logs or anything. Just the depreciation warnings.

@eternistarr
Copy link

Yup deleted the cats profile and my collars loaded up immediately

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