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

Two collars - only one added w/ errors #62

Open
Mason10198 opened this issue Feb 10, 2023 · 4 comments
Open

Two collars - only one added w/ errors #62

Mason10198 opened this issue Feb 10, 2023 · 4 comments

Comments

@Mason10198
Copy link

My scenario consists of the following:

  • Home Assistant OS
  • HASS-TryFi (installed via HACS)
  • 2x Fi Series 3 Collars
  • 2x Fi Series 3 Bases
  • 1x Fi Series 2 Base

I have been using HASS-TryFi for a while now with no issues, with only ONE collar and ONE base. I just added a second collar/base to my Fi setup, and upon removal/re-initialization of the HASS-TryFi integration, some of the entities are not being integrated. Dog1s collar & base, the old Series 2 base, and Dog2s base are picked up, but Dog2s collar is missing. Image attached, sensitive information removed.

Screenshot

I have removed/reinstalled HASS-TryFi, tried manually installing, several full reboots of my Home Assistant OS machine, etc, all to no avail. Logs are included below, sensitive information removed.

2023-02-08 07:31:16.620 INFO (MainThread) [custom_components.tryfi] Success Connecting to TryFi
2023-02-08 07:31:18.875 INFO (MainThread) [homeassistant.components.device_tracker] Setting up device_tracker.tryfi
2023-02-08 07:31:18.875 INFO (MainThread) [homeassistant.components.light] Setting up light.tryfi
2023-02-08 07:31:18.876 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.tryfi
2023-02-08 07:31:18.876 INFO (MainThread) [homeassistant.components.select] Setting up select.tryfi
2023-02-08 07:31:18.876 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.tryfi
2023-02-08 07:31:18.880 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new light.tryfi entity: light.dog1_collar_light
2023-02-08 07:31:18.881 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.dog1_collar_battery_level
2023-02-08 07:31:18.882 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.dog1_daily_steps
2023-02-08 07:31:18.882 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.dog1_weekly_steps
2023-02-08 07:31:18.883 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.dog1_monthly_steps
2023-02-08 07:31:18.883 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.dog1_daily_distance
2023-02-08 07:31:18.884 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.dog1_weekly_distance
2023-02-08 07:31:18.884 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.dog1_monthly_distance
2023-02-08 07:31:18.884 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.dog1_daily_sleep
2023-02-08 07:31:18.889 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.dog1_weekly_sleep
2023-02-08 07:31:18.890 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.dog1_monthly_sleep
2023-02-08 07:31:18.890 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.dog1_daily_nap
2023-02-08 07:31:18.891 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.dog1_weekly_nap
2023-02-08 07:31:18.891 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.dog1_monthly_nap
2023-02-08 07:31:18.891 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.dog1_activity_type
2023-02-08 07:31:18.892 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.dog1_current_place_name
2023-02-08 07:31:18.892 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.dog1_current_place_address
2023-02-08 07:31:18.893 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.dog1_connected_to
2023-02-08 07:31:18.893 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.dog1s_base
2023-02-08 07:31:18.894 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.og_base
2023-02-08 07:31:18.895 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new sensor.tryfi entity: sensor.dog2s_base
2023-02-08 07:31:18.895 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new select.tryfi entity: select.dog1_lost_mode
2023-02-08 07:31:18.896 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new binary_sensor.tryfi entity: binary_sensor.dog1_collar_battery_charging
2023-02-08 07:31:19.261 INFO (MainThread) [homeassistant.helpers.entity_registry] Registered new device_tracker.tryfi entity: device_tracker.dog1_tracker
2023-02-08 07:31:19.262 ERROR (MainThread) [homeassistant.components.light] Error adding entities for domain light with platform tryfi
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 549, in _async_add_entity
    device_info = entity.device_info
  File "/config/custom_components/tryfi/light.py", line 90, 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'
2023-02-08 07:31:19.267 ERROR (MainThread) [homeassistant.components.sensor] Error adding entities for domain sensor with platform tryfi
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 549, in _async_add_entity
    device_info = entity.device_info
  File "/config/custom_components/tryfi/sensor.py", line 376, 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'
