Can I pull the "Tempest Observation Layout" with an API request?

I’ve written a shell script that will give me my station’s current battery level every time I log into a linux shell.
From the Observation Layout in the Tempest API Explorer, I’ve just hard-coded that index 16 is the battery voltage. But what if that changes in the future? I’d prefer to pull those definitions each time the script runs so I’m referencing the correct index. I’ve poked around and so far I haven’t found where to retrieve it with curl.

So to make this post make more sense - Here’s the info from the API Explorer link above that I’d like to request each time the script runs instead of hard-coding it.
Tempest (type="obs_st")
Observation Layout
0 - Epoch (Seconds UTC)
...etc,etc...
16 - Battery (volts)

And this is what’s returned from an Observations API request:

"obs": [
[
1783797629,
...etc,etc...
2.35,

Where value 2.35 is “obs”:[0][16].

Anyone know if/where I can make a request for index definitions instead of hard-coding them in my script?

It’s not going to change in the future. Extra things might be added, but existing stuff is stable historically.

OK, thanks. I take it that means that the layout definitions are not available via the API?

FYI, this is my shell script output so far. I originally started writing it just to show me the battery status because I often run into a dead battery. But as usual with any script I write, it’s kind of snowballed into more.
I have a few tweaks to make such as output of the timestamp of the current observations, more weather observations, and some better formatting.
The station name is blurred out at the top for privacy reasons but derived from the commands below and assigned to $stationDisplayName.
The max voltage of 2.8V in the graph is just something I grabbed from a google search of the max voltage of a Tempest battery.

stationMetadata=$(curl -sS "https://swd.weatherflow.com/swd/rest/stations?token=${TEMPEST_API_TOKEN}")
stationInfo=$(echo "$stationMetadata" | jq '. | .stations[] | .devices[] | select (.device_meta.environment == "outdoor")')
stationDeviceID=$(echo "$stationInfo" | jq -r '.device_id')
stationName=$(echo "$stationInfo" | jq -r '.device_meta.name')
stationDisplayName=$(echo $stationMetadata | jq -r '.stations[] | .name')

I have no idea what you’re referring to when you ask about layout or index definitions. The data structure is documented in the API docs online.

Looks pretty good to me as-is. Nice utility.

The cloud API layout of the OBS packet arrays more or less mirror the UDP packets’ arrays. Changing the order of array elements would require changing the Tempest/Hub firmware to modify the UDP packet format, and then every app would need to check the firmware version to pick which array format to use. Long story short, the array formats have not changed since day one…although they have seen additional info added to the end over time.

The array layout definitions are not available in the API data. It is only available via the developer docs linked at the top of every forum page…

I’m referring to the same information as the API documentation. It’s just something I would prefer to retrieve at runtime instead of hard-coding in my script.

But sounds like hard-coding is the only option here.

Thanks! This is what I wanted to confirm.

That’s pretty typical. You code to a published version of an API after referencing its documentation. Hopefully things are only additive moving forward (WF is good that way) and things don’t change and cause breakage at some point in the future.