frenck / spook

A scary 👻 powerful toolbox 🧰 for Home Assistant 🏡
https://spook.boo
MIT License
381 stars 36 forks source link

Updating state took 1.101 seconds #637

Open eikowagenknecht opened 2 months ago

eikowagenknecht commented 2 months ago

What version of Spook are you using?

2.2.2

What version of Home Assistant are you using?

2024.2.2

The problem

Getting errors in the logs.

Anything in the logs? Paste it here!

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:1152
First occurred: February 23, 2024 at 04:54:44 (1 occurrences)
Last logged: February 23, 2024 at 04:54:44

Updating state for sensor.media_players (<class 'custom_components.spook.ectoplasms.homeassistant.sensor.HomeAssistantSpookSensorEntity'>) took 1.101 seconds. Please create a bug report at https://github.com/frenck/spook/issues
DaN66O commented 2 months ago

A similar warning

Updating state for sensor.climate (<class 'custom_components.spook.ectoplasms.homeassistant.sensor.HomeAssistantSpookSensorEntity'>) took 0.768 seconds. Please create a bug report at https://github.com/frenck/spook/issues

bdraco commented 2 months ago

I was recently looking at a profile for a user and found the problem might be that when all the repairs fire and they all do a linear search of the entity registry to get the entity ids multiple times.

If the call to async_get_all_entity_ids only happened once instead of for every repair it would mostly solve the issue

Screenshot 2024-03-04 at 11 01 54 AM Screenshot 2024-03-04 at 11 09 04 AM
bdraco commented 2 months ago

Or maybe increase the debounce time as it was firing almost every 3s on the users system

robinhood-code commented 3 weeks ago

got a similar warning:

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:1161
First occurred: 9:47:19 AM (1 occurrences)
Last logged: 9:47:19 AM

Updating state for sensor.weather (<class 'custom_components.spook.ectoplasms.homeassistant.sensor.HomeAssistantSpookSensorEntity'>) took 0.617 seconds. Please create a bug report at https://github.com/frenck/spook/issues
frenck commented 3 weeks ago

@robinhood-code That was already reported above. You could consider just adding a 👍 to the start topic, instead repeating the same message 😉