Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 105670

Template help: value_json is undefined

$
0
0

I am trying to run this in the template editor:

  - platform: command_line
    name: Supervisor updates
    command: 'curl http://supervisor/supervisor/info -H "Authorization: Bearer $(printenv SUPERVISOR_TOKEN)" | jq ''{"newest_version":.data.version_latest,"current_version":.data.version,"addons":[.data.addons[] | select(.version != .installed)]}'''
    value_template: "{{ value_json.addons | length }}"
    json_attributes:
    - newest_version
    - current_version
    - addons

and I get UndefinedError: ‘value_json’ is undefined
It seems to work as a template.
I see after searching that you you will need to declare the contents of that variable in the editor by using the ‘set’ command.
How do I do this make make this run in the editor?

Thanks.

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 105670

Trending Articles