@uphillbattle wrote:
I’m a little confused and haven’t really found anything that explains this to me:
I have a few
input_datetime
inputs, most of them as just times triggering automations daily. I’ve now defined aninput_datetime
with both date and time - the intention is to trigger an automation at a specific time on a specific date.For the daily automations, I trigger them like this:
trigger: platform: template value_template: "{{ states('sensor.time') == (state_attr('input_datetime.tid_for_slukk_lys_helgedager', 'timestamp') | int | timestamp_custom('%H:%M', False)) }}"
This works fine. If
input_datetime.tid_for_slukk_lys_helgedager
is set to00:05
, the automation triggers at00:05
. Checking the value of theinput_datetime
in the template checker with:{{ (state_attr('input_datetime.tid_for_slukk_lys_helgedager', 'timestamp') | int | timestamp_custom('%H:%M',False)) }}
I get
00:05
. All well so far.
If I change thelocal_boolean
parameter (the second parameter intimestamp_custom
) toTrue
, I get01:05
, which is not what I want, so I stick withlocal_boolean
set toFalse
.However, for both time and date, I’ve set
input_datetime.tid_for_sla_pa_varme_i_hytta
to2019-11-08 07:00
. If I check its value in the template checker with{{ (state_attr('input_datetime.tid_for_sla_pa_varme_i_hytta', 'timestamp') | int | timestamp_custom('%H:%M, %Y-%m-%d', False)) }}
I get
06:00, 2019-11-08
. If I change thelocal_boolean
toTrue
, I get07:00, 2019-11-08
.I’m not getting why I have to use
local_boolean
set toFalse
for just time, butTrue
for time and date.Any ideas or pointers?
Posts: 3
Participants: 2