Text field shows in editor but not on my home screen

Please help! I have a flow set up to do an API call and set it as a global variable. I then call that variable using wg() in a text field but the text isn’t showing on my home screen. It only shows on my editor.

Why use wg() to call the variable?
Can’t/should you not just use gv()?

I think I have to use wg() because I’m pulling only one part from the API call and not the whole thing. I’m not sure if I can move the wg() part to the flow and only pull the specific part I need there.

I’m no expert in flows and wg()'s, but I think if you use a flow to grab the API info and put it in a variable, you can then best use tc(cut) in another variable to grab the part of the info in the first variable and then use the second variable (as gv()) in the text field.
Not sure what wg() would accomplish here, since it’s normally used to grab something from the internet and not from a variable.

Hi there,

Does the API give the response in JSON format? If so, you can use tc(json) to extract any data from within the JSON response.

For instance:
$tc(json, “{‘a’:1,‘b’:2}”, “.a”)$ ➞ it’ll give the value of 1 (which is extracted from the ‘a’ key).

I hope this would help.
:smiling_face::+1:

I appreciate the help. Any idea what it might look like to pull only “.current. uvi” from the other variable?

What is “.current. uvi” anyway? And there should not be any space in between JSON keys.

Would you mind sharing the API response, so that we could check it in order to help you.

That’s the current UV index. The space was a typo because my keyboard added it after the period. It doesn’t have it on the KWGT app.

Here’s the part of the API that I’m pulling .current.api from.

{“lat”:,“lon”:,“timezone”:“America/Chicago”,“timezone_offset”:-18000,“current”:{“dt”:1741830412,“sunrise”:1741783404,“sunset”:1741826175,“temp”:293.69,“feels_like”:293.11,“pressure”:1009,“humidity”:50,“dew_point”:282.92,“uvi”:0,“clouds”:0,“visibility”:10000,“wind_speed”:0.89,“wind_deg”:108,“wind_gust”:0.89,“weather”:[{“id”:800,“main”:“Clear”,“description”:“clear sky”,“icon”:“01n”}]}

From your API response…


{
  "lat":null,
  "lon":null,
  "timezone":"America/Chicago",
  "timezone_offset":-18000,
  "current":{
    "dt":1741830412,
    "sunrise":1741783404,
    "sunset":1741826175,
    "temp":293.69,
    "feels_like":293.11,
    "pressure":1009,
    "humidity":50,
    "dew_point":282.92,
    "uvi":0,
    "clouds":0,
    "visibility":10000,
    "wind_speed":0.89,
    "wind_deg":108,
    "wind_gust":0.89,
    "weather":[
      {
        "id":800,
        "main":"Clear",
        "description":"clear sky",
        "icon":"01n"
      }
    ]
  }
}

To extract the UVI data, try this code snippet:

Let’s say the API response is stored in a global variable which name is: “weather”.

$tc(json, gv(weather), ".current.uvi")

I hope this would help.
:smiling_face: :+1:

1 Like

I tried it but the text field in the widget is just blank now.

Please check the JSON response from the API, it might be incorrect.

Here’s an online service for JSON validator & parser.

https://jsonlint.com/

I hope this would help.
:smiling_face::+1:

Checked the json response and everything looks great. Thank you for the link. The tc() route is still not pulling anything from the variable tho.

Hi there,

Yesterday when I tried, there was an error in parsing the JSON response. Then I investigated the JSON response and found several incorrect typings.

Search all special character of double quotes and replace them with regular double quotes. ➞ the JSON response you pasted has these and characters, they’re not parsable because they’re not the regular " character.

Also… there’s a missing } character at the end of the JSON response.

Screenshot 20250314-001 • The global variable

Screenshot 20250314-002 • The code snippet

I hope this would help.
:smiling_face::+1:

This is the full json. It works on my end. There’s just something holding up the tc().

