Apologies in advance for my rudimentary knowledge of expressions.
I am attempting to populate a custom tile using a specific node of an RSS feed in Atom format. I have tried using the news feed tile but I am unable to get that tile to display the text I am after and to filter to specific nodes of that feed.
As a result this is the approach that I am attempting to take.
I have created a rule that contains an action to retrieve the feed on a fifteen minute loop. I am then attempting to populate a variable using a specific node of that feed which I will use to populate my custom tile. For the life of me I cannot figure out the correct expression to retrieve my data from the feed as shown below.
Hi @SManCan - welcome to the community and thanks for posting.
The HTTP Action supports automatically parsing JSON responses. It does not support parsing XML responses which are just returned as their raw string in the Response Data context variable ($context.response.data).
As for expressions, they’re designed to perform calculations and manipulate data within rules. You can find more documentation on them here:
Can you share more details about what your goal is?
If you’re trying to display weather information on a dashboard, I would recommend using one of the weather options like the Open Weather Custom Tile.
If you are trying to read the data into a variable for some reason, I would recommend finding a JSON compatible API with the information you are interested in. For example, OpenMeteo and OpenWeatherMap are both common sources for this kind of data.
Poking around the Canada - Winnipeg Weather page, it looks like they are querying the following API endpoint, but I don’t know anything about their API nor if that’s an officially supported endpoint as their documentation was quite dense and it was easier to watch the API calls on the page than try to quickly grok their documentation:
It looks like your target data was available within that in:
$context.response.data[0].dailyFcst.daily[1].text
With the following value:
Clearing in the morning. Wind north 30 km\/h gusting to 50. Temperature falling to minus 21 in the afternoon. Wind chill minus 27 in the morning and minus 32 in the afternoon. Risk of frostbite. UV index 1 or low.