Really struggling with selecting values in IoT Rules.
My input looks like this, and I have no control over the data coming in:
"data": {
"antennas": {
"1": "disconnected",
"2": "connected",
"3": "disconnected",
"4": "connected"
}
}
What I'd like to achieve is the select statement transform the above into:
{
antenna_1: "disconnected",
antenna_2: "connected",
antenna_3: "disconnected",
antenna_4: "connected"
}
I've tried:
SELECT data.antennas.1 as antenna_1 FROM ...
SELECT [data.antennas.1] as antenna_1 FROM ...
SELECT data.antennas[1] as antenna_1 FROM ...
SELECT data.antennas.[1] as antenna_1 FROM ...
SELECT data.antennas['1'] as antenna_1 FROM ...
SELECT `data.antennas.1` as antenna_1 FROM ...
But nothing seems to work... :'-(
Here is a working IoT SQL statement using get function (tested using SQL version
2026-03-23
):