Hi All,
Recently I developped my own weather station and provided it with a Rest end point. To publish the data on my internal network. I provided endpoints in the following style:
http:///v1/weatherinfo_today
http:///v1/weatherinfo/search/
With the first endpoint I can easily define it in a sensor and read the data and configure it with a template.
For the second I can define 2 sensors:
- Look up the weatherinfo for today
- platform: rest
name: weather_of_today
json_attributes:
- ...
resource_template: http://<internal site of weathersation>/v1/weatherinfo/search/{{ states('sensor.date') }}
value_template: "{{ states('sensor.date') }}"
I see on the date the correct info.
- Look up the weatherinfo for a specific day
I use an input text field to provide the specific date.
- platform: rest
name: weather_of_date_search
json_attributes:
- ...
resource_template: http://<internal site of weathersation>/v1/weatherinfo/search/{{ states('input_text.date') }}
value_template: "{{ states('input_text.date') }}"
Now to get directly the new data of the endpoint for the date entered in the input text, I created an automation that looks for a change in the value of the input text field. In the automation I specified the following command:
- service: rest.reload
data: {}
Are there ways to do only a reload of one specific rest api endpoint? As I have a lot of rest end points configured in my Home Assistant, I don’t want to reload all of them for performance reasons.