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

Cannot get macros to resolve in Automations

$
0
0

@rhouseman wrote:

I am working my way into Home Assistant. I’ve got my instance running in a venv on a Fedora VM, and am updated to .104.1. I’ve run across an issue trying to create an automation that I cannot figure out.

Here’s the yaml I’m using:

  alias: download video when motion detected
  description: ''
  trigger:
  - entity_id: binary_sensor.side_door_motion
    from: 'off'
    platform: state
    to: 'on'
  action:
  - data:
      filename: "{{ states('camera.side_door', 'friendly_name') }}"
      overwrite: false
      subdir: "{{ states('camera.side_door', 'friendly_name') }}"
      url: "{{ states('camera.side_door', 'video_url') }}"
    service: downloader.download_file

My problem is that none of the attributes resolve. If I hard code a URL in there, it does it’s thing and it creates a subdirectory called {{ states(‘camera.side_door’, ‘friendly_name’) }} and a file of the same name in the folder. If I paste this code into the dev tools/template page, it all resolves as expected. I’ve tried changing the quotes, spacing, using states.camera.side_door.attributes.video_url instead of the above syntax, and nothing I do works once it’s an automation. It fires correctly, which is what most of the posts I can find have problems with, but the action doesn’t work.

Help!

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 101645

Trending Articles



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