I am trying to build an automation where I want to extract the part the string from the trigger data.
My automation involves
Motion eye sending the file path to webook and the webhook fetching the video and sending it via telegram
Action
message: Motion detected in the front door
data:
video:
- url: “http://MY_IPADDRESS/motioneye/”{{trigger.data.filepath[17:]}}
Issue:
I tried to extract the substring with slice
filepath = /media/motioneye/Door-2021-02-18/06-16-04.mp4
I need only Door-2021-02-18/06-16-04.mp4
But the above slice templating is not working as expected and i get the value as
http://MY_IPADDRESS/motioneye//media/motioneye/Door-2021-02-18/06-16-04.mp4
How to just extract the “Door-2021-02-18/06-16-04.mp4”