Cant send transmission event information thru notification

Hello,

I am trying to set up automation to receive Telegram notifications whenever a Torrents starts or finished downloading. My notification system is working okay, and I can trigger the flow when the event happens.
But I can not pull information from the event so I can include it in the notification.
Namely, I want to send the name of the torrent in the notification.

Basically, the notifications that I get for now are just “Torrent finished! [blank torrent name]”
Because im not sure on how to format the code to pull the name from the event.
How do you do it?

This is my node flow:

[{"id":"ffde9529.e81178","type":"server-events","z":"f26fbf34.385be8","name":"torrent finished","server":"a0018f6b.a40b3","event_type":"transmission_downloaded_torrent","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"x":120,"y":580,"wires":[["4dbce032.0e733"]]},{"id":"4dbce032.0e733","type":"api-call-service","z":"f26fbf34.385be8","name":"","server":"a0018f6b.a40b3","version":1,"debugenabled":false,"service_domain":"notify","service":"telegram_bot","entityId":"","data":"{\"title\":\"*Torrent finished*\",\"message\":\"joo {{trigger.transmission_downloaded_torrent.data.name}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":390,"y":540,"wires":[["1cd6b8f2.49f2c7"]]},{"id":"3d979131.f3fa16","type":"server-events","z":"f26fbf34.385be8","name":"torrent started","server":"a0018f6b.a40b3","event_type":"transmission_started_torrent","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"x":250,"y":700,"wires":[["56b55f68.573e68"]]},{"id":"56b55f68.573e68","type":"api-call-service","z":"f26fbf34.385be8","name":"","server":"a0018f6b.a40b3","version":1,"debugenabled":false,"service_domain":"notify","service":"telegram_bot","entityId":"","data":"{\"title\":\"*Torrent started*\",\"message\":\" jo {{ trigger.transmission_downloaded_torrent.data.name }}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":550,"y":680,"wires":[["1cd6b8f2.49f2c7"]]},{"id":"9b27c782.0e0ac","type":"inject","z":"f26fbf34.385be8","name":"","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":380,"y":620,"wires":[["56b55f68.573e68","4dbce032.0e733"]]},{"id":"1cd6b8f2.49f2c7","type":"debug","z":"f26fbf34.385be8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":770,"y":580,"wires":[]},{"id":"a0018f6b.a40b3","type":"server","z":"","name":"NewHASSIO","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

And this, is the event information:

{
    "event_type": "transmission_downloaded_torrent",
    "data": {
        "name": "[HorribleSubs] Re Zero kara Hajimeru Isekai Seikatsu - 26 [1080p].mkv"
    },
    "origin": "LOCAL",
    "time_fired": "2020-07-17T06:19:53.536120+00:00",
    "context": {
        "id": "d778f5a645a04204af0f5d1c4504d516",
        "parent_id": null,
        "user_id": null
    }
}

Try it with this:

{
    "title": "*Torrent started*",
    "message": " jo {{ payload.data.name }}"
}

thanks for your reply.

That one still does not work, it passes as blank

Hi, this issue has been fixed.
This The Hook up video helped me video on node red

Your solution was close, @AlmostSerious
it was supposed to be

{
    "title": "*Torrent finished*",
    "message": "{{ payload.event.data.name }}"
}

Okay… so its not completely solved yet. It works fine when I trigger the event using the Developer Tools.
But it does not when the events are triggered by an actual torrent

This is the error that Node-Red gives me, in the node that sends the notification:

Call-service API error.  Error Message: required key not provided @ data['message']

Mind you, this only happens when the flow is triggered by adding/finishing an actual torrent. It does not happen if I trigger the event myself
Anybody has any idea?

That probably means the payload is a bit different. Try connecting it to the debug node, select complete msg and see what arrives when a torrent finishes.

Hi.

Call-service API error.  Error Message: required key not provided @ data['message']

Thats what I get from the debug node, its the same error message I was getting at the start. It will send the notification if I add something else to the message, but the torrent name wont appear. Which means it sees the payload or event info as blank.

To make it weirder, If i use the HA automation suggested here, it will work with the real triggers, but not with the ones I send myself.

Now, for example, adding a torrent ( I want notifications for both adding and finishing) will produce this event information:

{
    "event_type": "transmission_started_torrent",
    "data": {
        "name": "Dark PHOENiX - Flowers for Patchouli"
    },
    "origin": "LOCAL",
    "time_fired": "2020-07-18T07:55:09.303738+00:00",
    "context": {
        "id": "8a7a3000c6ff45328567b9d6dd8b4719",
        "parent_id": null,
        "user_id": null
    }
}

And it will produce a notification from the HA automation, but not from Node-Red. If i trigger the event from the Developer Tools, with the exact same event information, it will send the notification from Node-Red, but not from HA…

What i meant: Your manually triggered event and the event sent from the entity seem to be different.
So NodeRed may not be able to find the key @ payload.event.data.name.
You can simply copy the complete message path in the debug with the symbol “>_”
Is this actually payload.event.data.name?

Some example on the 3 little symbols that enable you to easily copy the whole path, the value or pin it open.
image

This is the result when I send the event myself: payload.event.data.name
image
And this is from one generated by Transmission: payload.event.name
image

I just did a test with just payload.event.name and it worked.
Thank you so much for your help!