I have a problem with my motion detector rule, and it often works perfectly, but sometimes the light just stays on and doesn’t go off again.
then i have to switch the light off manually.
The rule should work as follows, if movement is triggered, the light should turn on, then he should leave the light on for 30 seconds, I use HUE motion detectors and, as far as I know, it takes 30 seconds to switch from “occupied” to “unoccupied”.
then he should check whether there is no more movement and switch off the light.
sheminasalam’s suggestion should fix the problem (and you can also remove the delay).
The condition you currently have will only allow the light to be toggled if the occupancy sensor is off 30 seconds after it was turned on. If after 30 seconds it’s still on, the light is left on and the automation is finished (thereby explaining why “sometimes the light just stays on and doesn’t go off again”).
The use of wait_for_trigger should produce the behavior you want.
It’s a warning, not an error. Your automation’s mode is single. While wait_for_trigger is waiting for the occupancy sensor to be not_occupied, it ignores any re-triggering of the automation. That’s the meaning of mode: single and the message is normal.
If you wish, you can try this version:
alias: Bewegungsmelder -- Erster Stock
description: (Sonnenuntergang )
trigger:
- platform: state
entity_id: binary_sensor.bewegungsmelder_1er_stock_32496408_occupancy
to: 'on'
- platform: state
entity_id: binary_sensor.bewegungsmelder_1er_stock_32496408_occupancy
to: 'off'
for: '00:00:30'
condition: "{{ is_state('sun.sun', 'below_horizon') }}"
action:
- service: light.turn_on
target:
entity_id: light.osram_classic_a60_w_clear_lightify_5372040a_level_on_off
data:
brightness_pct: "{{ 20 if trigger.to_state.state == 'on' else 0 }}"
mode: single
Hi there,
I set up my homeassistant from scratch, now it seems to be working. I also used my HUE bridge again instead of connecting everything to the ConbeeII.