Hello,
I have a command_line sensor which is used to retrieve information from a Meteo France API using curl. The objective is to retrieve the content and push it as json to two attributes as you can see below.
I then use these attributes for some other sensors and automations.
Here is the command_line sensor code :
command_line:
- sensor:
name: niveaux_vigilances
unique_id: niveaux_vigilancesa
scan_interval: 1800
command: >
curl -X GET "https://public-api.meteofrance.fr/public/DPVigilance/v1/cartevigilance/encours" -H "accept: */*" -H "apikey: xxxxx==" | jq '{ "today": .product.periods[0].timelaps.domain_ids, "tomorrow": .product.periods[1].timelaps.domain_ids }'
json_attributes:
- today
- tomorrow
My issue is that this command_line sensor only updates at HA reload.
It does not update at periodic intervall as I would like using the scan_interval.
I just verfied when writing this post, and the current content of this sensor does not fit the reality returned by the API ; it stills contains the value from yesterday when I restarted HA.
Thank you for your help