Good morning.
Can anyone see what’s going wrong? the toilet lamp does turn on. only this one goes out quite quickly. but then no longer turns on during movement. so if someone sits still for a long time, he sees no movement and the lamp goes out. but I can now also set it so that if the sensor detects no movement, it will dimly turn off. and the person is therefore triggered to move?
alias: Wc lamp
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.wc_motion
to: "on"
id: Motion detected
- platform: state
entity_id:
- binary_sensor.wc_motion
to: "off"
for:
hours: 0
minutes: 4
seconds: 0
condition: []
action:
- if:
- condition: trigger
id:
- Motion detected
- condition: sun
before: sunset
after: sunrise
then:
- service: light.turn_on
data:
brightness_pct: 40
target:
entity_id:
- light.wc
else:
- service: light.turn_off
data:
transition: 60
target:
entity_id: light.wc
- if:
- condition: trigger
id:
- Motion detected
- condition: sun
after: sunset
- condition: time
before: "23:00:00"
then:
- service: light.turn_on
data:
brightness_pct: 30
target:
entity_id: light.wc
else:
- service: light.turn_off
data:
transition: 60
target:
entity_id: light.wc
- if:
- condition: trigger
id:
- Motion detected
- condition: time
after: "23:00:00"
before: "06:00:00"
then:
- service: light.turn_on
data:
brightness_pct: 15
target:
entity_id: light.wc
else:
- service: light.turn_off
data:
transition: 60
target:
entity_id: light.wc
- if:
- condition: trigger
id:
- Motion detected
- condition: time
after: "06:00:00"
- condition: sun
before: sunrise
then:
- service: light.turn_on
data:
brightness_pct: 30
target:
entity_id: light.wc
else:
- service: light.turn_off
data:
transition: 60
target:
entity_id: light.wc
mode: single