Some help with what I thought would be simple wget? Thanks

On my Moto XT2215-4, A12, rooted…

The following is the raw data returned from querying my Ecowitt Weather Gateway (http://192.168.1.xx/get_livedata_info). I copy/paste that into the JSON path evaluator here. I am trying to get KLWP to reference the path to a temp sensor that the evaluator says is “$.ch_aisle[0].temp”. So in a text global, I enter this formula: $wg(http://192.168.1.xx/get_livedata_info, json, .ch_aisle[0].temp)$ but the editor shows only an err: unknown in red. What am I doing wrong? Thanks!

{"common_list":[{

`"id":`	`"0x02",`

`"val":`	`"--.-",`

`"unit":`	`"F"`

}, {

`"id":`	`"0x07",`

`"val":`	`"--"`

}, {

`"id":`	`"3",`

`"val":`	`"--.-",`

`"unit":`	`"F"`

}, {

`"id":`	`"5",`

`"val":`	`"--.--"`

}, {

`"id":`	`"0x03",`

`"val":`	`"--.-",`

`"unit":`	`"F"`

}, {

`"id":`	`"0x0B",`

`"val":`	`"0.00 mph"`

}, {

`"id":`	`"0x0C",`

`"val":`	`"0.00 mph"`

}, {

`"id":`	`"0x19",`

`"val":`	`"6.93 mph"`

}, {

`"id":`	`"0x15",`

`"val":`	`"43.65 W/m2"`

}, {

`"id":`	`"0x17",`

`"val":`	`"0"`

}, {

`"id":`	`"0x0A",`

`"val":`	`"343",`

`"battery":`	`"5",`

`"voltage":`	`"1.62"`

}, {

`"id":`	`"0x6D",`

`"val":`	`"343"`

}],"wh25":[{

`"intemp":`	`"61.9",`

`"unit":`	`"F",`

`"inhumi":`	`"63%",`

`"abs":`	`"30.20 inHg",`

`"rel":`	`"30.20 inHg"`

}],"ch_aisle":[{

`"channel":`	`"1",`

`"name":`	`"Test Thermo",`

`"battery":`	`"0",`

`"temp":`	`"61.7",`

`"unit":`	`"F",`

`"humidity":`	`"None"`

}],"debug":[{

`"heap":`	`"130712",`

`"runtime":`	`"2737720",`

`"usr_interval":`	`"--",`

`"is_cnip":`	`false`

}]}

Look at your formula:

$wg(http://…, json, .ch_aisle…)

You forgot the QUOTES! In Kustom, every URL and every JSON path MUST be inside double quotes.

Correct way:

$wg(“http://192.168.1.xx/get_livedata_info”, json, “.ch_aisle[0].temp”)$

Without quotes, Kustom treats your URL as an invalid mathematical expression, hence the err: unknown."

Thanks @MaxP

I will try that.

However, I was just modifying what the editor put in place for the wg example. And I see no quotes there. I am pretty sure I used this somewhere else in my wallpaper. Don’t recall if I had quotes or not. I hope you idea works and that I am just a dope!

Best

Well, that sure enough did the trick. Thanks!

Hi there,

Sometimes a function’s string parameter does not need to be surrounded by double quotes, but for a URL address, it does need to be surrounded by double quotes.

I would suggest you to always use the double quotes for any string parameters.

I hope this would help.

:blush::+1:

Thanks! Learn something every day.

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