Value_template ERROR Invalid domain name ' ' | Blueprint for calendar based triggers

Tags: #<Tag:0x00007f3270d35460>

Hey, first time posting :slight_smile:
I’m running into the following error for a while now. The following code snippet from my blueprint is from a trashcalendar reminder that triggers a telegrambot notification.

variables:
  time: !input time
  type: !input type
  now: '{{now()}}'
trigger:
- platform: template
  value_template: "{{ as_timestamp(states[type].attributes.start_time) - as_timestamp(now)/(60*60) | int <= float(time) }}"

Unfortunately it is not triggering and sequencially throwing the following error.

What am I missing? I did not find any help to the specific error (homeassistant.exceptions.TemplateError: TemplateError: str: Invalid domain name ‘’)

Home Assistant doesn’t currently support the use of variables in a Template Trigger.

If you would like this ability to be added, please consider voting for:

1 Like

Thank you for the quick reply! are there any workarounds for this problem available?

I’m not sure the advice to “use another kind of trigger” constitutes a workaround but that’s what you will have to do.

I’ve read through some of your posts. You mentioned that it is possible to use variables in templates outside triggers. So would a repeating timed trigger with the same template as a condition work?
exp:

variables:
  time: !input time
  type: !input type
  now: '{{now()}}'

trigger:
- platform: time
  at: '00:10'
condition: 
- condition: template
  value_template: "{{ as_timestamp(states[type].attributes.start_time) - as_timestamp(now)/(60*60) | int <= float(time) }}"

Edit:


Seems not to work.