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.
Tried to execute with shell_command - not working, i verified simple TOUCH command working,i tried also escape all special characters .
rest_command - same
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.
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/
/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 .