Automation - execute curl command

I tried for several hours create automation for below scenarios:

1.In case ‘device_tracker.me’ change to ‘home’
Execute CURL command (only one execute).
2.when ‘device_tracker.me’ is other then ‘home’
execute CURL command (only one execute).

before the automation i want to make sure the curl working preperly from HA.

curl --digest -u admin:pass -g '192.168.1.9/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].Covers[].EncodeBlend=false'' 

Tried to execute with shell_command - not working, i verified simple TOUCH command working,i tried also escape all special characters .
rest_command - same

rest_command.yaml

set_on: 'curl --digest -u admin:pass -g '192.168.1.19/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].Covers[].EncodeBlend=true'
'
set_off: 'curl --digest -u admin:pass -g '192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].Covers[].EncodeBlend=false'
'

I guess some1 did something similar - would be thankful if u can share .

It’s very likely you’ll need to specify the full path to curl:

/usr/bin/curl --digest

Thanks FredTheFrong ,
if my command_line.yaml
looks like:

switch:
  - platform: command_line
    switches:
      lounge_ac_test:
        command_on: '/usr/bin/curl --digest -u user/pass -g '192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].Covers[].EncodeBlend=true''
        command_off: '/usr/bin/curl --digest -u  user/pass  -g '192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].Covers[].EncodeBlend=false''

How do i execute it from automation ?
i started with :

 - alias: 'Set mask OFF salon IPC'
   initial_state: 'on'
   trigger:
     platform: state
     entity_id: 'device_tracker.avi' 
     to: 'not_home'
   action:
     **- service: <--- Not sure for this part**
     - service: notify.telegram
       data:
         message: 'Masking camera salon'

again, i need this to be executed once the status changed (‘home’ -->‘not_home’).
what is the proper way to make this automation?
dont really like the hard coded curl commands ,
cause it actually same command with either true/false.

Use the switch name as an object, and specify the turn_on action:

action: switch.lounge_ac_test.turn_on

Thanks FredTheFrog ,
I set the command_line.yaml as following

switch:
  - platform: command_line
    switches:
      salon_masking:
        command_on: "/usr/bin/curl --digest -u user/pass -g '192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].Covers[].EncodeBlend=true'"
        command_off: "/usr/bin/curl --digest -u user/pass -g '192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].Covers[].EncodeBlend=false'"

This part pass validation ,
The problem is with automation.yaml:

 - alias: 'Set mask OFF salon IPC'
   initial_state: 'on'
   trigger:
     platform: state
     entity_id: 'device_tracker.me' 
     to: 'not_home'
   action: 
     switch.salon_masking.turn_on

I tried also:

 action: switch.salon_masking.turn_on

getting error:

Invalid config for [automation]: expected a dictionary @ data['action'][0]. Got None. (See /config/configuration.yaml, line 174). Please check the docs at https://home-assistant.io/components/automation/

I apologize, I was running too many things together (thinking in another computer language at the time!)

  action:
  - entity_id: switch.salon_masking
    service: homeassistant.turn_on

Thanks @FredTheFrog

I set debug on :

logger:
  default: debug

Execute the command from developer tools
the command seems correct but nothing happened:

2019-09-03 09:17:00 INFO (SyncWorker_4) [homeassistant.components.command_line.switch] Running command: curl --digest -u admin:passs -g '192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&VideoWidget[0].Covers[].EncodeBlend=false'
2019-09-03 09:17:00 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.140469103335440] Sending {'id': 22, 'type': 'result', 'success': True, 'result': None}

i also tried executing the curl command as:

/usr/bin/curl
curl
also as /sbin/curl
as when running in terminal
[~] # which curl
/sbin/curl

When i execute the command in terminal it working properly ,
I’m running HA 0.97.2 on a docker( qnap NAS ),
I read somewhere(can’t find it now) that in some cases it may work if execute cur; commands as python command but not sure how implement/try that .