FYI, double single quotes is allowed in yaml. I too made that mistake a year or so ago. So his quoting is valid, but the trigger not resolving to True/False is the real problem.
The above absolutely makes more scene. This was a stupid mistake on my part. I was concentrating on the action portion of the automation, not the trigger. I updated the trigger and will test it out tonight.
I suffer from similar issue. The set input is triggering at the wrong time.
Iāve read this thread, but did not reached a solution. I hope I didnāt miss something.
And an automation script (which uses the ātrueā in the templateās time stamp comparison)
- id: '1587744513372'
alias: 'power on on time '
description: ''
trigger:
platform: template
value_template: "{{ states('sensor.time') == (state_attr('input_datetime.amit_s_light', 'timestamp') | int | timestamp_custom('%H:%M', True)) }}"
action:
- device_id: bc37ba8b5a0c49e690fb1a1e11eb9c49
domain: light
entity_id: light.desk_lamp
type: turn_on
I have set my local time zone and geographical location
I see the ācorrectā UTC time on the home assistant overview page, however, the set time in the input_datetime is triggered 2 hours after the expected time (i.e. if I want to get the trigger at 11:00, I have to set it to 9:00)
Iām living at UTC+2 (which might fit the 2 hours difference) however currently we are at GMT+2+DST, a 3 hours difference from GMT.
Iāve checked the automation itself and the action is working when triggered manually.
Any ideas? further debug steps? Iām newbie here and doesnāt have a debug environment on my computer.
@tom_l Thanks Mate ! Your simple solution works for me. I applied it verywhere now, where the WAF highly increased, since the wife can now easily change the timing of āherā lights herself ā¦
Assuming your input_datetime has time: true and has date: false
Then you should simplify your template to work with text and bypass the utc and timestamp considerations.
Timestamp is always utc aware.
This will always work in local time (I canāt think why anyone would ever want to consider dst offsets or utc in a home automation context but Iām sure someone will be able to come back with one)
Hey guys, Iām trying to add multiple time boxes but for some reason only the first default ones show up Iām unsure why. Could someone point me in correct direction pleaseā¦
config/Input_datetime.yaml
WORKING ONES
both_date_and_time:
name: Input with both date and time
has_date: true
has_time: true
only_date:
name: Input with only date
has_date: true
has_time: false
only_time:
name: Input with only time
has_date: false
has_time: true
NOT EVEN SHOWING IN DEVELOPER
boys_light_off_time:
name: boys Light off time
has_date: false
has_time: true
set_time:
name: Set Time
has_date: false
has_time: true
dt1:
name: Date Time 1
has_date: true
has_time: true
initial: "2019-05-01 07:30"
Lol for some reason Hass was having issues reading the input_datetime.yaml file renamed and now works crazy the simple things can be allusive. Thanks for help