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:
I support this request.
My use-case is to split a sensor into multiple sensors by means of a number of derived template sensors. This limits the number of external calls.
# Template triggered P2000 sensors
- trigger:
- platform: template
value_template: "{{ 'Ambulancediensten' in state_attr('sensor.p2000_zhz', 'discipline') }}"
sensor:
- unique_id: "p2000_ambulance"
name: "P2000 Ambulance"
state: "{{ states('sensor.p2000_zhz') }}"
a…
3 Likes
SiriosDev
(Sirios_Dev)
August 25, 2024, 12:04am
4
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)