nielsfaber / scheduler-component

Custom component for HA that enables the creation of scheduler entities
GNU General Public License v3.0
622 stars 40 forks source link

Warning in logs related to async_write_ha_state in HA 2023.5.0+ #269

Closed xconverge closed 1 year ago

xconverge commented 1 year ago
 Logger: homeassistant.helpers.entity
Source: helpers/entity.py:560
First occurred: 1:29:30 PM (11 occurrences)
Last logged: 1:29:30 PM

    Entity switch.schedule_0b98b1 (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author.
    Entity switch.schedule_4f7d08 (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author.
    Entity switch.schedule_abf3a3 (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author.
    Entity switch.schedule_5d5b29 (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author.
    Entity switch.schedule_2de90f (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author.
alinm4 commented 1 year ago

I also have errors about scheduler after update. Mine is this:

Logger: homeassistant.setup Source: setup.py:214 First occurred: 11:17:41 (1 occurrences) Last logged: 11:17:41

Setup failed for custom integration scheduler: Unable to import component: cannot import name 'async_get_registry' from 'homeassistant.helpers.entity_registry' (/usr/src/homeassistant/homeassistant/helpers/entity_registry.py)

siebertm commented 1 year ago

You might want to update the integration. v3.2.9 changelog says it should be fixed!

siebertm commented 1 year ago

Jupp, fixed it for me, I was on v3.2.8

AdmiralStipe commented 1 year ago

Jupp, fixed it for me, I was on v3.2.8 What are you talking about? Current version is 3.2.14 and has the OP issue present.

xconverge commented 1 year ago

I am guessing the previously deprecated function they are talking about was also removed as part of this release so they were able to resolve that by using a newer version of this component. Their issue/resolution is unrelated to this issue though and should have been it's own issue instead of adding noise to this one.

coserotondo commented 1 year ago

I also have this issue after update :

Logger: homeassistant.helpers.entity Source: helpers/entity.py:560 First occurred: 17:42:20 (6 occurrences) Last logged: 17:42:20

Entity switch.schedule_6f4e67 (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author. Entity switch.schedule_790b68 (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author. Entity switch.schedule_60e747 (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author. Entity switch.schedule_768da1 (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author. Entity switch.schedule_f4feae (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author.

paszczaq commented 1 year ago

Same on my instance I'm using scheduler to set up heating and i'm getting this in logs:

Info:

Home Assistant 2023.5.2 Supervisor 2023.04.1 Operating System 10.1 Interfejs użytkownika: 20230503.3 - latest

Scheduler installed via HACS: 3.2.14

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:560
First occurred: 20:58:21 (9 occurrences)
Last logged: 20:58:21

Entity switch.schedule_salon_ogrzewanie_w_domu (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author.
Entity switch.schedule_pokoj_ogrzewanie_w_domu (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author.
Entity switch.schedule_sypialnia_ogrzewanie_w_domu (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author.
Entity switch.schedule_salon_termostat_adaptacja (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author.
Entity switch.schedule_termostat_sypialnia_adaptacja (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please report it to the custom integration author.
xconverge commented 1 year ago

Thanks @nielsfaber fixed in v3.2.15

audiophonicz commented 7 months ago

I just updated my HA from the 2023.5.2 version to the newest 2024.1.2 version, then upgraded HACS to the latest 1.33.0 version, then it wanted me to upgrade Scheduler to v3.2.15. I still get this warning in the logs on restart of HA.

Did i miss something I had to do after upgrade? I went in an re-saved the schedules to see if it would re-apply correctly but still get the warning in the logs.

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:900
First occurred: 11:27:22 AM (8 occurrences)
Last logged: 11:49:34 AM

Entity switch.schedule_d5bb6b (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please create a bug report at https://github.com/nielsfaber/scheduler-component/issues
Entity switch.schedule_822504 (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please create a bug report at https://github.com/nielsfaber/scheduler-component/issues
Entity switch.schedule_6d7da9 (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please create a bug report at https://github.com/nielsfaber/scheduler-component/issues
Entity switch.schedule_d88e8a (<class 'custom_components.scheduler.switch.ScheduleEntity'>) is using self.async_update_ha_state(), without enabling force_update. Instead it should use self.async_write_ha_state(), please create a bug report at https://github.com/nielsfaber/scheduler-component/issues
nielsfaber commented 7 months ago

@audiophonicz The self.async_update_ha_state was removed from the code in v3.2.15. So it seems you are running an older version. You can check the version by going to settings -> 'devices & services' and clicking the '1 device' under scheduler. The version is displayed here:

audiophonicz commented 7 months ago

@audiophonicz The self.async_update_ha_state was removed from the code in v3.2.15. So it seems you are running an older version. You can check the version by going to settings -> 'devices & services' and clicking the '1 device' under scheduler.

yeah no idea what that was about, I updated from 3.2.12, HACS told me it was on 3.2.15, but Settings> said 3.2.14. Redownloaded from HACS and restarted for my 1,534th time today and now they all agree im on 3.2.15 and the error is gone.

sorry about that, I should have checked better. Thanks for the quick response.