You need data_template any time you use a template to define the data part in your automation.
You should be able to adapt my example to your needs, just replace the trigger part with your sensor.
You need data_template any time you use a template to define the data part in your automation.
You should be able to adapt my example to your needs, just replace the trigger part with your sensor.
So absolutely nothing like my guess : -
, I must be just another victim of ‘cut and paste from another template’ fatigue
I copied it straight out of the docs, took me like 5 secs
What’s the entity id from the Reed sensor and do you want it to trigger when it goes ‘on’ or ‘off’ ?
I guessed at it from a vague recollection, took me 5 mins, dementia setting in
- id: '1578278123313'
alias: 'Set datetime on change of input_boolean'
description: ''
trigger:
platform: state
entity_id: input_boolean.test_boolean
action:
- service: input_datetime.set_datetime
entity_id: input_datetime.gatestairs
data_template:
datetime: "{{ now().strftime('%Y-%m-%d %H:%M:%S') }}"
the above code works. Thank you.
Now change it to use your sensor as a trigger and done
i did and then used the timestamp attribute and converted it to timestamp_custom to my liking.
Thank you very much for being patient with me