Shell_command in configuration file is not recognised by automation

Hi, I am starting with HA and already managed to integrate my solar invertor (AWorks), but now I am trying to build my first automation based upon shell_command and can’t get it to work. What am I doing wrong? It seems the shell_command is not recognised in the configuration.yaml file.
I run HA OS 12.2 , core 2024.4.3 on a Raspberry PI5
my complete configuration.yaml:

# Loads default set of integrations. Do not remove.

# Load frontend themes from the themes folder
  themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

  - platform: saj
    name: AWorks
    type: wifi
    username: *my uid*
    password: *my pw*

  blynk_set_solar: 'curl*my blynk token* &V47=sensor.saj_aworks_current_power'

my complete automation.yaml:

- id: '1713372970113'
  alias: solar2blynk
  description: ''
  - platform: state
    - sensor.saj_aworks_current_power
  condition: []
  - service: shell_command.blynk_set_solar
    data: {}
  mode: single

When I look at the automation in the UI I get this error message:

Any suggestions highly appreciated.

Try leaving out the ’ ’ round the actual shell command.
or don’t use shell_command but use command_line in config

  - switch:
      name: blynk_set_solar
      command_on: 'curl*my blynk token* &V47=sensor.saj_aworks_current_power'

Thanks Spiro, I’ll try that. If the first suggestion doesn’t work, I’ll have to study the use of command_line first :wink:

Hi Spiro,
I finally got it working, quotes did not help unfortunately, but I found somewhere in this forum the suggestion that it might help if I add the path to the curl command.
Now I have : /usr/bin/curl … and that works!

  - switch:
      name: ok
      command_on: 'curl -k -s  ""'

Ah, interesting. This is how I used the curl command in command_line switch. I wonder why you had to give more of a path? Anyway , you got it working. :+1: