Detecting movement in Home Assistant using Ikea Vallhorn sensor

I’ve bought some #Ikea motion sensors for 8€ a piece. (see info here)

Pairing to the network in and was somehow difficult, which is not usual for Zigbee devices (at least according to my limited experiences with them). Nevertheless, I succeeded in pairing them.

Unsuccessful attempts

Firstly I tried to pair the sensor with ‘Permit All’ for several times. Pairing failed. I noticed the sensor wanted to connect to my smart plug (SP-EUC01), not to the Zigbee stick (the coordinator). Somehow Aqara didn’t like it and rejected the initial Zigbee ‘interview’.

zigbee2mqtt error message - couldn't pair

Successful attempt

After some tries finally the following method for pairing worked:

  1. Zigbee2MQTT: Permit Coordinator (forcing to join the Sonoff Zigbee Stick).
  2. Pressed the link button shortly 4 times (in 5 seconds). The red diode started to blink (fading) fast and then slowly.
  3. Placed the sensor a few (2) cm near the coordinator.
Ikea Vallhorn motion sensor and Sonoff Zigbee coordinator

The initial step (‘zigbee dialogue’) was completed successfully this time and I was able to add them to the dashboards, automations etc.

The sensor reports:

  • Illuminance (in lux and numerical value)
  • Motion
  • Battery
  • Firmware status and version
  • Last seen, Link quality
reported movement sensor values

Overall, the design of the sensor looks nice and smooth. On the backside, it has 3 buttons:

  1. Link – for pairing
  2. Timer (1 – 5) – probably to notify connected lights when to turn off (after 1 or 5 minutes). Not sure if this function works or even makes sense in Home Assistant.
  3. Light mode – to notify connected lights when to turn on/off (always, only at night). Again, this function is probably useful if you have an Ikea gateway and lights and not in the Home Assistant
Ikea Vallhorn with holder

The package also includes a holder and a piece of double-sided tape. The manual doesn’t include much information.


Why I bought this motion sensor at all? The initial idea was to turn on the Home Assistant dashboard (FireHD tablet) when someone approaches the fridge with the tablet attached.

The automation is simple:

If a motion is detected, then send a notification (‘command_screen_on’) to the tablet (running the #HomeAssistant companion app):

Home Assistant automation - turning on the screen

The automation works ok-ish.

Motion sensor log in Home Assistant

It detects motion and turns on the tablet, but the tablet screen turns off after a minute. I’ve noticed the sensor doesn’t send triggers every time it detects motion, only at the beginning of the motion and after the state is cleared (no motion detected). The states are:

Detected -> Cleared -> Detected -> Cleared … and so on

The effect: if someone is dancing in front of the sensor for several minutes, it will trigger only one time. Meanwhile, the associated automation will not be triggered again.

What I want (from the state perspective) is:

Detected -> Detected -> Detected -> …. Cleared -> Detected ….

I could prolong the screen on time, but that is not the best solution. I have to think about how to solve this issue. Maybe other types of motion sensors behave the way I want?

Ideas for other 2 motion sensors

Ok, this was the first motion sensor I put in use.

The second sensor I’ve put in my workshop to detect motion. I’d like to build a simple home alarm system. A few days ago I thought I heard someone opening doors and walking in my workshop. When I checked, nobody was there, but the unpleasant feeling stayed. So the purpose of the second sensor is to prove if I’m hallucinating and hearing voices or not 🙂

For the 3rd one, I don’t have an idea yet where to put it.

Update 1: Issues with false movement detection

The next day after installation I noticed ‘ghost movements’ at night:

history graph of ghost movements detected

Too bad, it looked like a good sensor. False detections make it unusable.

The community also noticed this issue (1). Will try changing the batteries from 1.5V AAA to 1.2V AAA rechargeables.


I’ve changed the batteries to 1.2V rechargeable ones (Energizer from Kik). The result: no false movement was detected during the night:

I would never figured it out by myself. Thanks, HA community!

Update 2: Undervoltage sensitivity – false movement detected

What’s new: The sensor doesn’t like low voltage either. When the battery dropped under 40%, it showed movement as ‘detected’, even if no movement was present. See the history graph below.

This corresponds approximately to this part on the battery % chart:

When I refilled the batteries, it worked normally again (no constant movement detection).



, , ,



5 responses to “Detecting movement in Home Assistant using Ikea Vallhorn sensor”

  1. Tomi the Slav and 1024 others Avatar

    @tomi Who would have thought that? Changing batteries from 1.5V to 1.2V rechargeable solved false motion triggers. #HA #homeassistant community, you are great.

  2. Dave Avatar

    Thanks for the tip on pairing. That did the trick!

  3. Tomi the Slav and 1024 others Avatar

    @tomi #ikea #vallhorn undervoltage sensitivity and constant movement detection, check the blog post above, last update.

  4. roby Avatar

    I took them and installed them in COMBEE II (after many attempts) but they do not detect movements. Only the ZHALightLevel continues to send the shutdown approximately every minute. A real rubbish!

    1. Tomi Avatar

      Interesting. They play nice (ish) with a Sonoff izgbee USB stick.

Leave a Reply

Your email address will not be published. Required fields are marked *