The 2nd JSON object in the "conditions" array DOES NOT have a "bar_sea_level" value in it, so calling JsonObject.GetValue('bar_sea_level') returns nil. The "bar_sea_level" value is actually in the 3rd JSON object in the array, so you need to use Items[2] instead of Items[1]:
var
JsonValue: TJSONValue;
JsonObject, JsonData: TJSONObject;
JsonConditions: TJSONArray;
Branch: string;
...
begin
...
JsonValue := TJSONObject.ParseJSONValue(st);
if JsonValue <> nil then
try
JsonObject := JsonValue as TJSONObject;
JsonData := JsonObject.GetValue('data') as TJSONObject;
JsonConditions := JsonData.GetValue('conditions') as TJSONArray;
JsonObject := JsonConditions.Items[0] as TJSONObject;
Branch := JsonObject.GetValue('temp').Value;
memo1.Lines.add('Parsed temperature '+branch);
JsonObject := JsonConditions.Items[2] as TJSONObject;
Branch := JsonObject.GetValue('bar_sea_level').Value;
memo1.Lines.add('Parsed barometer '+branch);
finally
JsonValue.Free;
end;
...
end;
It helps to view the JSON in an indented format so you can more clearly see the actual hierarchy of values, objects, and arrays, eg:
{
"data":{
"did":"001D0A710197",
"ts":1557136813,
"conditions":[
{
"lsid":223656,
"data_structure_type":1,
"txid":1,
"temp": 52.7,
"hum":66.3,
"dew_point": 41.8,
"wet_bulb": 46.2,
"heat_index": 51.7,
"wind_chill": 52.7,
"thw_index": 51.7,
"thsw_index": 49.7,
"wind_speed_last":0.00,
"wind_dir_last":0,
"wind_speed_avg_last_1_min":0.00,
"wind_dir_scalar_avg_last_1_min":null,
"wind_speed_avg_last_2_min":0.00,
"wind_dir_scalar_avg_last_2_min":null,
"wind_speed_hi_last_2_min":0.00,
"wind_dir_at_hi_speed_last_2_min":0,
"wind_speed_avg_last_10_min":0.00,
"wind_dir_scalar_avg_last_10_min":null,
"wind_speed_hi_last_10_min":0.00,
"wind_dir_at_hi_speed_last_10_min":0,
"rain_size":2,
"rain_rate_last":0,
"rain_rate_hi":0,
"rainfall_last_15_min":0,
"rain_rate_hi_last_15_min":0,
"rainfall_last_60_min":0,
"rainfall_last_24_hr":0,
"rain_storm":null,
"rain_storm_start_at":null,
"solar_rad":0,
"uv_index":0.0,
"rx_state":0,
"trans_battery_flag":0,
"rainfall_daily":0,
"rainfall_monthly":0,
"rainfall_year":0,
"rain_storm_last":null,
"rain_storm_last_start_at":null,
"rain_storm_last_end_at":null
},
{
"lsid":223554,
"data_structure_type":4,
"temp_in": 69.1,
"hum_in":38.2,
"dew_point_in": 42.6,
"heat_index_in": 66.8
},
{
"lsid":223553,
"data_structure_type":3,
"bar_sea_level":29.932,
"bar_trend": 0.028,
"bar_absolute":29.404
}
]
},
"error":null
}
Now you can clearly see that there are 3 objects in the "conditions" array.