BLE Gateway (BLE Beacons) and MQTT JSON files

I am trying to get some BLE Beacons/Sensors to work in HomeAssistant but I am having some troubles with the MQTT JSON file the Gateway broadcasts. It’s not one topic per sensor but one JSON file containing an array including all the various sensors and beacons.

hardware:

Objective: I would like to create sensors for each parameter of each device. The only way to distinguish the devices is via their MAC addresses. I know for example that the MAC address “AC233FA29263” is the device in my living room. I would like to log/record the Temperature and Humidity as well as the rssi and battery levels (to create automations that will alert me when the devices are offline or the battery level drops below a certain level)

MQTT JSON output:

[
    {
        "timestamp": "2020-03-29T16:58:11.341Z",
        "type": "Gateway",
        "mac": "AC233FC064F3",
        "gatewayFree": 87,
        "gatewayLoad": 1.17
    },
    {
        "timestamp": "2020-03-29T16:58:11.341Z",
        "type": "iBeacon",
        "mac": "AC233FA29261",
        "bleName": "",
        "ibeaconUuid": "E2C56DB5DFFB48D2B060D0F5A71096E0",
        "ibeaconMajor": 0,
        "ibeaconMinor": 0,
        "rssi": -51,
        "ibeaconTxPower": -59,
        "battery": 0
    },
    {
        "timestamp": "2020-03-29T16:58:11.525Z",
        "type": "S1",
        "mac": "AC233FA29261",
        "bleName": "",
        "rssi": -64,
        "battery": 100,
        "temperature": 20.24,
        "humidity": 57.34
    },
    {
        "timestamp": "2020-03-29T16:58:11.530Z",
        "type": "iBeacon",
        "mac": "AC233FA29263",
        "bleName": "",
        "ibeaconUuid": "E2C56DB5DFFB48D2B060D0F5A71096E0",
        "ibeaconMajor": 0,
        "ibeaconMinor": 0,
        "rssi": -71,
        "ibeaconTxPower": -59,
        "battery": 0
    },
    {
        "timestamp": "2020-03-29T16:58:11.550Z",
        "type": "S1",
        "mac": "AC233FA293DC",
        "bleName": "",
        "rssi": -66,
        "battery": 100,
        "temperature": 17.93,
        "humidity": 51.44
    },
    {
        "timestamp": "2020-03-29T16:58:11.830Z",
        "type": "S1",
        "mac": "AC233FA29262",
        "bleName": "",
        "rssi": -68,
        "battery": 100,
        "temperature": 18.44,
        "humidity": 52.76
    },

Hi daggy72,
could you find a solution ?
I have the same need.

no, at some point I just gave up and switched technology

The answer to this question is here in this article.

In the section RSSI and Battery Sensors the author describes this same problem and provides YAML sensor definitions that iterate through the JSON pulling out the desired value. The specific example uses UUID instead of MAC address but I expected the same approach will work.