#A little help with vallhorn motion sensor

1 messages Β· Page 1 of 1 (latest)

fast token
#

Hey guys,

Im very new to the home assistant stuff, so please bare with me if this is a simple issue.

Im running a raspberry pi 4b with home assistant OS and a conbee III. ZHA for ikea integration.

Most of my setup is the smart plugs for energy monitoring, with some lights and motion sensors mixed in.

My issue is with the Vallhorn motion sensor. I have a routine in place where if it detects a change from no motion detected > motion detected it will turn on 2 lights, have a delay for 2m and then turn off the lights. This is all working correctly.
The issue comes with resetting the timer, I could be in the room for 2 minutes and it will detect the motion, but its wont reset the timer.

I will post my YAML script once I get home, but any ideas are appreciated πŸ™‚

topaz coral
#

Hi, you must change the way the automation works

#

In the automation, open the menu in the upper right

#

I think it's "change mode", I have mine in Spanish, I don't know how it is in the English one πŸ˜…

#

And then you select "Restart" or something similar, it's the second option from above

#

I have something very similar in my kitchen with that sensor, and works as expected with that configuration πŸ˜‰

fast token
#

Thank you! Ill have a look when I get home and report back

exotic stump
#

depending on the behaviour of the motion sensor you can also turn off the lights when no motion is detected
I usually go with the approach "M" has suggested, but the IKEA motion sensor that I use (https://www.zigbee2mqtt.io/devices/E1525_E1745.html#ikea-e1525%252Fe1745) will report occupied as long as you run around in front of it

fast token
#

Maybe i should look into zigbee2MQTT over ZHA

topaz coral
fast token
#

This is my YAML :

alias: Washroom Motion Lights
description: "trigger lights when motion is detected and turn off after 3m"
triggers:

  • entity_id:
    • binary_sensor.washroom_motion_sensor
      trigger: state
      from: "off"
      to: "on"
      actions:
  • data:
    brightness_pct: 100
    action: light.turn_on
    target:
    device_id:
    - eeb3cdfddf4e176ca54409eaedd89d78
    - eb891d01f369bad8a865c1c67572122a
  • delay:
    hours: 0
    minutes: 3
    seconds: 0
    milliseconds: 0
  • data: {}
    action: light.turn_off
    target:
    device_id:
    - eeb3cdfddf4e176ca54409eaedd89d78
    - eb891d01f369bad8a865c1c67572122a
    mode: restart
lime quail
#

There is a Motion Light blueprint in the default installation. You can use that just specifying the Motion Sensor, Light and time for the light to remain on

#

This is some of the code from the blueprint, you can use it as an automation just change the '!input' accordingly.

trigger:
  platform: state
  entity_id: !input motion_entity
  from: "off"
  to: "on"

action:
  - alias: "Turn on the light"
    service: light.turn_on
    target: !input light_target
  - alias: "Wait until there is no motion from device"
    wait_for_trigger:
      platform: state
      entity_id: !input motion_entity
      from: "on"
      to: "off"
  - alias: "Wait the number of seconds that has been set"
    delay: !input no_motion_wait
  - alias: "Turn off the light"
    service: light.turn_off
    target: !input light_target
fast token
#

Thank you! Where can I find these default blueprints?

lime quail
#

Setting -> Automations & Scenes then the Blueprint tab

#

click the 3 dots and then 'Create Automation' or 'Create Script'