Time trigger not working

Hello, please help me with this code :

automation 3:
  trigger:
    platform: time
    after: '21:55'
  action:
    service: persistent_notification.create
    data:
        message: "automation test"
        title: "message"

I’ve tried to change time format to “21:55” ; “21:55:00” ; ‘21:51:00’. But it seems none of them were work.
but if I change “after:…” to “minutes: ‘/1’”, message appeared on frontend.
I just want to make switch turn on in range 21:55 to 22:55.
Thanks before

Hmm, I can not see anything wrong with your configuration.
I just tested it here and it worked.
Do you see any errors in the log during start up?

wow, it’s confusing.
this is log during startup :

INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=group>
INFO:homeassistant.loader:Loaded automation.time from homeassistant.components.automation.time
INFO:homeassistant.components.automation:Initialized rule automation, 0
INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=automation>
INFO:homeassistant.core:Starting Home Assistant (13 threads)
INFO:homeassistant.core:Bus:Handling <Event homeassistant_start[L]>
INFO:homeassistant.core:Timer:starting
INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: service=stop, domain=homeassistant>
INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: service=restart, domain=homeassistant>
INFO:homeassistant.components.http:Serving / to 192.168.1.101 (auth: False)

Is it oke for " INFO:homeassistant.components.automation:Initialized rule automation, 0 " ?

i have the automation working just like you want it:

  trigger: 
    platform: time
    after: "01:30:00" 
  action: 
    service: input_boolean.turn_off
    entity_id: group.buiten

so that part is not the problem.
i think you have a problem in 1 off youre other automations.

wow, I’m still confusing. what wrong with my code…?

homeassistant:
  # Name of the location where Home Assistant is running
  name: E.R.S.A
  latitude: ###
  longitude: ###
  elevation: ###
  customize:
    switch.outlet_1:
        friendly_name: Lampu LED
        icon: mdi:lightbulb-outline
        assumed_state: false
    switch.outlet_2:
        friendly_name: Lampu SL
        icon: mdi:lightbulb-outline
        assumed_state: false
    switch.outlet_3:
        friendly_name: Lampu Bohlam
        icon: mdi:lightbulb-outline
        assumed_state: false    
    switch.outlet_4:
        friendly_name: Stop Kontak
        assumed_state: false
  # C for Celcius, F for Fahrenheit
  unit_system: imperial
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: EST

# Show links to resources in log and frontend
# introduction:

# View all events in a logbook
logbook:

# Track the sun
#sun:

# Enables support for tracking state changes over time.
history:

# Checks for available updates
updater:

# Allows you to issue voice commands from the frontend
conversation:

# Enables the frontend
# frontend:

# Discover some devices automatically
# discovery:

http:
  api_password: ###

mqtt:
  broker: 127.0.0.1
  port: 1883
  client_id: home-assistant-1
  keepalive: 60

switch 1:
  platform: mqtt
  name: "Outlet 1"
  state_topic: "instalasi/status1"
  command_topic: "instalasi/lampu1"
  payload_on: "1"
  payload_off: "0"
  qos: 0
  retain: true
  optimistic : false
  
switch 2:
  platform: mqtt
  name: "Outlet 2"
  state_topic: "instalasi/status2"
  command_topic: "instalasi/lampu2"
  payload_on: "1"
  payload_off: "0"
  qos: 0
  retain: true
  optimistic : false

switch 3:
platform: mqtt
name: “Outlet 3”
state_topic: “instalasi/status3”
command_topic: “instalasi/lampu3”
payload_on: “1”
payload_off: “0”
qos: 0
retain: true
optimistic : false

switch 4:
  platform: mqtt
  name: "Outlet 4"
  state_topic: "instalasi/status4"
  command_topic: "instalasi/lampu4"
  payload_on: "1"
  payload_off: "0"
  qos: 0
  retain: true
  optimistic : false


group:
  Switch Group: 
   - switch.outlet_1
   - switch.outlet_2
   - switch.outlet_3
   - switch.outlet_4
   
automation 3:
  trigger:
    platform: time
    after: '22:32'
  action:
    service: persistent_notification.create
    data:
        message: "automation test"
        title: "message"

i am confused too :wink:

why did you call it automation 3: if you only have 1 automation?

its also easier to use:

automation:
  alias: 'test automation'

besides that i see you have disabled youre frontend?
and it seems there is an autentication problem. could be related or you have used a wrong password.

Oh, sorry for that “automation 3:…”, I didnt change the name yet.
And for password, that was edited to “###”
And now I’ve enable frontend, add alias, but it seems automation trigger still dont work :

automation:
  alias: "test automation"  
  trigger:
    platform: time
    after: '08:31'
  action:
    service: persistent_notification.create
    data:
        message: "automation test"
        title: "message"

do you mean related to this log ?

INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=group>
INFO:homeassistant.loader:Loaded automation.time from homeassistant.components.automation.time
INFO:homeassistant.components.automation:Initialized rule test automation
INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=automation>
INFO:homeassistant.core:Starting Home Assistant (13 threads)
INFO:homeassistant.core:Bus:Handling <Event homeassistant_start[L]>
INFO:homeassistant.core:Timer:starting
INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: service=stop, domain=homeassistant>
INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: service=restart, domain=homeassistant>
INFO:homeassistant.components.http:Serving /api/stream to 127.0.0.1 (auth: True)
INFO:homeassistant.components.http:Serving /api/bootstrap to 127.0.0.1 (auth: True)
INFO:homeassistant.components.http:Serving / to 192.168.1.101 (auth: False)
INFO:homeassistant.components.http:Serving /api/stream to 127.0.0.1 (auth: True)
INFO:homeassistant.components.http:Serving /api/bootstrap to 127.0.0.1 (auth: True)

how to solve this problem? 192.168.1.101 is my HA server connected via router in same network with espduino, is it related to my automation script?

I do notice a difference between your code and ReneTode code

yours
after: ‘08:31’

ReneTode
after: “08:31”

single quotes compared to double ?

I did change that syntax, single compare to double. But it still wont work for me.
any other solution?

Update:

Sorry, I believe my answer is not valid for your question as I read it again, you already tried “21:55:00” format…

Hi mate,
I am very new to home assistant, however most of my automation is time based and its working nice. A sample code is given below from my configuration…

  • alias: “Turn on Table Lamp @night
    trigger:
    platform: time
    after: “22:10:00”
    action:
    entity_id: switch.Lamp_Switch
    service: homeassistant.turn_on

The only difference, I noticed in your configuration is the time format. I followed the cookbook example which says it should be “HH:MM:SS”. May be you can try that. However, I don’t think ‘single quote’ or “double quote” make any difference as of my understanding the data is listed in a python list as an item anyway. I might be wrong though.

Sorry for the bad formatting, I don’t know yet how you guys paste the configuration in right format here.

Thanks

Big Thanks for your sharing. but I realized that the problem is about time_zone.
I didnt change to my time zone. so actually my code is work at certain place at the time zone :smile:

Hmm at the same time I was doing some test in my virtual environment and was facing the same issue as you mentioned. Then I enabled time_date and then only I figured out that the time in hass is different from my PC :slight_smile:

Anyway glad you figured out the issue.

Hahaha, yap, that was little problem but affect whole system.
For now I’m struggling to set time triggered automation from user-defined time (template).
But till now, I’m facing problem that value template cant be parsed to time platform.

Yeah, I struggled as well… until I read this : https://home-assistant.io/blog/2015/05/09/utc-time-zone-awareness/

Thanks for pointing me in the right direrection :slight_smile: