The below listed automation has some very weird behaviour:
The binary sensor gets state 'occupied', then light switches on but also very quickly < 0.5s also off gain.
The attached screenshot shows a detail of the Trace Timeline which confirms the switch indeed turns on and off.
I'm using a Sonoff ZBMINI (with neutral line) as a switch.
alias: "Zolder Verlichting beweging "
description: ""
triggers:
- type: occupied
device_id: 13d1c08c4154febe2c8afd1bc60e2b62
entity_id: 7d507c6d4555bb0e7d1fe5e5f2a7f67b
domain: binary_sensor
id: Aanwezig
trigger: device
- type: not_occupied
device_id: 13d1c08c4154febe2c8afd1bc60e2b62
entity_id: 7d507c6d4555bb0e7d1fe5e5f2a7f67b
domain: binary_sensor
id: Afwezig
trigger: device
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id:
- Aanwezig
sequence:
- type: turn_on
device_id: 4523d0526cabc130a4e4afc04dc8197c
entity_id: 1fd37b1e3552b9e28dbfeeca83d98e23
domain: switch
- conditions:
- condition: trigger
id:
- Afwezig
sequence:
- delay:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
- type: turn_off
device_id: 4523d0526cabc130a4e4afc04dc8197c
entity_id: 1fd37b1e3552b9e28dbfeeca83d98e23
domain: switch
mode: restart
Is there something I can do to figure out why this happens? And how to solve this?