@Jer78 Thanks for posting your config. I’ve been trying to do the same thing, but I wanted to try and use at
from the time
trigger. So, instead of the following (I’m using your config here as an example):
- alias: 'Announce Calendar Leave time'
trigger:
platform: time
minutes: '/1'
seconds: 0
condition:
condition: and
conditions:
- condition: template
value_template: '{{ states.sensor.sys_time.state == states.sensor.calc_leave_time.state }}'
I would rather like to do the following:
- alias: 'Announce Calendar Leave time'
trigger:
platform: time
at: states.sensor.calc_leave_time.state
That doesn’t seem to work though.
In my own configuration I have the following sensor which is using the google_travel_time
sensor called ‘sensor.my_sensor’:
- platform: template
sensors:
leave_for_my_sensor:
value_template: "{{ strptime(states.sensor.my_sensor.attributes.arrival_time, '%H:%M:%S') - strptime(states.sensor.my_sensor.state, '%M') }}"
friendly_name: My sensor
unit_of_measurement: time
Its state is e.g. 9
and its attributes.arrival_time
is set to '08:10:00'
, so as a result I would like to get '08:01:00'
, which is working and I do get that as a result. The problem I’m having is using this value in an automation.
In my automation I’m trying to use it like the following:
trigger:
- platform: time
at: sensor.leave_for_my_sensor
That results in the following error:
Invalid config for [automation]: Invalid time specified: sensor.leave_for_my_sensor for dictionary value @ data['trigger'][0]['at']. Got None
I’ve also tried to use it like this (doesn’t work either):
trigger:
- platform: time
at: '{{ sensor.leave_for_my_sensor }}'
So, I was wondering why you’re using it like this instead of using at
for instance and also if someone here could point me in the right direction to use it in combination with at
.