Template sensors help

I am trying to create a bunch of “firmware update available” sensors similar to the HA one for all my other devices. I have created 2 sensors one the scrapes the current firmware version and one that scrapes the most up to date one.

What I would like to do is compare the most recent with the one I have if the new one is higher then the current one return value of the most current with the friendly_name "xx Update Available.
If they match change the state to ‘no’ (so I can use this state change for automations) and hide the sensor from the UI.

Is this possible with template sensor I’m a little stuck.

Yes this is possible. The easiest is to use 3 sensors per device.

  • currently installed, sensor component
  • latest available, sensor component
  • update available (current <> latest), binary sensor component

Yes that is what my thoughts were I’m just not sure how to structure the binary sensor update available with the states gained from the first 2 sensors.

Something like:

binary_sensor:
  - platform: template
    sensors:
      ha_update_available:
        value_template: >-
          {{ states.sensor.ha_current_stable_version.state != states.sensor.ha_installed_version.state and
             states.sensor.ha_current_stable_version.state != 'unavailable' }}
1 Like

This worked I forgot to thank you cheers

1 Like