sander1988 / Indego

Home Assistant Custom Component for Bosch Indego Lawn Mower
Apache License 2.0
96 stars 29 forks source link

All entities become state unknown when one or more entities are set to disabled #234

Closed cbornemann closed 4 months ago

cbornemann commented 5 months ago

After install some entities of the mower becomes state unknown, when i rename the id of the state sensor or when i add the new lawn-mower-control via the configuration checkbox.

Installed Version: 5.7.0 HA-Version: 2024.6.3

Screenshot_20240621_193206_io homeassistant companion android

Error-log says:

Logger: homeassistant
Quelle: helpers/entity.py:965
Erstmals aufgetreten: 19:01:55 (10 Vorkommnisse)
Zuletzt protokolliert: 19:15:27

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/config/custom_components/indego/__init__.py", line 495, in _initial_update
    self.set_online_state(False)
  File "/config/custom_components/indego/__init__.py", line 658, in set_online_state
    self.entities[ENTITY_MOWER_STATE_DETAIL].set_cloud_connection_state(online)
  File "/config/custom_components/indego/mixins.py", line 83, in set_cloud_connection_state
    self.async_schedule_update_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1254, in async_schedule_update_ha_state
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 997, in async_write_ha_state
    self._async_verify_state_writable()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 965, in _async_verify_state_writable
    raise RuntimeError(f"Attribute hass is None for {self}")
RuntimeError: Attribute hass is None for <entity unknown.unknown=unknown>

Reinstallation of Indego gives error:

Logger: homeassistant.util.package
Quelle: util/package.py:55
Erstmals aufgetreten: 19:46:02 (2 Vorkommnisse)
Zuletzt protokolliert: 19:46:06

Invalid requirement 'git+https://github.com/jm-73/pyIndego.git@3.2.0'

For the moment, i go back to 5.6.1. Here are all entities working perfectly.

kimzeuner commented 5 months ago

Not sure if it is the solution but maybe you can have at look at this issue from beta version #226

cbornemann commented 5 months ago

Not working for me, i have try it.

sander1988 commented 5 months ago

The "invalid requirement" warning can be ignored. I have already checked it.

The runtime error causes the behavior you describe.

Can you explain what you mean with "renaming the id"?

cbornemann commented 5 months ago

When i change the entity-id. But the problem occures randomly at one of the entities.

sander1988 commented 5 months ago

The entity id of which entity? Please provide details, so I can try to do the exact same thing in my setup.

cbornemann commented 5 months ago

Now i have reinstalled the integration.

Then i have rename the entity-id´s, all works fine:

1

But when i reload now the integration, all entities become these states:

2

3

I don´t know, before update of 5.7.0 all works fine.

Is the problem, that i disable the entity "state detail" and some other that i don´t need?

cbornemann commented 5 months ago

Okay the problem entities are: mower_state_detail and runtime_total.

When i disable one of these entities and reload the integration, the integration crashed.

sander1988 commented 5 months ago

I guess disabling the entity is the problem here. Can you re-enable and restart HA?

sander1988 commented 5 months ago

I have tested it. Caused by disabling one or more entities. It breaks updating the state update call.

Workaround: Do not disable entities; you can use the hide toggle for now.

cbornemann commented 5 months ago

Thank you, thats it!

sander1988 commented 5 months ago

Thank you for confirming! We try to fix this in the next release. But workaround should be ok for now.

sander1988 commented 4 months ago

Please test with pre-release 5.7.1 to see if the issue has been resolved.

cbornemann commented 4 months ago

Problem is fixed with 5.7.2! Thank you!