Got a new REST sensor looking at a local file (updated via a python script):
- platform: rest
scan_interval: 60
resource: http://<MY_IP>:8123/config/www/json_file.txt
name: "newtest"
value_template: "Ok"
json_attributes_path: "$"
json_attributes:
- destination
- min_to_bus
JSON file looks like this:
[{
"destination": "Bellevue GE, Valavran",
"min_to_bus": 0
}, {
"destination": "Gex, L'Aiglette",
"min_to_bus": 3
}, {
"destination": "Genève, Cornavin",
"min_to_bus": 5
}, {
"destination": "Ferney, mairie",
"min_to_bus": 10
}]
I’ve played with all the normal JSON parsing tools but can’t for the life of me get the sensor to read the attribute data. The sensor merely comes back with a value of “Ok” and no attribute info. Am I missing something obvious?
Thanks as usual! Stimulating and fun (and frustrating!)
-J