Store incoming sms data in sensor

Hello, my home assistant instance recieves data via incoming sms from a mobile device and stores it as state in template sensor. Later the sensor state text will be parsed and different sensors created with values like temperature, binary sensors etc. All works well.

Extract from my templates.yaml:

  • trigger:
    platform: event
    event_type: sms.incoming_sms
    sensor:
    name: Status SMS
    state: “{{trigger.event.data.text}}”

Problem: if sms status message is too long, it will be sent as two seperate sms messages. Now, the sensor data from first sms obviously gets overwritten by second sms.
Is there a way to append the sensor data of multiple sms being triggered by the same event sms.incoming just a few seconds or so later? Or do I need to set up a for loop inside template? I just can’t figure it out… Help appreciated! Thanks!

You may want to use some of the techniques shown in one of the following posts to store the data: