Automation not firing from LIFX bulb being turned on

Hi,

I have LIFX download lights and on one of my lights (in wardrobe) I want to create turn it off automatically after 10 minutes, So I created the following automation.

alias: Waldrobe - Turn off light after 10 minutes
description: ""
trigger:
  - platform: state
    entity_id:
      - automation.waldrobe_light
    for:
      hours: 0
      minutes: 0
      seconds: 0
    to: "on"
condition:
  - condition: not
    conditions:
      - condition: state
        entity_id: automation.ensuite_main_light
        state: "off"
action:
  - service: light.turn_off
    metadata: {}
    data: {}
    target:
      entity_id: light.wardrobe_light
mode: single

This is not it’s final form, I have stripped this down as much as I can so it will just immediately run. But the problem is that the automation is not being fired when I turn on the light. I have stripped this down so that it will fire, but the only time it has fired was approx 10 minutes after the light was turned on.

My set up is as follows as my setup may have something to do with this. but I don’t think so, as if I turn on the light from my user interface, i.e. not automations it still doesn’t work.

Basically my set up is that I have a wall switch with a Shelly Plus 1PM behind it. The Shelly is configured in detacted mode and I have a an automation which detects the change in state of the switch and toggles the light.

When I have looking at the device page for the light in question while I toggle the light switch, it is showing almost immediately the change in state.

I think this maybe a bug in the LIFX integration but I am just wanting to get a sanity check on my thinking.

TIA.
Gordon.

You are not monitoring the light for a state change. Your trigger is monitoring whether an automation is enabled or not:

trigger:
  - platform: state
    entity_id:
      - automation.waldrobe_light  # <---- ?????

You probably want something like this:

alias: Waldrobe - Turn off light after 10 minutes
description: ""
mode: single
trigger:
  - platform: state
    entity_id:
      - light.wardrobe_light
    to: "on"
    for:
      hours: 0
      minutes: 10
      seconds: 0
action:
  - service: light.turn_off
    metadata: {}
    data: {}
    target:
      entity_id: light.wardrobe_light

Well this was a id10t error.

Thanks for the help and thanks for being so kind about my stupid mistake.

1 Like