Notify message

hello.
Please very nicely, will someone help me convert the functional message from home-assistant automation so that it is usable in Node-Red? I’ve been working through a system for days - trial and error - with no working results. I can’t do this.
Thank you very much in advance.

It’s a message:

Zařízení SONOFF {{ trigger.to_state.attributes.friendly_name }} se v {{now().strftime('%H:%M:%S') }} hodin odpojilo od Wifi.

{“message”:“Zařízení SONOFF {{ trigger.to_state.attributes.friendly_name }} se v {{now().strftime(‘%H:%M:%S’) }} hodin odpojilo od Wifi.”}

That’s exactly what’s not working.

Thank you for your help.

Trigger does not exist in node red.
You have msg.
If you connect your event node (?) to a debug node with it set to msg instead of payload then you will see the message sent.

Then you need to replace your trigger yaml with msg path that you get from the debug.

Some thing like msg.new_state.attributes.friendly_name or something…

Thank you for your reaction.
Trigger I can skip,. However, “friendly_name” Devices could be supplemented from “Events:state” if it is not possible it is not something fundamental that would have to be in the report

But time is of the year. I could use that.

For the Friendly_Name, I use a function node and put it like this. This will tell me Front Door opened.

const friendlyName = msg.data.new_state.attributes.friendly_name;
node.status({text: friendlyName});
return {
        "payload": {
           "data": {
               "message": friendlyName + " opened"
           } 
    }
};

I don’t quite understand exactly how to use it.