Save the Data Received after script execution

Hi,
I would like to store the response of my script to customize the icon image. I am using a third party integration (Bticino my home).

My simple script used to retrieve the status of my device is:

alias: State
sequence:
  - service: myhome.send_message
    data:
      gateway: e8-3b-ff-81-15-1t
      message: "*#5*0##"
mode: single

In the System log I can see the results:

Logger: custom_components.myhome
Source: custom_components/myhome/gateway.py:180
Integration: MyHome (documentation, issues)
First occurred: 1 gennaio 2024 alle ore 23:49:23 (20 occurrences)
Last logged: 13:49:38
[F454 gateway] Data received is not a message: *5*1*##
[F454 gateway] Data received is not a message: *5*5*##
[F454 gateway] Data received is not a message: *5*7*##
[F454 gateway] Data received is not a message: *5*8*##

I would like to store the last message:

: *5*8*##

Does anyone have any suggestions on how to do this?

Thanks in advance,
Antonio