Hello, I’m trying to develop my first custom integration. I have it in a place now where when I install or restart HA, all of the entities are populated properly and accurately. I have implemented a coordinator with the following code, but my entity is never refreshed and my update_method is never called again. I’ve reread the documentation several times but I don’t see what I’m missing. Can someone point me in the right direction?
Post a link to the rest of your code. Your update method and whether you have the _handle_coordinator_update method in your entities with self.async_write_ha_state()
Hello, I think I have a similar problem. My coordinator never calls _async_update_data() after setting update_interval. I don’t know where the problem would be, because async_config_entry_first_refresh() works correctly for me and the sensor values are reloaded when I restart Home Assistant.
I do not use callbacks in coordinator, because I use them in a special HeatPump class, which takes care of updating values in Home Assistant (perhaps that is the problem?).
All I need is to call the HeatPump.async_fetch_all_data() function every minute, for which I wanted to use the _async_update_data() service, but it doesn’t work for me, do you know where the problem might be?
Thank you for your response.
init.py entry function
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up MasterTherm from a config entry."""
hp = HeatPump(hass, entry.data["ip_address"])
coordinator = HeatPumpCoordinator(hass, hp)
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = coordinator
await coordinator.async_config_entry_first_refresh()
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True