Sure, "TypeError: '>' not supported between instances of 'str' and 'float'", but where?

Post the code for

blueprints/template/homeassistant/inverted_binary_sensor.yaml
➜  config cat blueprints/template/homeassistant/inverted_binary_sensor.yaml

blueprint:
  name: Invert a binary sensor
  description: Creates a binary_sensor which holds the inverted value of a reference binary_sensor
  domain: template
  source_url: https://github.com/home-assistant/core/blob/9f1b6a12a510db2d3ef636185ca38a524ffa21e8/homeassistant/components/template/blueprints/inverted_binary_sensor.yaml
  input:
    reference_entity:
      name: Binary sensor to be inverted
      description: The binary_sensor which needs to have its value inverted
      selector:
        entity:
          domain: binary_sensor
variables:
  reference_entity: !input reference_entity
binary_sensor:
  state: >
    {% if states(reference_entity) == 'on' %}
      off
    {% elif states(reference_entity) == 'off' %}
      on
    {% else %}
      {{ states(reference_entity) }}
    {% endif %}
  # delay_on: not_used in this example
  # delay_off: not_used in this example
  # auto_off: not_used in this example
  availability: "{{ states(reference_entity) not in ('unknown', 'unavailable') }}"

Well, I’m not sure what to tell you. I’m 100% certain it’s coming from a template sensor with a trigger, and that it’s coming from that action section. I guess at this point, it’s time for you to manually look through every file.

Thanks for spending time on this, @petro.

I think grep has found all the templates with >, but I also went through every single file searching for action:/actions: and manually reviewing.

Not fool proof, of course. Which is why I’m now running with a lot fewer package files loading.

It’s also odd that with the exception I’m not seeing the results of that error – like in a dashboard somewhere or a failed automation.

Perhaps you could create an automation that runs when the error occurs and get more information.

A couple of more errors this afternoon. And that’s with only three small packages loaded. Must be somewhere else.

They are not frequent errors, so maybe just live with them for now.

➜  ~ ha core logs -n 20000 | grep float | grep ERROR | grep 02-12
2026-02-12 14:20:33.668 ERROR (MainThread) [homeassistant.helpers.script.trigger_update_coordinator] Trigger Update Coordinator: Error executing script. Error rendering template for variables at pos 1: TypeError: '>' not supported between instances of 'str' and 'float'
2026-02-12 16:57:02.053 ERROR (MainThread) [homeassistant.helpers.script.trigger_update_coordinator] Trigger Update Coordinator: Error executing script. Error rendering template for variables at pos 1: TypeError: '>' not supported between instances of 'str' and 'float'
➜

Hi @petro -- I was looking at this again this morning and remembered this comment of yours:

I assume that when it stops it means the state never gets updated, which means I can't look in the DB to see what entity might have changed at the time of the error.

Do you think it could be possible to catch that specific error, log it, but then let the code continue so that (maybe) the state or attribute is updated and then can see what entities changed about that time?

Sure, the state or attribute might be wrong (because guessed wrong on the '>' test), but just as a temporary measure to narrow down where this is happening.

Not the template code, of course, but another option might be for that error (which I assume is generated by Jinja) to print the string and float that it is trying to compare as a hint for what to look for.

Thanks,