Yes you are right, sorry, it isn’t an API call; the info is the return from a url - http://192.168.2.101/v1/current_conditions .
{
"data": {
"did": "001D0A712D46",
"ts": 1613636411,
"conditions": [{
"lsid": 352807,
"data_structure_type": 1,
"txid": 1,
"temp": 49.1,
"hum": 83.8,
"dew_point": 44.4,
"wet_bulb": 46.4,
"heat_index": 49.1,
"wind_chill": 43.0,
"thw_index": 43.0,
"thsw_index": null,
"wind_speed_last": 17.81,
"wind_dir_last": 134,
"wind_speed_avg_last_1_min": 13.18,
"wind_dir_scalar_avg_last_1_min": 133,
"wind_speed_avg_last_2_min": 13.18,
"wind_dir_scalar_avg_last_2_min": 133,
"wind_speed_hi_last_2_min": 21.93,
"wind_dir_at_hi_speed_last_2_min": 117,
"wind_speed_avg_last_10_min": 12.56,
"wind_dir_scalar_avg_last_10_min": 136,
"wind_speed_hi_last_10_min": 21.93,
"wind_dir_at_hi_speed_last_10_min": 117,
"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": 13,
"rain_storm": 50,
"rain_storm_start_at": 1613424181,
"solar_rad": null,
"uv_index": null,
"rx_state": 0,
"trans_battery_flag": 0,
"rainfall_daily": 0,
"rainfall_monthly": 211,
"rainfall_year": 776,
"rain_storm_last": 160,
"rain_storm_last_start_at": 1612221900,
"rain_storm_last_end_at": 1612771260
}, {
"lsid": 352806,
"data_structure_type": 4,
"temp_in": 52.3,
"hum_in": 66.3,
"dew_point_in": 41.4,
"heat_index_in": 51.3
}, {
"lsid": 352805,
"data_structure_type": 3,
"bar_sea_level": 29.551,
"bar_trend": -0.066,
"bar_absolute": 29.265
}]
},
"error": null
}
[Mod - edited] - put the backticks on a line on their own - use jsonlint.com to prettify the JSON
I have made some progress with extracting & converting the timestamp (“ts”:1613636411) in Node-Red; I get as far as producing "18 Feb 2021 08:22"
but when that gets sent to emonCMS via MQTT the Input name becomes (eg) "18 Feb 2021 08"
and the value is 22
.
I can see why - presumably it thinks it is a value pair? (and this also leads to the creation of a new Input each update), so more experimenting required to get the MQTT message to be “time: 18 Feb 2021 08:24” instead…
PS I do love the interaction between several bits of hardware and various software platforms. Fascinating stuff.