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

REST Sensor - passing !secrets

$
0
0

@klogg wrote:

Am I right in thinking the headers in a REST sensor are a list of parameters that can be passed to the calling resource_template?

Specifically does this config…

  - platform: rest
    resource_template: http://api.weatherapi.com/v1/history.json?dt={{ now().strftime('%Y-%m-%d') }}
    headers:
      key: !secret weatherapi_api_key
      q: !secret weather_api_location

produce the URL I am hoping for?
i.e…

http://api.weatherapi.com/v1/history.json?dt=2020-06-02&key=[ MY_SECRET_KEY ]&q=[ MY_SECRET_LOCATION ]

Because it doesn’t seem to work… Or have I completely misunderstood something?
In which case is there way to create the resource and still keep my secrets secret?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 102594

Trending Articles