Rest version sensor without state

using the https://www.home-assistant.io/version.json resource for version in a rest sensor like this:

  - platform: rest
    name: Hassio version
    resource: https://www.home-assistant.io/version.json
    value_template: >
      {{ value_json.value }}
    json_attributes:
      - current_version
      - release_date
      - release_notes
      - release_notes_path
      - release_title
      - release_description
      - patch_version_notes
      - root_url
      - semantic_version

shows all in attributes, but creates no state for the sensor…

How could I set the ‘current_version’ as sensor, and still use the value_template to create the json_attributes?

thanks for having a look

should be

    value_template: >
      {{ value_json.current_version}}

Thanks , thought about that of course :wink: but would that allow for all the attributes as I have them now?

edit

yes it does!

feared the attributes were taken from the root of the sensor, apparently not. so much the better…

thanks, marked solved.

1 Like

next up, the Beta sensor :wink:

  - platform: rest
    name: Ha current beta version
    resource: https://s3.amazonaws.com/hassio-version/beta.json
    value_template: >
      {{ value_json.homeassistant.default }}
    scan_interval: 86400
    json_attributes:
      - channel
      - supervisor
      - hassos
      - hassos-cli
      - dns

would probably give me the attributes, but I dont need the full set for hassos, only the rpi3:

{
  "channel": "beta",
  "supervisor": "185",
  "homeassistant": {
    "default": "0.98.3",
    "qemux86": "0.98.3",
    "qemux86-64": "0.98.3",
    "qemuarm": "0.98.3",
    "qemuarm-64": "0.98.3",
    "intel-nuc": "0.98.3",
    "raspberrypi": "0.98.3",
    "raspberrypi2": "0.98.3",
    "raspberrypi3": "0.98.3",
    "raspberrypi3-64": "0.98.3",
    "raspberrypi4": "0.98.3",
    "raspberrypi4-64": "0.98.3",
    "tinker": "0.98.3",
    "odroid-c2": "0.98.3",
    "odroid-xu": "0.98.3",
    "orangepi-prime": "0.98.3"
  },
  "hassos": {
    "ova": "2.12",
    "rpi": "2.12",
    "rpi0-w": "2.12",
    "rpi2": "2.12",
    "rpi3": "2.12",
    "rpi3-64": "2.12",
    "rpi4": "3.4",
    "rpi4-64": "3.4",
    "tinker": "2.12",
    "odroid-c2": "2.12",
    "odroid-xu4": "2.12",
    "opi-prime": "2.12",
    "intel-nuc": "2.12"
  },
  "hassos-cli": "14",
  "dns": "1"
}

how can I set that in the attributes?