So… I have a light left on overnight (again!)… last time this happened, I did some digging and found an error in my logs showing the device did not respond.
Todays issue is different… different light, no errors in the logs.
The light is turned on and off by a mmwave sensor, and this is its log book entry:
You can see that occupancy was last detected at 23:09:37 and cleared at 23:26:06 yesterday, and wasn’t detected again until 08:56:41 this morning.
This is the lights log book:
You can see that the light was turned on exactly at 23:09:37 as occupancy was detected, but thats the last entry for the day. So nothing happened (no automation fired) 17 minutes later at 23:26:06 to turn the light off.
This is the automation:
alias: Office - Motion Lights Off v2
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.tuya_plug_office_pc_only_active_power
below: 5
id: power
- platform: state
entity_id:
- binary_sensor.tuya_mmwave_office_occupancy
to: "off"
id: occupancy
- platform: state
entity_id:
- sensor.tuya_mmwave_office_illuminance
id: illuminance
for:
hours: 0
minutes: 0
seconds: 2
condition: []
action:
- choose:
- conditions:
- condition: trigger
id:
- illuminance
- condition: template
value_template: >-
{{states('sensor.tuya_mmwave_office_illuminance')|int(0) >
(states('input_number.office_illuminance_threshold')|int(0)+30)}}
sequence:
- service: light.turn_off
data: {}
target:
entity_id: light.tuya_rgb_bulb_office_light
- conditions:
- condition: trigger
id:
- power
- occupancy
sequence:
- wait_for_trigger:
- platform: state
entity_id:
- binary_sensor.tuya_mmwave_office_occupancy
to: "off"
timeout:
hours: 0
minutes: 2
seconds: 1
milliseconds: 0
continue_on_timeout: true
- if:
- condition: state
entity_id: binary_sensor.tuya_mmwave_office_occupancy
state: "off"
then:
- service: light.turn_off
data: {}
target:
entity_id: light.tuya_rgb_bulb_office_light
mode: restart
So given this trigger:
- platform: state
entity_id:
- binary_sensor.tuya_mmwave_office_occupancy
to: "off"
id: occupancy
Why is there no trace of the automation running in the logbook ?