Getting the rain amount with OpenWeather

Working with the openweather API and am trying to get the precipitation forecasted in the next 24h. The forecast message gives you the expected rain in three hour chunks so using a function to sum this should do the trick. However, here is my problem, the rain amount is under the ID of 3h which throws an error because I am using an identifier that starts with a number. Is there a way to escape the name or something similar so I can reference the value? Here is the message I am working with

Hi

Try like this

msg.payload.list[5].rain['3h']

There’s a great page in the docs (Working with messages : Node-RED) that will explain how to use the debug panel to find the right path to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

BX00Cy7yHi

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.