Template Sensor Help with Entity ID

Hi Guys,

I have the following template that is based off a device_class rather then entity_id any idea how I can impliment this correctly after 0.80.0

sensor:
  - platform: template
    sensors:
      door_count:
        value_template: >-
           {{ states.binary_sensor | selectattr('state', 'eq', 'on') | selectattr('attributes.device_class', 'eq', 'door') | list | count | int }}

The new template sensor update seems a little wonky to me.

It looks like your only option is to use the update_entity service in an automation (unless someone who knows more than me comes along and says otherwise :wink:).

I can’t really find any info on it specifically but it looks like you need to trigger an automation at whatever interval you want it to update with the update_entity service and the entity_id.

I found this example:

- alias: '_Template Clock'
  initial_state: true
  trigger:
    - platform: time
      minutes: '/1'
  action:
    - service: homeassistant.update_entity
      entity_id: sensor.occupants

Well that fells like a backwards step I will just do it with Node-RED thanks.