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

RESTful sensor json_attributes_path (template / scripting)

$
0
0

@gwillen wrote:

Can’t seem to get JSONPath to work with a script. This works perfect in the JSONPath evaluation tool but doesn’t work in homeassistant. I have also tried templates and it doesn’t seem to work either. What am I doing wrong or is this not possible?

  - platform: rest
    resource: https://enviro.epa.gov/enviro/efservice/getEnvirofactsUVHOURLY/ZIP/63385/JSON
    name: UV Index
    json_attributes_path: "$[(new Date().getHours() - 6)]"
    json_attributes:
      - ORDER
      - UV_VALUE
      - DATE_TIME
    value_template: "{{ value_json[now().hour - 6].UV_VALUE }}"

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 99175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>