The examples to parse JSON are not helping me much.
I have to do this since HE doesn't allow external libs (import net.time4lcalendar would solve my problems!)
(the routine I need is here (an extended date/time with astronomical built in):
Yes! its the variable naming of the sub sections within the JSON i've never understood. From the JSON example I posted, I'm trying to pull the equinox and Solstice values to create an Astronimical Season app. My meteoroligical map bugs me!
@tomw - since you basically wrote it for me - it was simple enough to use. thank you. I'm still unclear how to target the specific object tho. At this:
["Equinox","Solstice",].each
the result gives me the first instance of the phenom value. how to target the 2nd one or store each into thier own variable?
I put :
if(phenom) sendEvent(name: "firstEquinox", value: "${it}: ${phenom}", descriptionText: descriptionText) else sendEvent(name: "firstEquinox", value: "No Data", descriptionText: descriptionText) which works great - but I can't determine how to yank the 2nd iteration.
If you're going over the Internet an instant response is never guaranteed. Plus, IMHO, keeping the data parsing in a separate function from the API call is nicer organizationally.
Fair enough on both points. FWIW my example shows both ways.
One thing that is harder is passing data back to the caller (if needed) from the async parse function. I really wish Groovy and/or Hubitat had an await-like semantic.
That direction for passing data is straightforward (though the docs have definitely improved in the meantime ).
My point is that if you need data from getStatusHandler back in the main calling function, it's complicated. Whereas with a synchronous httpGet you get the data directly.