Tuya zigbee smoke alarm - help with template

Hi guys,

I have a sonoff ZBpro wotking with HA and I just bought a Tuya smoke detector.
The pairing was easy, but getting the alarm out is the tricky part…
The JSON looks like this:

{
  "ZbReceived": {
    "0x94E5": {
      "Device": "0x94E5",
      "Name": "ZBSmoke01",
      "EF00/040E": 2,
      "Endpoint": 1,
      "LinkQuality": 0
    }
  }
}

While playing with it, I think the smoke alarm is shown at the “EF00/040E”: 2 field. but the problem is that the field name also changes… I say the following examples:
“EF00/040E”: 2
“EF00/0104”: 0
“EF00/0401”: 0
“EF00/0401”: 1

I know it is always the third field and the prefix stays the same “EF00/”.

Is theres a way to create a template sensor that gets the values from the third field even tho it changes?
Something the the third spot in an array… or something like that?

Thanks guys in advanced!

OK guys, got it myslef. Just putting it here for other if needed…

I created a template with the following data:

    - trigger:
      - platform: state
        entity_id:
          - sensor.zbsmoke01
        attribute: "EF00/040E"
      sensor:
      - name: ZBSmokeAlarm01
        unique_id: zbsmokealarm01
        state: >
          {% if state_attr('sensor.zbsmoke01','EF00/040E') == 2 %}
            Clear
          {% else %}
            Alarm
          {% endif %}

I noticed that this the most common field name while nothing happen. anything else I consider as alarm…
I will run some more tests in the next couple of days and update.