Sensor only works in preview?

I’m a bit lost and hoping for some guidance. I created a sensor to display a count of Add-on updates that are available using the below code:

{{- integration_entities('hassio')
    | select('match', '^update\.')
    | reject('match', '^update\.home_assistant')
    | expand
    | selectattr('state', 'eq', 'on')
    | list 
    | count
-}}

The code works in preview mode. It correctly lists the entities and shows “1” being available:

But once I save the sensor, it shows “0”.

Screenshot 2025-03-24 090238

I have never seen this happen before with a sensor. Any suggestions?

Post the sensor’s full configuration.

I created a template sensor via a helper with this code:

{{- integration_entities('hassio')
    | select('match', '^update\.')
    | reject('match', '^update\.home_assistant')
    | expand
    | selectattr('state', 'eq', 'on')
    | list 
    | count
-}}

That the Template Sensor’s template. I need to see the Template Sensor’s configuration.

  • If you created the Template Sensor via YAML, post its YAML.

  • If you created the Template Sensor as a helper via the UI, post a screenshot. (I believe that’s how you created it because you have shown a screenshot of its “Preview”)

Also, which one of those 9 add-ons has an available update?