Rpi3 + motion service camera

Hello, everyone!
I have homeassistant v 0.69.1 installed on a Raspberry 3 with Raspbian OS and i use it for over a year for automations and home security.Now i want to use my old logitech webcam.I have already installed the motion service and it works great.Also i have already configure it on homeassistant and it works great.
But i dont want the camera to be open all over the day.I want to make an automation that starts the motion service when there is a trigger.
I tried to make a shell command ( start_live_cam: ‘motion start’ ) but it seems not to working.
I suspect it has something to do with permissions.
Has anybody any ideas for how can i make it work?