I want to make an automation to turn a light off, after X minutes. No matter how the light was turned On.
I have tried all kind of combinations, and tried all the tips I found googling. But the automation never seems to get triggered. I have changed the trigger to check from ‘Off’ to ‘On’, also added the delay to the action instead of the trigger. But it just seems that the automation never triggers.
(just using 10 in the code below to check the automation in 10 seconds)
When I click execute on the automation, it does turn off the light.
alias: Slaapkamer uit na 30 minuten
description: ''
trigger:
- platform: state
entity_id: light.54802417d8f15bcdfb49
to: 'On'
for: '10'
condition: []
action:
- type: turn_off
device_id: 9c6bd3a09a47421fb7dd732cf6a0db1f
entity_id: light.54802417d8f15bcdfb49
domain: light
mode: single