Hello
I have an input datetime who start an automation
alias: Mode presence
description: Active thermostat et chauffe eau a la date saisie
trigger:
- platform: time
at: input_datetime.date_retour
condition: []
action:
- service: climate.set_hvac_mode
target:
entity_id: climate.thermostat
data:
hvac_mode: heat
- service: input_boolean.turn_on
target:
entity_id:
- input_boolean.absent_present
data: {}
mode: single
I want with the same input datetime start my heater water but for example 23 hours later…
For example: i m back in my house the 12/12/2022
The input date time is in french 12/12/2022 00h05
the entity_id: climate.thermostat star at 00h05
The entity_id: water_heater.lineo start at 23h05
I dont know how to do that
Thank’s for your help
Then modify your automation’s Time Trigger to use the Template Sensor.
alias: Mode presence
description: Active thermostat et chauffe eau a la date saisie
trigger:
- platform: time
at: sensor.delayed_return_date
condition: []
... etc ...
alias: Active chauffe eau
description: Active chauffe eau a la date saisie
trigger:
- platform: time
at: sensor.delayed_return_date
condition: []
action:
- service: input_boolean.turn_on
target:
entity_id:
- input_boolean.test
data: {}
mode: single
I test with the input_bolean.test
Nothing happens 1 hour after the input time
The idea is to start the heater before i am back to my secondary house and later (23h) the heater water. I arrived at the end of the journey.
In France we have special price the night for electricity
After executing Developer Tools > YAML > Reload Template Entities, the entity sensor.test_delayed_time appears in Developers Tools > States. It displays the time in UTC (as opposed to my local time) but it’s obvious the minutes portion is 20 + 2 = 22.
I created the following automation to display a notification at the time specified by sensor.test_delayed_time. I created it in the Automation Editor so it was loaded the moment I clicked the Save button.
alias: Test delayed time
description: ""
trigger:
- platform: time
at: sensor.test_delayed_time
condition: []
action:
- service: notify.persistent_notification
data:
title: "{{ now().timestamp() | timestamp_custom() }}"
message: Test delayed time
mode: single
At 08:22, the automation triggered and produced the following notification:
Thank’s for your big help…
The problem was i haven’t restart HA.
When i made i see the sensor in Developers Tools > States and the automation work perfectly
Thank’s so much
But i din’t find Developer Tools > YAML > Reload Template Entities. I restart every yaml. But just the HA restart solved the problem
And now i have the line Developer Tools > YAML > Reload Template Entitie
You’re welcome but please consider marking my post above with the Solution tag.
The purpose of the Solution tag is to direct other users to the post that contains the information that solves the original problem. You marked your own post as the Solution but it contains nothing explaining how to trigger an automation at a later time. Restarting Home Assistant to reload Template Entities isn’t a “solution” to the original problem.
That implies you didn’t have any existing Template Sensors (or any other entities based on the Template integration) and this was your first one. In that situation, yes, you’re obliged to restart Home Assistant in order to load your first Template Sensor.