WTH homeassistant.update_entity does not support devices?

Trying to change device polling interval.
There is an official instruction how to do this: disable default polling for device and trigger homeassistant.update_entity with custom automation.

Sounds simple. But:

  • I can disable/enable default polling only on device level, not for a single entity.
  • I can call homeassistant.update_entity service for individual entities only, not for a whole device.

The device I work with contains 33 entities. So, the only correct way to change polling frequency is to list all 33 entities in my automation. Doesn’t look to be good.

When you update a single entity in a device that has polling, all adjacent entities created in that device will also update.

So in reality, you only need to list a single entity from a device.

Just an FYI.

That should at least be documented here: Home Assistant Core Integration - Home Assistant

By the way, that seems counterintuitive to write automation that updates single entity when a whole device update is needed.

It’s just how things work under the hood. If you have an endpoint that provides 47 pieces of data, do you want to do 47 requests for singular data or 1 request for 47 data?

HA will perform 1 request to update the entity but all other data that comes through the request also updates its associated entity.

It’s built like this to reduce api calls so that users don’t go over usage limits, or things like usage limits.

Did I understand correctly:
This behavior is integration dependent.
When update_entity service is called for an entity, HA calls it for a single entity.
Integration that provided the entity usually updates all its entities when any update is called (just because usually it is the most simple and effective way).
But that is not guaranteed: another integration can update only half of entities or a single one in the same case.
?

Yes, but at this point, all polled integrations setup via the UI that support update entity have a coordinator that does this.

1 Like

Thanks for your practical advice.
So, in fact I can update single entity for any polled integration and the whole device will be updated).

By the way, WTH is still here:

  • at least that should be mentioned in documentation;
  • why not having intuitive device update syntax instead of this hidden behavior?

I’m not arguing against the WTH, simply pointing out how it works.