New Automation issues

I changed my automation file yesterday to the new requirements and this morning and last night I realized that they don’t seem to be firing. For example, I have certain lights turn on each morning and before the changed the automation worked great. Afterwards I have to manually trigger the automation for it to work. Below is my script that I use:

- id: automatic_morning_time
  alias: 'Automatic Morning Time'
  trigger:
    platform: time
    at: '6:30:00'
  condition:
    - condition: state
      entity_id: light.linear_lb60z1_dimmable_led_light_bulb_level_5_0
      state: 'on'
    - condition: time
      weekday:
       - mon
       - tue
       - wed
       - thu
       - fri
  action:
    - service: homeassistant.turn_on
      entity_id: light.linear_lb60z1_dimmable_led_light_bulb_level_5_0
      data:
        brightness: 255
    - service: homeassistant.turn_on
      entity_id: light.kitchen
    - service: homeassistant.turn_on
      entity_id: light.gameroom

Hello.

Can you please try:

- id: automatic_morning_time
  alias: 'Automatic Morning Time'
  trigger:
    platform: time
    at: '06:30:00' #Military time format
  condition:
    - condition: state
      entity_id: light.linear_lb60z1_dimmable_led_light_bulb_level_5_0
      state: 'on'
    - condition: time
      weekday:
       - mon
       - tue
       - wed
       - thu
       - fri
  action:
    - service: homeassistant.turn_on
      entity_id: light.linear_lb60z1_dimmable_led_light_bulb_level_5_0
      data:
        brightness: 255
    - service: homeassistant.turn_on
      entity_id: light.kitchen
    - service: homeassistant.turn_on
      entity_id: light.gameroom

Issue should be with the fact that your time trigger was not in military time format.

also looks like your automation is set to only trigger if the light is already on, so if the light is off at 06:30:00, this automation will not trigger

That was one of my first automation pieces. I’m not sure why I had that in there. I’ve removed it and we’ll see what happens tomorrow.

… And finally, have you double checked that the automation is switched on, as moving them around tends to switch them off.

1 Like

I’ve updated to military time so we’ll see what happens tomorrow.

1 Like

Fingers crossed!

Now that I notice, any reason why you are using service homeassistant.turn_on instead of light.turn_on?

I have a similar automation as yours, and I’m using successfully light.turn_on.

No reason other than that’s just what I saw first.

Try using the Development Services to run both services manually just to check that it works properly.

I was able to manually trigger but when the the automation was supposed to trigger nothing happened. I’m waiting for a real scenario to make sure everything is working. I believe the main issue was the hidden feature initial_state: True was really set to False.

I cleaned up the code and made sure the initial status was set to true and it worked this morning.

Thanks.