Shell comman ddoes not work - help needed

Hello,

I need to run a shell command every 5 minute to get the last line from a file notification (logfile). But it does not work until now and I don’t know why:

The shell command from configuration.yaml:

shell_command:
  currentweather: touch sbe.txt

The automation:

alias: Sensor value to file (tail file)
description: ""
trigger:
  - platform: time_pattern
    minutes: /5
condition: []
action:
  - event: ""
    event_data:
      service: shell_command.currentweather
mode: single

What is missing?
What can I do to identify the issue?

Thanks and best regards
sbe

I’m not sure what you’re doing here:

It should be:

action:
  - service: shell_command.currentweather
    data: {}

Also you should test shell scripts in the homeassistant container as that is where they are executed in to be sure they work before incorporating in HA.

docker exec -ti homeassistant bash

Hi,

thanks for the proposed “should be”, now it works.

Best regards
sbe