{
“lat”: 41.88,
“lon”: -86.78,
“timezone”: “America/Detroit”,
“timezone_offset”: -14400,
“current”: {
“dt”: 1741920603,
“sunrise”: 1741867322,
“sunset”: 1741909869,
“temp”: 281.18,
“feels_like”: 277.97,
“pressure”: 1012,
“humidity”: 70,
“dew_point”: 276.05,
“uvi”: 0,
“clouds”: 6,
“visibility”: 10000,
“wind_speed”: 5.79,
“wind_deg”: 123,
“wind_gust”: 8.18,
“weather”: [
{
“id”: 800,
“main”: “Clear”,
“description”: “clear sky”,
“icon”: “01n”
}
]
},
“minutely”: [
{
“dt”: 1741920660,
“precipitation”: 0
},
{
“dt”: 1741920720,
“precipitation”: 0
},
{
“dt”: 1741920780,
“precipitation”: 0
},
{
“dt”: 1741920840,
“precipitation”: 0
},
{
“dt”: 1741920900,
“precipitation”: 0
},
{
“dt”: 1741920960,
“precipitation”: 0
},
{
“dt”: 1741921020,
“precipitation”: 0
},
{
“dt”: 1741921080,
“precipitation”: 0
},
{
“dt”: 1741921140,
“precipitation”: 0
},
{
“dt”: 1741921200,
“precipitation”: 0
},
{
“dt”: 1741921260,
“precipitation”: 0
},
{
“dt”: 1741921320,
“precipitation”: 0
},
{
“dt”: 1741921380,
“precipitation”: 0
},
{
“dt”: 1741921440,
“precipitation”: 0
},
{
“dt”: 1741921500,
“precipitation”: 0
},
{
“dt”: 1741921560,
“precipitation”: 0
},
{
“dt”: 1741921620,
“precipitation”: 0
},
{
“dt”: 1741921680,
“precipitation”: 0
},
{
“dt”: 1741921740,
“precipitation”: 0
},
{
“dt”: 1741921800,
“precipitation”: 0
},
{
“dt”: 1741921860,
“precipitation”: 0
},
{
“dt”: 1741921920,
“precipitation”: 0
},
{
“dt”: 1741921980,
“precipitation”: 0
},
{
“dt”: 1741922040,
“precipitation”: 0
},
{
“dt”: 1741922100,
“precipitation”: 0
},
{
“dt”: 1741922160,
“precipitation”: 0
},
{
“dt”: 1741922220,
“precipitation”: 0
},
{
“dt”: 1741922280,
“precipitation”: 0
},
{
“dt”: 1741922340,
“precipitation”: 0
},
{
“dt”: 1741922400,
“precipitation”: 0
},
{
“dt”: 1741922460,
“precipitation”: 0
},
{
“dt”: 1741922520,
“precipitation”: 0
},
{
“dt”: 1741922580,
“precipitation”: 0
},
{
“dt”: 1741922640,
“precipitation”: 0
},
{
“dt”: 1741922700,
“precipitation”: 0
},
{
“dt”: 1741922760,
“precipitation”: 0
},
{
“dt”: 1741922820,
“precipitation”: 0
},
{
“dt”: 1741922880,
“precipitation”: 0
},
{
“dt”: 1741922940,
“precipitation”: 0
},
{
“dt”: 1741923000,
“precipitation”: 0
},
{
“dt”: 1741923060,
“precipitation”: 0
},
{
“dt”: 1741923120,
“precipitation”: 0
},
{
“dt”: 1741923180,
“precipitation”: 0
},
{
“dt”: 1741923240,
“precipitation”: 0
},
{
“dt”: 1741923300,
“precipitation”: 0
},
{
“dt”: 1741923360,
“precipitation”: 0
},
{
“dt”: 1741923420,
“precipitation”: 0
},
{
“dt”: 1741923480,
“precipitation”: 0
},
{
“dt”: 1741923540,
“precipitation”: 0
},
{
“dt”: 1741923600,
“precipitation”: 0
},
{
“dt”: 1741923660,
“precipitation”: 0
},
{
“dt”: 1741923720,
“precipitation”: 0
},
{
“dt”: 1741923780,
“precipitation”: 0
},
{
“dt”: 1741923840,
“precipitation”: 0
},
{
“dt”: 1741923900,
“precipitation”: 0
},
{
“dt”: 1741923960,
“precipitation”: 0
},
{
“dt”: 1741924020,
“precipitation”: 0
},
{
“dt”: 1741924080,
“precipitation”: 0
},
{
“dt”: 1741924140,
“precipitation”: 0
},
{
“dt”: 1741924200,
“precipitation”: 0
}
],

“hourly”: [
{
“dt”: 1741917600,
“temp”: 281.28,
“feels_like”: 278.14,
“pressure”: 1012,
“humidity”: 69,
“dew_point”: 275.94,
“uvi”: 0,
“clouds”: 6,
“visibility”: 10000,
“wind_speed”: 5.66,
“wind_deg”: 118,
“wind_gust”: 7.7,
“weather”: [
{
“id”: 800,
“main”: “Clear”,
“description”: “clear sky”,
“icon”: “01n”
}
],
“pop”: 0
},
{
“dt”: 1741921200,
“temp”: 281.18,
“feels_like”: 277.97,
“pressure”: 1012,
“humidity”: 70,
“dew_point”: 276.05,
“uvi”: 0,
“clouds”: 6,
“visibility”: 10000,
“wind_speed”: 5.79,
“wind_deg”: 123,
“wind_gust”: 8.18,
“weather”: [
{
“id”: 800,
“main”: “Clear”,
“description”: “clear sky”,
“icon”: “01n”
}
],
“pop”: 0
},
{
“dt”: 1741924800,
“temp”: 281.13,
“feels_like”: 277.76,
“pressure”: 1012,
“humidity”: 70,
“dew_point”: 276,
“uvi”: 0,
“clouds”: 6,
“visibility”: 10000,
“wind_speed”: 6.2,
“wind_deg”: 130,
“wind_gust”: 10.03,
“weather”: [
{
“id”: 800,
“main”: “Clear”,
“description”: “clear sky”,
“icon”: “01n”
}
],
“pop”: 0
},
{
“dt”: 1741928400,
“temp”: 281,
“feels_like”: 277.53,
“pressure”: 1012,
“humidity”: 71,
“dew_point”: 276.08,
“uvi”: 0,
“clouds”: 7,
“visibility”: 10000,
“wind_speed”: 6.39,
“wind_deg”: 134,
“wind_gust”: 10.35,
“weather”: [
{
“id”: 800,
“main”: “Clear”,
“description”: “clear sky”,
“icon”: “01n”
}
],
“pop”: 0
},
{
“dt”: 1741932000,
“temp”: 280.84,
“feels_like”: 277.18,
“pressure”: 1011,
“humidity”: 72,
“dew_point”: 276.12,
“uvi”: 0,
“clouds”: 13,
“visibility”: 10000,
“wind_speed”: 6.82,
“wind_deg”: 136,
“wind_gust”: 11.72,
“weather”: [
{
“id”: 801,
“main”: “Clouds”,
“description”: “few clouds”,
“icon”: “02n”
}
],
“pop”: 0
},
{
“dt”: 1741935600,
“temp”: 280.8,
“feels_like”: 276.95,
“pressure”: 1010,
“humidity”: 74,
“dew_point”: 276.47,
“uvi”: 0,
“clouds”: 81,
“visibility”: 10000,
“wind_speed”: 7.39,
“wind_deg”: 140,
“wind_gust”: 12.41,
“weather”: [
{
“id”: 803,
“main”: “Clouds”,
“description”: “broken clouds”,
“icon”: “04n”
}
],
“pop”: 0
},
{
“dt”: 1741939200,
“temp”: 280.85,
“feels_like”: 276.98,
“pressure”: 1009,
“humidity”: 75,
“dew_point”: 276.68,
“uvi”: 0,
“clouds”: 100,
“visibility”: 10000,
“wind_speed”: 7.5,
“wind_deg”: 140,
“wind_gust”: 13.25,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04n”
}
],
“pop”: 0
},
{
“dt”: 1741942800,
“temp”: 280.82,
“feels_like”: 277.03,
“pressure”: 1009,
“humidity”: 77,
“dew_point”: 277.06,
“uvi”: 0,
“clouds”: 98,
“visibility”: 10000,
“wind_speed”: 7.2,
“wind_deg”: 141,
“wind_gust”: 11.72,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04n”
}
],
“pop”: 0
},
{
“dt”: 1741946400,
“temp”: 280.78,
“feels_like”: 277.05,
“pressure”: 1008,
“humidity”: 80,
“dew_point”: 277.45,
“uvi”: 0,
“clouds”: 95,
“visibility”: 10000,
“wind_speed”: 6.97,
“wind_deg”: 141,
“wind_gust”: 11.37,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04n”
}
],
“pop”: 0
},
{
“dt”: 1741950000,
“temp”: 280.7,
“feels_like”: 277.13,
“pressure”: 1008,
“humidity”: 85,
“dew_point”: 278.34,
“uvi”: 0,
“clouds”: 95,
“visibility”: 10000,
“wind_speed”: 6.43,
“wind_deg”: 145,
“wind_gust”: 9.42,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04n”
}
],
“pop”: 0
},
{
“dt”: 1741953600,
“temp”: 281.01,
“feels_like”: 277.44,
“pressure”: 1008,
“humidity”: 91,
“dew_point”: 279.59,
“uvi”: 0,
“clouds”: 96,
“visibility”: 10000,
“wind_speed”: 6.69,
“wind_deg”: 150,
“wind_gust”: 10.52,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04n”
}
],
“pop”: 0
},
{
“dt”: 1741957200,
“temp”: 281.74,
“feels_like”: 278.49,
“pressure”: 1007,
“humidity”: 94,
“dew_point”: 280.73,
“uvi”: 0.29,
“clouds”: 100,
“visibility”: 10000,
“wind_speed”: 6.34,
“wind_deg”: 149,
“wind_gust”: 10.15,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1741960800,
“temp”: 282.98,
“feels_like”: 280.03,
“pressure”: 1007,
“humidity”: 92,
“dew_point”: 281.7,
“uvi”: 0.94,
“clouds”: 100,
“visibility”: 10000,
“wind_speed”: 6.45,
“wind_deg”: 150,
“wind_gust”: 10.97,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1741964400,
“temp”: 284.61,
“feels_like”: 284.06,
“pressure”: 1006,
“humidity”: 86,
“dew_point”: 282.29,
“uvi”: 1.83,
“clouds”: 100,
“visibility”: 10000,
“wind_speed”: 7.02,
“wind_deg”: 157,
“wind_gust”: 10.78,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1741968000,
“temp”: 285.88,
“feels_like”: 285.27,
“pressure”: 1005,
“humidity”: 79,
“dew_point”: 282.23,
“uvi”: 3.03,
“clouds”: 100,
“visibility”: 10000,
“wind_speed”: 7.21,
“wind_deg”: 165,
“wind_gust”: 10.67,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1741971600,
“temp”: 287.32,
“feels_like”: 286.65,
“pressure”: 1004,
“humidity”: 71,
“dew_point”: 281.85,
“uvi”: 4.07,
“clouds”: 100,
“visibility”: 10000,
“wind_speed”: 8.1,
“wind_deg”: 166,
“wind_gust”: 10.67,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1741975200,
“temp”: 288.41,
“feels_like”: 287.71,
“pressure”: 1003,
“humidity”: 66,
“dew_point”: 281.98,
“uvi”: 4.47,
“clouds”: 99,
“visibility”: 10000,
“wind_speed”: 8.51,
“wind_deg”: 167,
“wind_gust”: 11.21,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1741978800,
“temp”: 289.13,
“feels_like”: 288.48,
“pressure”: 1001,
“humidity”: 65,
“dew_point”: 282.28,
“uvi”: 3.93,
“clouds”: 52,
“visibility”: 10000,
“wind_speed”: 8.58,
“wind_deg”: 169,
“wind_gust”: 10.78,
“weather”: [
{
“id”: 803,
“main”: “Clouds”,
“description”: “broken clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1741982400,
“temp”: 289.45,
“feels_like”: 288.81,
“pressure”: 1000,
“humidity”: 64,
“dew_point”: 282.38,
“uvi”: 2.86,
“clouds”: 66,
“visibility”: 10000,
“wind_speed”: 8.74,
“wind_deg”: 167,
“wind_gust”: 10.88,
“weather”: [
{
“id”: 803,
“main”: “Clouds”,
“description”: “broken clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1741986000,
“temp”: 289.47,
“feels_like”: 288.78,
“pressure”: 999,
“humidity”: 62,
“dew_point”: 282.05,
“uvi”: 1.62,
“clouds”: 54,
“visibility”: 10000,
“wind_speed”: 8.35,
“wind_deg”: 168,
“wind_gust”: 10.08,
“weather”: [
{
“id”: 803,
“main”: “Clouds”,
“description”: “broken clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1741989600,
“temp”: 289.19,
“feels_like”: 288.47,
“pressure”: 998,
“humidity”: 62,
“dew_point”: 281.78,
“uvi”: 0.63,
“clouds”: 60,
“visibility”: 10000,
“wind_speed”: 8.28,
“wind_deg”: 165,
“wind_gust”: 10.46,
“weather”: [
{
“id”: 803,
“main”: “Clouds”,
“description”: “broken clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1741993200,
“temp”: 288.76,
“feels_like”: 288.15,
“pressure”: 997,
“humidity”: 68,
“dew_point”: 282.9,
“uvi”: 0.13,
“clouds”: 68,
“visibility”: 10000,
“wind_speed”: 8.76,
“wind_deg”: 158,
“wind_gust”: 11.48,
“weather”: [
{
“id”: 803,
“main”: “Clouds”,
“description”: “broken clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1741996800,
“temp”: 288.45,
“feels_like”: 287.97,
“pressure”: 996,
“humidity”: 74,
“dew_point”: 283.73,
“uvi”: 0,
“clouds”: 73,
“visibility”: 10000,
“wind_speed”: 9.62,
“wind_deg”: 158,
“wind_gust”: 14.18,
“weather”: [
{
“id”: 803,
“main”: “Clouds”,
“description”: “broken clouds”,
“icon”: “04n”
}
],
“pop”: 0
},
{
“dt”: 1742000400,
“temp”: 288.23,
“feels_like”: 287.78,
“pressure”: 995,
“humidity”: 76,
“dew_point”: 283.95,
“uvi”: 0,
“clouds”: 100,
“visibility”: 10000,
“wind_speed”: 10.28,
“wind_deg”: 156,
“wind_gust”: 15.5,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04n”
}
],
“pop”: 0
},
{
“dt”: 1742004000,
“temp”: 288.33,
“feels_like”: 287.89,
“pressure”: 995,
“humidity”: 76,
“dew_point”: 284.01,
“uvi”: 0,
“clouds”: 100,
“visibility”: 10000,
“wind_speed”: 11.53,
“wind_deg”: 161,
“wind_gust”: 17.95,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04n”
}
],
“pop”: 0
},
{
“dt”: 1742007600,
“temp”: 288.83,
“feels_like”: 288.41,
“pressure”: 994,
“humidity”: 75,
“dew_point”: 284.38,
“uvi”: 0,
“clouds”: 100,
“visibility”: 10000,
“wind_speed”: 13.08,
“wind_deg”: 163,
“wind_gust”: 20.42,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04n”
}
],
“pop”: 0
},
{
“dt”: 1742011200,
“temp”: 288.93,
“feels_like”: 288.5,
“pressure”: 992,
“humidity”: 74,
“dew_point”: 284.25,
“uvi”: 0,
“clouds”: 100,
“visibility”: 10000,
“wind_speed”: 14.09,
“wind_deg”: 163,
“wind_gust”: 21.99,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04n”
}
],
“pop”: 0
},
{
“dt”: 1742014800,
“temp”: 288.91,
“feels_like”: 288.4,
“pressure”: 992,
“humidity”: 71,
“dew_point”: 283.71,
“uvi”: 0,
“clouds”: 100,
“visibility”: 10000,
“wind_speed”: 14.69,
“wind_deg”: 174,
“wind_gust”: 23.2,
“weather”: [
{
“id”: 500,
“main”: “Rain”,
“description”: “light rain”,
“icon”: “10n”
}
],
“pop”: 0.2,
“rain”: {
“1h”: 0.25
}
},
{
“dt”: 1742018400,
“temp”: 288.75,
“feels_like”: 288.25,
“pressure”: 991,
“humidity”: 72,
“dew_point”: 283.66,
“uvi”: 0,
“clouds”: 100,
“visibility”: 10000,
“wind_speed”: 14.56,
“wind_deg”: 182,
“wind_gust”: 22.65,
“weather”: [
{
“id”: 500,
“main”: “Rain”,
“description”: “light rain”,
“icon”: “10n”
}
],
“pop”: 0.47,
“rain”: {
“1h”: 0.23
}
},
{
“dt”: 1742022000,
“temp”: 285.89,
“feels_like”: 285.65,
“pressure”: 992,
“humidity”: 93,
“dew_point”: 284.81,
“uvi”: 0,
“clouds”: 100,
“visibility”: 8538,
“wind_speed”: 12.86,
“wind_deg”: 198,
“wind_gust”: 18.57,
“weather”: [
{
“id”: 502,
“main”: “Rain”,
“description”: “heavy intensity rain”,
“icon”: “10n”
}
],
“pop”: 1,
“rain”: {
“1h”: 11.23
}
},
{
“dt”: 1742025600,
“temp”: 286.16,
“feels_like”: 285.71,
“pressure”: 991,
“humidity”: 84,
“dew_point”: 283.27,
“uvi”: 0,
“clouds”: 100,
“visibility”: 10000,
“wind_speed”: 10.54,
“wind_deg”: 195,
“wind_gust”: 17.78,
“weather”: [
{
“id”: 500,
“main”: “Rain”,
“description”: “light rain”,
“icon”: “10n”
}
],
“pop”: 1,
“rain”: {
“1h”: 0.59
}
},
{
“dt”: 1742029200,
“temp”: 286.73,
“feels_like”: 286.13,
“pressure”: 990,
“humidity”: 76,
“dew_point”: 282.5,
“uvi”: 0,
“clouds”: 88,
“visibility”: 10000,
“wind_speed”: 11.49,
“wind_deg”: 188,
“wind_gust”: 18.14,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04n”
}
],
“pop”: 0.8
},
{
“dt”: 1742032800,
“temp”: 286.54,
“feels_like”: 285.92,
“pressure”: 990,
“humidity”: 76,
“dew_point”: 282.26,
“uvi”: 0,
“clouds”: 92,
“visibility”: 10000,
“wind_speed”: 11.51,
“wind_deg”: 188,
“wind_gust”: 18.41,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04n”
}
],
“pop”: 0.8
},
{
“dt”: 1742036400,
“temp”: 286.64,
“feels_like”: 285.9,
“pressure”: 990,
“humidity”: 71,
“dew_point”: 281.51,
“uvi”: 0,
“clouds”: 94,
“visibility”: 10000,
“wind_speed”: 12.37,
“wind_deg”: 186,
“wind_gust”: 19.5,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04n”
}
],
“pop”: 0.8
},
{
“dt”: 1742040000,
“temp”: 286.6,
“feels_like”: 285.78,
“pressure”: 990,
“humidity”: 68,
“dew_point”: 280.79,
“uvi”: 0,
“clouds”: 95,
“visibility”: 10000,
“wind_speed”: 13.21,
“wind_deg”: 188,
“wind_gust”: 20.87,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04d”
}
],
“pop”: 0.8
},
{
“dt”: 1742043600,
“temp”: 286.49,
“feels_like”: 285.58,
“pressure”: 991,
“humidity”: 65,
“dew_point”: 279.89,
“uvi”: 0.2,
“clouds”: 92,
“visibility”: 10000,
“wind_speed”: 13.44,
“wind_deg”: 194,
“wind_gust”: 21.55,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1742047200,
“temp”: 286.69,
“feels_like”: 285.74,
“pressure”: 992,
“humidity”: 63,
“dew_point”: 279.58,
“uvi”: 0.64,
“clouds”: 97,
“visibility”: 10000,
“wind_speed”: 13.4,
“wind_deg”: 199,
“wind_gust”: 21.53,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1742050800,
“temp”: 287.09,
“feels_like”: 286.03,
“pressure”: 992,
“humidity”: 57,
“dew_point”: 278.72,
“uvi”: 1.36,
“clouds”: 98,
“visibility”: 10000,
“wind_speed”: 13.76,
“wind_deg”: 201,
“wind_gust”: 22.68,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1742054400,
“temp”: 287.24,
“feels_like”: 286.04,
“pressure”: 992,
“humidity”: 51,
“dew_point”: 277.27,
“uvi”: 2.51,
“clouds”: 80,
“visibility”: 10000,
“wind_speed”: 13.74,
“wind_deg”: 200,
“wind_gust”: 22.25,
“weather”: [
{
“id”: 803,
“main”: “Clouds”,
“description”: “broken clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1742058000,
“temp”: 287.56,
“feels_like”: 286.36,
“pressure”: 992,
“humidity”: 50,
“dew_point”: 277.19,
“uvi”: 3.23,
“clouds”: 65,
“visibility”: 10000,
“wind_speed”: 13.31,
“wind_deg”: 202,
“wind_gust”: 21.21,
“weather”: [
{
“id”: 803,
“main”: “Clouds”,
“description”: “broken clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1742061600,
“temp”: 287.37,
“feels_like”: 286.18,
“pressure”: 992,
“humidity”: 51,
“dew_point”: 277.2,
“uvi”: 3.41,
“clouds”: 63,
“visibility”: 10000,
“wind_speed”: 11.82,
“wind_deg”: 206,
“wind_gust”: 19.8,
“weather”: [
{
“id”: 803,
“main”: “Clouds”,
“description”: “broken clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1742065200,
“temp”: 287.38,
“feels_like”: 286.19,
“pressure”: 992,
“humidity”: 51,
“dew_point”: 277.2,
“uvi”: 3.47,
“clouds”: 28,
“visibility”: 10000,
“wind_speed”: 10.39,
“wind_deg”: 205,
“wind_gust”: 17.47,
“weather”: [
{
“id”: 802,
“main”: “Clouds”,
“description”: “scattered clouds”,
“icon”: “03d”
}
],
“pop”: 0
},
{
“dt”: 1742068800,
“temp”: 286.6,
“feels_like”: 285.41,
“pressure”: 991,
“humidity”: 54,
“dew_point”: 277.18,
“uvi”: 2.49,
“clouds”: 57,
“visibility”: 10000,
“wind_speed”: 10.06,
“wind_deg”: 201,
“wind_gust”: 14.76,
“weather”: [
{
“id”: 803,
“main”: “Clouds”,
“description”: “broken clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1742072400,
“temp”: 286.7,
“feels_like”: 285.55,
“pressure”: 993,
“humidity”: 55,
“dew_point”: 277.7,
“uvi”: 1.37,
“clouds”: 71,
“visibility”: 10000,
“wind_speed”: 12.13,
“wind_deg”: 202,
“wind_gust”: 19.92,
“weather”: [
{
“id”: 803,
“main”: “Clouds”,
“description”: “broken clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1742076000,
“temp”: 285.33,
“feels_like”: 284.25,
“pressure”: 992,
“humidity”: 63,
“dew_point”: 278.36,
“uvi”: 0.44,
“clouds”: 78,
“visibility”: 10000,
“wind_speed”: 9.28,
“wind_deg”: 193,
“wind_gust”: 12.67,
“weather”: [
{
“id”: 803,
“main”: “Clouds”,
“description”: “broken clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1742079600,
“temp”: 284.62,
“feels_like”: 283.68,
“pressure”: 993,
“humidity”: 71,
“dew_point”: 279.54,
“uvi”: 0.12,
“clouds”: 83,
“visibility”: 10000,
“wind_speed”: 9.58,
“wind_deg”: 185,
“wind_gust”: 14.84,
“weather”: [
{
“id”: 803,
“main”: “Clouds”,
“description”: “broken clouds”,
“icon”: “04d”
}
],
“pop”: 0
},
{
“dt”: 1742083200,
“temp”: 283.8,
“feels_like”: 282.93,
“pressure”: 993,
“humidity”: 77,
“dew_point”: 279.78,
“uvi”: 0,
“clouds”: 86,
“visibility”: 10000,
“wind_speed”: 7.33,
“wind_deg”: 191,
“wind_gust”: 11.02,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04n”
}
],
“pop”: 0
},
{
“dt”: 1742086800,
“temp”: 283.03,
“feels_like”: 280.34,
“pressure”: 993,
“humidity”: 81,
“dew_point”: 279.8,
“uvi”: 0,
“clouds”: 100,
“visibility”: 10000,
“wind_speed”: 5.7,
“wind_deg”: 202,
“wind_gust”: 7.63,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04n”
}
],
“pop”: 0
}
],

“daily”: [
{
“dt”: 1741885200,
“sunrise”: 1741867322,
“sunset”: 1741909869,
“moonrise”: 1741908600,
“moonset”: 1741866660,
“moon_phase”: 0.48,
“summary”: “Expect a day of partly cloudy with clear spells”,
“temp”: {
“day”: 281.65,
“min”: 276.85,
“max”: 284.21,
“night”: 281.18,
“eve”: 284.2,
“morn”: 277.25
},
“feels_like”: {
“day”: 279.98,
“night”: 277.97,
“eve”: 282.82,
“morn”: 274.82
},
“pressure”: 1013,
“humidity”: 58,
“dew_point”: 273.47,
“wind_speed”: 5.79,
“wind_deg”: 123,
“wind_gust”: 8.18,
“weather”: [
{
“id”: 800,
“main”: “Clear”,
“description”: “clear sky”,
“icon”: “01d”
}
],
“clouds”: 5,
“pop”: 0,
“uvi”: 5.13
},
{
“dt”: 1741971600,
“sunrise”: 1741953619,
“sunset”: 1741996336,
“moonrise”: 1741998660,
“moonset”: 1741954140,
“moon_phase”: 0.5,
“summary”: “There will be clear sky until morning, then partly cloudy”,
“temp”: {
“day”: 287.32,
“min”: 280.7,
“max”: 289.47,
“night”: 288.83,
“eve”: 288.76,
“morn”: 280.7
},
“feels_like”: {
“day”: 286.65,
“night”: 288.41,
“eve”: 288.15,
“morn”: 277.13
},
“pressure”: 1004,
“humidity”: 71,
“dew_point”: 281.85,
“wind_speed”: 13.08,
“wind_deg”: 163,
“wind_gust”: 20.42,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04d”
}
],
“clouds”: 100,
“pop”: 0,
“uvi”: 4.47
},
{
“dt”: 1742058000,
“sunrise”: 1742039917,
“sunset”: 1742082804,
“moonrise”: 1742088780,
“moonset”: 1742041620,
“moon_phase”: 0.54,
“summary”: “Expect a day of partly cloudy with rain”,
“temp”: {
“day”: 287.56,
“min”: 279.94,
“max”: 288.93,
“night”: 279.94,
“eve”: 284.62,
“morn”: 286.64
},
“feels_like”: {
“day”: 286.36,
“night”: 277.36,
“eve”: 283.68,
“morn”: 285.9
},
“pressure”: 992,
“humidity”: 50,
“dew_point”: 277.19,
“wind_speed”: 14.69,
“wind_deg”: 174,
“wind_gust”: 23.2,
“weather”: [
{
“id”: 502,
“main”: “Rain”,
“description”: “heavy intensity rain”,
“icon”: “10d”
}
],
“clouds”: 65,
“pop”: 1,
“rain”: 12.3,
“uvi”: 3.47
},
{
“dt”: 1742144400,
“sunrise”: 1742126214,
“sunset”: 1742169271,
“moonrise”: 1742178840,
“moonset”: 1742129160,
“moon_phase”: 0.57,
“summary”: “You can expect partly cloudy in the morning, with clearing in the afternoon”,
“temp”: {
“day”: 274.26,
“min”: 273.26,
“max”: 279.22,
“night”: 275.07,
“eve”: 275.68,
“morn”: 275.77
},
“feels_like”: {
“day”: 267.68,
“night”: 272.9,
“eve”: 272.87,
“morn”: 270.22
},
“pressure”: 1009,
“humidity”: 64,
“dew_point”: 268.12,
“wind_speed”: 9.71,
“wind_deg”: 302,
“wind_gust”: 11.49,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04d”
}
],
“clouds”: 100,
“pop”: 0,
“uvi”: 4.06
},
{
“dt”: 1742230800,
“sunrise”: 1742212511,
“sunset”: 1742255738,
“moonrise”: 1742269080,
“moonset”: 1742216760,
“moon_phase”: 0.6,
“summary”: “There will be clear sky until morning, then partly cloudy”,
“temp”: {
“day”: 282.13,
“min”: 275.11,
“max”: 283.15,
“night”: 281.98,
“eve”: 283.13,
“morn”: 275.11
},
“feels_like”: {
“day”: 278.33,
“night”: 278.84,
“eve”: 280.44,
“morn”: 269.64
},
“pressure”: 1013,
“humidity”: 54,
“dew_point”: 272.99,
“wind_speed”: 10.08,
“wind_deg”: 184,
“wind_gust”: 17.32,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04d”
}
],
“clouds”: 87,
“pop”: 0,
“uvi”: 4.14
},
{
“dt”: 1742317200,
“sunrise”: 1742298807,
“sunset”: 1742342205,
“moonrise”: 0,
“moonset”: 1742304540,
“moon_phase”: 0.63,
“summary”: “There will be partly cloudy today”,
“temp”: {
“day”: 285.6,
“min”: 281.14,
“max”: 286.93,
“night”: 284.91,
“eve”: 285.71,
“morn”: 281.14
},
“feels_like”: {
“day”: 284.57,
“night”: 283.84,
“eve”: 284.51,
“morn”: 277.47
},
“pressure”: 1008,
“humidity”: 64,
“dew_point”: 278.68,
“wind_speed”: 10.33,
“wind_deg”: 190,
“wind_gust”: 16.85,
“weather”: [
{
“id”: 804,
“main”: “Clouds”,
“description”: “overcast clouds”,
“icon”: “04d”
}
],
“clouds”: 94,
“pop”: 0,
“uvi”: 5
},
{
“dt”: 1742403600,
“sunrise”: 1742385104,
“sunset”: 1742428672,
“moonrise”: 1742359320,
“moonset”: 1742392620,
“moon_phase”: 0.66,
“summary”: “You can expect partly cloudy with rain in the morning, with snow in the afternoon”,
“temp”: {
“day”: 285.07,
“min”: 273.29,
“max”: 285.07,
“night”: 273.29,
“eve”: 277.42,
“morn”: 283.72
},
“feels_like”: {
“day”: 284.51,
“night”: 266.29,
“eve”: 270.78,
“morn”: 282.92
},
“pressure”: 998,
“humidity”: 84,
“dew_point”: 282.31,
“wind_speed”: 17.21,
“wind_deg”: 258,
“wind_gust”: 21.4,
“weather”: [
{
“id”: 616,
“main”: “Snow”,
“description”: “rain and snow”,
“icon”: “13d”
}
],
“clouds”: 100,
“pop”: 1,
“rain”: 1.65,
“snow”: 0.15,
“uvi”: 5
},
{
“dt”: 1742490000,
“sunrise”: 1742471400,
“sunset”: 1742515138,
“moonrise”: 1742449560,
“moonset”: 1742481060,
“moon_phase”: 0.69,
“summary”: “Expect a day of partly cloudy with snow”,
“temp”: {
“day”: 272.7,
“min”: 271.73,
“max”: 272.96,
“night”: 272.9,
“eve”: 272.96,
“morn”: 271.73
},
“feels_like”: {
“day”: 267.05,
“night”: 265.9,
“eve”: 266.98,
“morn”: 264.73
},
“pressure”: 1017,
“humidity”: 63,
“dew_point”: 266.42,
“wind_speed”: 13.53,
“wind_deg”: 307,
“wind_gust”: 14.85,
“weather”: [
{
“id”: 601,
“main”: “Snow”,
“description”: “snow”,
“icon”: “13d”
}
],
“clouds”: 98,
“pop”: 1,
“snow”: 2.61,
“uvi”: 5
}
],
“alerts”: [
{
“sender_name”: “NWS Milwaukee/Sullivan WI”,
“event”: “Gale Watch”,
“start”: 1742040000,
“end”: 1742083200,
“description”: “* WHAT…South winds 20 to 20 kt with gusts up to 40 kt and waves\n7 to 10 ft possible.\n\n* WHERE…All Open Waters of Lake Michigan.\n\n* WHEN…From Saturday morning through Saturday evening.\n\n* IMPACTS…Strong winds can cause hazardous waves which could\ncapsize or damage vessels and reduce visibility.”,
“tags”: [
“Wind”
]
}
]
}

Have you checked the and ? They are both special character that looks like regular double quotes, but they’re unrecognizable by the Kustom preset (by tc() function).
Use the regular/normal " (double quotes) character.

If somehow both and are set by the API response, you search & replace it (using tc(reg)) before extracting the JSON data.

Here’s my code snippet you can use:

UV index: $
tc(json,
  tc(
    reg,gv(test),"“|”",tc(utf,22)
  ),".current.uvi"
)
$
1 Like