Help Needed: VALLHORN Motion Sensor and TRÅDFRI Light Setup Issue ZIGBEE

Hi everyone
I’m new to Home Assistant and recently purchased the VALLHORN motion sensor and a TRÅDFRI light from IKEA. I set them up in my closet with the goal of having the light turn on when the door is opened (or motion is detected) and turn off when the door is closed (or no motion is detected).

Here are the settings I configured, but for some reason, it’s not working as expected. Any advice or suggestions would be greatly appreciated!

You should also (and foremost) post the automation you created (as text, please, not screenshots)

1 Like

Thanks for responding
Did I understand correctly?

this is for Light ON


id: '1735021898339'
alias: Light Switch ON
description: ''
triggers:
  - type: opened
    device_id: f13c1d22a2fac3687709be3b5e2a735c
    entity_id: eeb9ac06396b2dcef7577e03b2fc2dce
    domain: binary_sensor
    trigger: device
conditions: []
actions:
  - action: light.turn_on
    metadata: {}
    data:
      kelvin: 6500
      transition: 32
    target:
      area_id: bedroom
      device_id: 4cdc0f27b555b753f36c9c67c16715db
mode: single

this is for Light Off


id: '1735021952423'
alias: Light Switch OFF
description: ''
triggers:
  - type: not_opened
    device_id: f13c1d22a2fac3687709be3b5e2a735c
    entity_id: eeb9ac06396b2dcef7577e03b2fc2dce
    domain: binary_sensor
    trigger: device
conditions: []
actions:
  - action: light.turn_off
    metadata: {}
    data:
      transition: 22
      flash: short
    target:
      area_id: bedroom
      device_id: 4cdc0f27b555b753f36c9c67c16715db
mode: single

A few thoughts: use the “occupancy” state not the “opened” state and instead of targeting the area, target just the entity you want to turn on. Also, you can test if the light turns on by manually running the automation and you can see if the trigger works in the automation editor as well.

Another two things to consider: you can use the motion activated light blueprint (click new automation then choose “motion activated light”) and motion sensors take 15-60s to reset after each motion, so they can be a bit difficult to test.

Define “not working as expected”.

I have vague memories of having to manually reassign the types of one or more binary sensors because they were not correct in the default quirk. As long as you use the correct entity that shouldn’t really matter though as it just changes what the states are called. One of entities will immediately deactivate when it no longer detects motion, while the other has a 1 or 5 minute delay, set by one of the buttons on the back.