Hive Motion Sensor

I’m struggling with making a automation for my Hive motion sensor. What I want to do is:

Trigger: Motion detected
condition: between sunset-10pm
action: turn on light for 2 minutes. brightness 50%
condition: between 10pm-6am
action: turn on light for 1 minute. brightness 10%

At the moment I start basic and just want to get the light to turn on to a certain brightness.

- id: '1574256582632'
  alias: Landing
  description: ''
  trigger:
  - entity_id: binary_sensor.landing_sensor
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      brightness: 50
      entity_id: light.landing_lights
    service: light.turn_on

If I trigger the automation manually it works which seems to suggest it’s the trigger that isn’t working.

Few things:

  • Is the automation turned on?
  • Is the entity ID in the trigger correct?
  • Do you see that entity change to on when you walk in front of it?

Also, if you want the light to turn on to 50% brightness, you want to use

brightness_pct: 50

brightness is a value between 0 and 255.

Thanks.

Yes the automation is on and yes the entity ID is correct.

I think you may be right in that the state change isn’t right, I’m having difficulty seeing exactly what that is. I’ve seen on, off, clear and detected but not sure what I need to use.

I chose 50 as a random number that wasn’t full brightness. but thanks for the heads up on the percentage value :slight_smile:

Binary sensors can only be on or off. What’s displayed in the frontend is a “friendly name” for the actual state based on the device class.

Double-check in Developer Tools > States that the state of the motion sensor changes when you walk in front of it though. Perhaps the sensor isn’t responding.

I guess the clue is in the name, binary :wink:

I can see the state change to on, but it seems to stay on after the motion has stopped. Is this expected?

True :wink:

Yep, most motion sensors report a state of on for a varying length of time (depends on the sensor) after motion is detected. It should go back to off soon after motion stops being detected.

Hmm ok, maybe it’s always worked but there is one hell of a delay. can take a couple of minutes for the lights to come on.

- id: '1574256582632'
  alias: Landing on
  description: ''
  trigger:
  - entity_id: binary_sensor.landing_sensor
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      brightness: 50
      entity_id: light.landing_lights
    service: light.turn_on
- id: '1574268513709'
  alias: Landing off
  description: ''
  trigger:
  - entity_id: binary_sensor.landing_sensor
    for: 00:02:00
    platform: state
    to: 'off'
  condition: []
  action:
  - data:
      entity_id: light.landing_lights
    service: light.turn_off

Also note the sensor has to change from any other state to on in order for the first automation to trigger. So if it’s already reporting a state of on when you walk in front of it, the automation won’t trigger.

Hmm that’s not good, it seems to stay on for a long time.

So it does kinda work, but the lights will come on randomly, after the sensor is triggered. Probably because it’s “on” for such a long time.

I don’t think it’s randomly. I just read that the Hive motion sensor will change to ‘on’ for 5 minutes after motion has been detected.

So let’s say you enter the room for the first time, the motion sensor changes from ‘off’ to ‘on’, your first automation will trigger and the light turns on.
Now 1 minute later you leave the room, and 2 minutes later you enter the room again. The motion sensor is still ‘on’, so your first automation to turn off the lights will not trigger and therefore your lights will still be on. The motion sensor delay of 5 minutes will be reset.
The light will turn off 7 minutes (5 minutes the motion sensor stays ‘on’ + 2 minutes delay in your automation) after the last motion has been detected.

The biggest issue is that it doesn’t turn on as soon as the motion is detected.

Then probably the Hive motion sensor is not pushing state changes to home assistant, but home assistant is polling the status of the motion sensor.
If it is like this, then your motion sensor is useless, because the new state will only be polled from the sensor at a certain interval of maybe 1-2 minutes.

This sounds like what is happening. I guess I’ll have to continue using Hive to trigger the light.

The Hive integration is cloud polling, so unfortunately that is probably what’s going on. Depends on the poll rate.

Looks like I need to find a new motion sensor. I can’t achieve what I want with the hive system.

If you’re in the US (which I’m guessing you are since Hive is a US company), I’ve had a good experience with Wyze Sense. The starter kit is $20 + shipping and includes two contact sensors, a motion sensor, and the bridge. There’s a custom component for it that allows you to plug the bridge into whatever hardware you’re using for Home Assistant and communicate with the sensors that way. This means total local access, no Internet required. As a result, the states update immediately in Home Assistant.

Additional contact sensors are 4 for $20, and additional motion sensors are $6 each.

Hive is a Centrica company. I’m in the UK :slight_smile: I’ll take a look at those Wyze sensors, thank you.

Oh, my bad. I’m guessing it just loaded the US version of the website for me :man_facepalming:

www.hivehome.com