I have the following data returned by my Ecowitt weather station:
{time=>1723724790, data=>{rainfall=>{yearly=>{unit=>mm, time=>1723724776, value=>0.0}, daily=>{unit=>mm, time=>1723724776, value=>0.0}, rain_rate=>{unit=>mm/hr, time=>1723724776, value=>0.0}, weekly=>{unit=>mm, time=>1723724776, value=>0.0}, hourly=>{unit=>mm, time=>1723724776, value=>0.0}, event=>{unit=>mm, time=>1723724776, value=>0.0}, monthly=>{unit=>mm, time=>1723724776, value=>0.0}}, battery=>{sensor_array=>{unit=>, time=>1723724776, value=>0}}, outdoor=>{humidity=>{unit=>%, time=>1723724776, value=>51}, app_temp=>{unit=>℃, time=>1723724776, value=>31.2}, dew_point=>{unit=>℃, time=>1723724776, value=>18.3}, feels_like=>{unit=>℃, time=>1723724776, value=>30.4}, temperature=>{unit=>℃, time=>1723724776, value=>29.5}}, indoor=>{humidity=>{unit=>%, time=>1723724776, value=>59}, temperature=>{unit=>℃, time=>1723724776, value=>26.8}}, pressure=>{relative=>{unit=>inHg, time=>1723724776, value=>27.99}, absolute=>{unit=>inHg, time=>1723724776, value=>27.99}}, solar_and_uvi=>{solar=>{unit=>W/m², time=>1723724776, value=>202.5}, uvi=>{unit=>, time=>1723724776, value=>1}}, wind=>{wind_gust=>{unit=>km/h, time=>1723724776, value=>9.4}, wind_direction=>{unit=>º, time=>1723724776, value=>149}, wind_speed=>{unit=>km/h, time=>1723724776, value=>6.5}}}, msg=>success, code=>0}
How can I get the value of the outdoor temperature (data.outdoor.temperature.value)?
I tried the following and got a crash:
var temp = data["data"]["outdoor"]["temperature"]["value"]; var unit = data["data"]["outdoor"]["temperature"]["unit"];
Thanks in advance
Best regards
Aaron