Salut @Zibasedom_Seblang ,
Dans configuration.yaml tu définies ta « shell_command » comme ça :
shell_command:
my_curl: curl -H « Content-Type: application/json » --data ‹ { « ThPercentage »: 35.0,« Out1_mode »: 3 } › -X POST http://192.168.1.111/rest/api
Et dans ton automation dans la partie « action » tu l’appelles comme ça :
action:
- service: shell_command.my_curl
Vu la syntax du curl lui même faudra peut-être l’entourer de " , en tout cas dans le principe j’utilise un truc dans ce genre dans une de mes automations et ça fonctionne correctement
Chez moi ça donne ça :
shell_command:
notifoff: python3 /config/custom_things/surv-api-cmd.py OFF
notifon: python3 /config/custom_things/surv-api-cmd.py ON
Et pour l’automation :
- id: '9682690821083'
alias: 'Surveillance Station'
description: 'Gestion notif surveillance station'
trigger:
- entity_id: group.people
platform: state
to: 'home'
- entity_id: group.people
platform: state
to: 'not_home'
action:
- service: shell_command.notif{{ 'on' if is_state('group.people', 'not_home') else 'off' }}