Hi All,
I have or will have a js function to GET JSON data from an API endpoint (weather). What I want to do is to pass into the function the lat/long pair as well as the API key. From there I want to create various sensors to display on a weather view in the dashboard.
Any guidance on how this may work? Point me to some light reading? Paint a picture for me?
Anything? TIA
Thanks, Christoph, I really only have a concept at the moment. Here is what i want to do:
The weather integrations like “OpenWeatherMap” and “DarkSky” only seem to allow for one lat/long location. Additionally, I would prefer to use a different endpoint. Anyway, I would like to display the weather at 6 different locations. It seemed to me that a js function(lat, long, api) that made the call via fetch would work well. I thought that implementing this via a REST sensor and parsing the JSON was the way to go. In each REST sensor I would just call the function and pass in the correct args.
Is this not a good practice?
I am not entitled to judge this. I have however doubt that you can realise this without some kind of backend functionality (like a custom component or some server-side script).
As for OpenWeatherMap: I think you can add as much integration instances of OpenWeatherMap as you like, each providing configuration options for a dedicated location.