Add manual update method also to triggered template sensors

Sensors can be forced to update manually with:

  - service: homeassistant.update_entity
    data: {}
    target:
       entity_id: sensor.p2000_ambulance

However this does not apply to template sensors:

NotImplementedError: Update method not implemented

Could this be added?

So we could run a automation with triggers and conditions to update in specific cases?

You can already accomplish this by using an Event trigger with a custom event

Indeed, this is what I ended up with. Nevertheless it would be a nice-to-have, which improves consistency with other sensors.

My original use-case was this:

2 Likes

More than in automations this would be useful during testing and debugging of entities. At the moment the fastest method is to create a Helper button, which imho doesn’t seem like the most elegant thing in the world. (+1)