Hi, I’m looking for a simple automation/script/blueprint that Turns off the lights, when no motion is detected after 10 seconds, and auto dims after 5 seconds.
I’ve tried and tested the blueprints available in the forums, but can’t get them to work for some reason, or they don’t turn the light of a set time.
I’m using a Sonoff Mini (Zigbee) with Tasmota Zbridge.
The community forum is filled with examples of automations and blueprints to create a motion-controlled light. It’s concerning that you were unable to get any of them to work. If the following example fails then there’s a fundamental problem somewhere in your system.
Simply change the names of the entity_ids to match what you have. It turns off the light after 3 minutes of no motion detected.
alias: example 555
mode: restart
trigger:
- platform: state
entity_id: binary_sensor.kitchen
to: 'on'
- platform: state
entity_id: binary_sensor.kitchen
to: 'off'
for: '00:03:00'
condition: []
action:
- service: 'light.turn_{{ trigger.to_state.state }}'
target:
entity_id: light.kitchen
Thanks. I’ve tested this as well and @huu code, but couldn’t get it to work correctly unfortunatly. You maybe right, I think my motion sensor is at fault here sadly.
I guess a Sonoff ZbMini (Sonoff Mini is Wifi), but that is a switch, not a motion sensor. Can you see change in logbook or history for your motion sensor ? Are you using tasmota2zigbee or ZHA with your ZbBridge ?
@francisp Yes it’s a switch, the Sonoff Mini is zigbee based (not wifi).which is connected to the light. I’m using ZHA integration and both devices are paired. The Zbbridge is flashed with Tasmota.
In the logbook the motion sensor keeps switching to ‘Motion’ and ‘Cleared (no motion detected)’ after a few seconds.
I’m not sure if the sensor is faulty, but it’s look likely to be unfortunately. It is a pretty old sensor with slow response, and I don’t think it supports occupancy either. Model: Tuya PIR RH3040 (the square design)