2023-02-08 07:31:19.270 ERROR (MainThread) [homeassistant.components.select] Error adding entities for domain select with platform tryfi
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 549, in _async_add_entity
    device_info = entity.device_info
  File "/config/custom_components/tryfi/select.py", line 66, 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'
2023-02-08 07:31:19.271 ERROR (MainThread) [homeassistant.components.binary_sensor] Error adding entities for domain binary_sensor with platform tryfi
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 549, in _async_add_entity
    device_info = entity.device_info
  File "/config/custom_components/tryfi/binary_sensor.py", line 88, 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'
2023-02-08 07:31:19.279 ERROR (MainThread) [homeassistant.components.light] Error while setting up tryfi platform for light
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 301, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 549, in _async_add_entity
    device_info = entity.device_info
  File "/config/custom_components/tryfi/light.py", line 90, 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'
2023-02-08 07:31:19.280 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up tryfi platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 301, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 549, in _async_add_entity
    device_info = entity.device_info
  File "/config/custom_components/tryfi/sensor.py", line 376, 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'
2023-02-08 07:31:19.280 ERROR (MainThread) [homeassistant.components.select] Error while setting up tryfi platform for select
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 301, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 549, in _async_add_entity
    device_info = entity.device_info
  File "/config/custom_components/tryfi/select.py", line 66, 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'
2023-02-08 07:31:19.281 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up tryfi platform for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 301, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 549, in _async_add_entity
    device_info = entity.device_info
  File "/config/custom_components/tryfi/binary_sensor.py", line 88, 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'
2023-02-08 07:31:20.203 ERROR (MainThread) [homeassistant.components.device_tracker] Error adding entities for domain device_tracker with platform tryfi
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 549, 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'
2023-02-08 07:31:20.204 ERROR (MainThread) [homeassistant.components.device_tracker] Error while setting up tryfi platform for device_tracker
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 301, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 442, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 549, 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'
@17kisern
Copy link

17kisern commented Feb 17, 2023

Very similar experience for myself. It looks like the underlying Python library that @sbabcock23 wrote, of which this Home Assistant integration is a wrapper for, got an update just last week, while this integration hasn't been updated since December. Looking at the classes inside the Python library, it looks like the variables are in fact present, and haven't been touched in the recent library update, so my best guess is something else in the recent update is crashing(?), and the whole library is in an unknown state. Or simply the Home Assistant integration needs to be updated to use the latest pytryfi library, as @rjshade did predict query failures would start to occur without his update.

@rjshade , do you think these errors are related to the Query failures you predicted would happen in the latest pytryfi release?

Including my own stacktrace as a point of reference

  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 182, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 330, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 135, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 390, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 566, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 607, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 572, in _stringify_state
    if (state := self.state) is None:
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1007, in state
    if (is_on := self.is_on) is None:
  File "/config/custom_components/tryfi/light.py", line 74, in is_on
    return bool(self.pet.device.ledOn)
  File "/usr/local/lib/python3.10/site-packages/pytryfi/fiDevice.py", line 68, in ledOn
    return self._ledOn
AttributeError: 'FiDevice' object has no attribute '_ledOn'```

@rjshade
Copy link

rjshade commented Feb 17, 2023

I don't think any of these failures are related to the schema change I mentioned. It looks like FiPet._breed and FiDevice._ledOn should be set on successful query responses from the server. Perhaps something is failing with these queries?

@jldeen jldeen mentioned this issue Mar 10, 2023
@jldeen
Copy link

jldeen commented Mar 12, 2023

@17kisern and @Mason10198 There has been a new release of hass-tryfi and the underlying package pytryfi - the new version is 0.0.19 and I believe should resolve the issues in this thread. Could you please update to the latest version and close this issue if you are all set? 😀

@17kisern
Copy link

I am no longer receiving these errors/bugs after updating to the latest version, thank you @jldeen! Since @Mason10198 created this issue, it's up to him to close it out

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

4 participants