BLE Client reading BBQ Probe

I got a BBQ Probe Set that i want to read with BLE Client. The set consists of a basestation and two probes.

I could figure out that the basestation is serving the data via one UUID. The values are not published at the same time but one after another on the same UUID. The 2nd and 3rd byte contain the identifier (last two blocks of the MAC in reverse) wich identify if the values belong to one of the two probes or the basestation (see attached picture).

Until now i could figure out how to read the temperature from the 7th byte, but i couldn´t figure out how to put a if then statement inside the lambda to read the temperature and battery state of the probes and basestation individually.

The information inside the wiki on lambda is kinda short, and i also couldn´t find a example that fit for my problem. So i hope someone could help or point me in the correct direction.

Regards

Roque

esphome:
  name: aiprober
  friendly_name: AIPROBER

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxx"

ota:
  - platform: esphome
    password: "xxx"

wifi:
  ssid: "xxx"
  password: "xxx"

  ap:
    ssid: "Aiprober Fallback Hotspot"
    password: "xxx"

captive_portal:


ble_client:
  - mac_address: EB:05:00:00:05:EC   
    id: aiprober2_05ec
    auto_connect: true

sensor:
  - platform: ble_client
    type: characteristic
    ble_client_id: aiprober2_05ec
    id: p1_temp
    name: "P1 Temperatur"
    service_uuid: '00001010-434e-535a-4841-4e4259544553'
    characteristic_uuid: '00001012-434e-535a-4841-4e4259544553'
    notify: true
    lambda: |-
      uint16_t p1_temp = x[7];
      return (float)p1_temp;
    icon: 'mdi:transmission-tower-import'

Haven’t tried but I would expect it to go like this

lambda: |-
   if (x[2] == 0x24){
   uint16_t p1_temp = x[7];
   return (float)p1_temp;
   }

I wonder if the example here helps