Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95414

Templates in shell_command data

$
0
0

@Juggler wrote:

I have a shell_command that is renaming a file. One of the variables I’m trying to send it is the formatted time value from an input_datetime. I have tested the template {{ state_attr('input_datetime.lastmotion_driveway', 'timestamp') | timestamp_custom('%Y%m%d_%H%M') }} and verified that it is working.

The problem is when I look at the output from the shell_command, it is interpreting the time variable as a literal, not a template. I’ve tried with quotes and without; same effect. I’m sure there is a glaringly obvious way to fix this… anyone?

    - service: shell_command.motion_video
      data:
        action: "mv"
        camera: "driveway"
        time: "{{ state_attr('input_datetime.lastmotion_driveway', 'timestamp') | timestamp_custom('%Y%m%d_%H%M') }}"

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95414

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>