Hi,
I’m using a hue motion sensor with a yeelight that shall be turned on when a motion is detected.
I have the following automation rule:
- id: '1563820549062'
alias: Turn on lights in living room
trigger:
- entity_id: binary_sensor.living_room_hue_motion_movement
platform: state
to: 'on'
condition:
- below: '8000'
condition: numeric_state
entity_id: sensor.living_room_hue_motion_illuminance
action:
- data:
entity_id: light.living_room_light
service: homeassistant.turn_on
- data:
entity_id: timer.turn_off_living_room_lights
service: timer.cancel
- data:
entity_id: timer.turn_off_living_room_lights
service: timer.start
It works in general, but sometimes when the light goes off and I start moving again, I see that the hue motion sensor reacts, but it doesn’t trigger the lights.
I’m using zigbee2mqtt to communicate with the hue motion sensor and no other components.
I checked the zigbee logs and found the following:
zigbee2mqtt:info 7/25/2019, 9:30:15 PM MQTT publish: topic 'zigbee2mqtt/living_room_hue_movement_sensor', payload '{"battery":100,"linkquality":0,"illuminance":11142,"temperature":27.78,"occupancy":true}'
zigbee2mqtt:info 7/25/2019, 9:30:15 PM MQTT publish: topic 'zigbee2mqtt/living_room_hue_movement_sensor', payload '{"battery":100,"linkquality":0,"illuminance":0,"temperature":27.78,"occupancy":true}'
zigbee2mqtt:info 7/25/2019, 9:30:17 PM MQTT publish: topic 'zigbee2mqtt/living_room_hue_movement_sensor', payload '{"battery":100,"linkquality":0,"illuminance":0,"temperature":27.78,"occupancy":true}'
So, I think the problem is that if it detects a movement it still has the old illuminance value (when the light was on) and then the condition fails. Any ideas how to work around that?