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

Using self.async_update_ha_state() #99

Closed
ercsey opened this issue May 4, 2023 · 9 comments · Fixed by #103
Closed

Using self.async_update_ha_state() #99

ercsey opened this issue May 4, 2023 · 9 comments · Fixed by #103

Comments

@ercsey
Copy link

ercsey commented May 4, 2023

Hello.

After updating Home Assistant to version 2023.5.0 this message appeared in the error log:

Entity var.room_1_saved_target (<class 'custom_components.var.Variable'>) 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.

Could you please take a look to it? Thank you.

@snarky-snark
Copy link
Owner

Does this still appear for you on 2023.5.3? It looks like the warning was potentially erroneous up until then.

home-assistant/core#91387

@ercsey
Copy link
Author

ercsey commented May 16, 2023

Does this still appear for you on 2023.5.3? It looks like the warning was potentially erroneous up until then.

home-assistant/core#91387

Yes it's still present in the logs even after updating to HA version 2023.5.3

@rmkew377
Copy link

Hi, same here:

Protokolldetails (WARNUNG)
Logger: homeassistant.helpers.entity
Source: helpers/entity.py:560
First occurred: 31. Mai 2023 um 23:00:00 (3 occurrences)
Last logged: 31. Mai 2023 um 23:59:45

Entity var.tsoll_studio_new (<class 'custom_components.var.Variable'>) 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 var.gas_per_day (<class 'custom_components.var.Variable'>) 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 var.burner_daily_runtime (<class 'custom_components.var.Variable'>) 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.

HA:

Home Assistant 2023.5.4
Supervisor 2023.04.1
Operating System 10.2

var Component:

{
"domain": "var",
"name": "Variable",
"version": "0.15.0",

@waldmeisterx
Copy link

Hi,
it's still there also in HA 2023.6.3

Logger: homeassistant.helpers.entity
Source: helpers/entity.py:565

Entity var.nina_birthday_days2go (<class 'custom_components.var.Variable'>) 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.

home-assistant-variables
v0.15.0

@pdwonline
Copy link

Hi,

Got this too and stiil there in HA 2023.8.1

@mcpfr
Copy link

mcpfr commented Aug 30, 2023

Hello,

I have the same warning, I am in HA 2023.8.4

2023-08-30 11:19:04.490 WARNING (MainThread) [homeassistant.helpers.entity] Entity var.stock_mode_absent (<class 'custom_components.var.Variable'>) 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.

@alex-v-fraser
Copy link

System Information

version core-2023.9.1
installation_type Home Assistant Supervised
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.5
os_name Linux
os_version 6.1.19-v8+
arch aarch64
config_dir /config
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Debian GNU/Linux 11 (bullseye)
update_channel stable
supervisor_version supervisor-2023.09.2
agent_version 1.4.1
docker_version 23.0.2
disk_total 113.1 GB
disk_used 20.2 GB
healthy true
supported true
supervisor_api ok
version_api ok
installed_addons Mosquitto broker (6.3.1), Zigbee2MQTT (1.33.0-1), File editor (5.6.0), ESPHome (2023.8.3), Studio Code Server (5.10.2), Samba share (10.0.2), Asterisk (4.1.1), motionEye (0.18.0)
Dashboards
dashboards 1
resources 1
views 3
mode storage
Recorder
oldest_recorder_run September 9, 2023, 5:27 PM
current_recorder_run September 14, 2023, 7:33 PM
estimated_db_size 781.35 MiB
database_engine sqlite
database_version 3.41.2
Logger: homeassistant.helpers.entity
Source: helpers/entity.py:689 
First occurred: 15 сентября 2023 г., 20:00:00 (5 occurrences) 
Last logged: 15 сентября 2023 г., 20:00:01

Entity var.sended_counter_cold (<class 'custom_components.var.Variable'>) 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 var.sended_counter_hot (<class 'custom_components.var.Variable'>) 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 var.sended_counter_cold_bath (<class 'custom_components.var.Variable'>) 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 var.sended_counter_hot_bath (<class 'custom_components.var.Variable'>) 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 var.sended_date (<class 'custom_components.var.Variable'>) 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.

@danielbrunt57
Copy link
Contributor

danielbrunt57 commented Oct 16, 2023

I created a new pull request #103 which is slightly different than pull request #100. I also am not a python programmer so I do not know the absolute correct way of fixing this but my PR has eliminated the error message and the var integration is working for me. All I had to change was line 448:
await self.async_update_ha_state() --> await self.async_update_ha_state(True)

@enricota66
Copy link

I created a new pull request #103 which is slightly different than pull request #100. I also am not a python programmer so I do not know the absolute correct way of fixing this but my PR has eliminated the error message and the var integration is working for me. All I had to change was line 448: await self.async_update_ha_state() --> await self.async_update_ha_state(True)

I have but only tested various changes this seems to delete the warning also in my case it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
9 participants