Tutorial adding HUE Motion sensor (Lux,Temp and Motion)

Which version of HA are you on? There was a major change to the Hue hub component at 0.60

I actually got it working again, I think it was an indentation error in the config-file, don’t know how that happened… Don’t understand why it didn’t generate anything in the log.

1 Like

Hi all,

I have set my Hue motion up as per the instructions at the very beginning of this thread. Everything seems to be working okay, but very slowly!

It takes about 25 seconds for the motion sensor to turn on a Hue light. Does this sound about right or is there something wrong? I can handle a couple of seconds of delay, but as is, it’s unusable.

Any help would be greatly appreciated!

25 seconds is way too long. it’s a few seconds but definitely not 25.
just sometimes i do notice it doesn’t capture my motion well enough, but that has nothing to do with the delay.

Are you sure the sensor is quick enough? when you test the sensor in the hue app and you move in front of it, does it see that quick enough?

not sure if it might help but I have also unreachable true configured. so:

hue:
  bridges:
    - host: xx.xx.x.x
      allow_unreachable: true

The sensor works almost instantly direct with the Hue app.

So I added the Hue component (Hue motion sensors + remotes: custom component) rather than adding things manually, and the speed is now fine. Can’t think what was going wrong before??

I honestly also don’t have any idea. For me it’s working fine with the way I set it up.

Glad it’s working for you now! :slight_smile:

1 Like

Thank you so much. I was struggeling to get this to work. I got everything up but the value I got was “unknown”.

That was until i saw that the id in the end of the URL was not the “uniqueid” :slight_smile:

Thank you all!

1 Like

I seem to be experiencing alot of network congestion on my network and wondered if you could explain in a “for dummies” type of way how you accomplished this with a script. I’ve tried a couple of things on my own and I’m struggling with setting it up. I’m running hasbian and was reading up on running shell commands and python scripts but no luck. Anyways good idea this seems like a viable way to reduce calls to the hue hub.

@ robmarkcole . I believe I’m experiencing some Network congestion using the rest call setup at the beginning of this thread. Is your component perhaps more efficient in some way? Does it possible make one call and parse out the info instead of each sensor querying the bridge with a rest call?

HI, yes 1 rest call for all sensors

I did this a few months ago but can’t get it to show light/lux no matter what I try.

@ robmarkcole . Thanks have the component up and running well (i believe anyway) on Home Assistant 0.79.1 . Going thru your extensive CC thread and wondering if the default polling time was still 0.1 seconds for the version in your repo. Also I see that your method of polling which I was interested in may have been a barrier to this component being implemented as an official component. I keep checking the blog hoping to see it included. Anyways dont want to pester but certainly I will keep an eye out for this official component I would consider to be in the top 5 value in home assistant right now

@dasbooter you can experiment with the scan_interval. Re official component, just requires time and effort, both of which are in limited supply right now

I’m using the rest platform to get the brightness level from my Hue Motion sensor.

- platform: rest
  resource: http://<IP>/api/XXXX/sensors/7
  value_template: '{{ (10 ** (float(value_json.state.lightlevel) / 10000) -1) | round (1)}}'
  unit_of_measurement: 'lx'
  scan_interval: 300
  name: 'mysensor brightness'

I would like to use the new service homeassistant.update_entity to request an update but it does not seem to update the value.

- service: homeassistant.update_entity
  entity_id: sensor.mysensor_brightness

Anyone had any success with this new service ?

EDIT: In case someone has the same issue: you need to add data: before the entity_id

    - service: homeassistant.update_entity
      data:
        entity_id: sensor.mysensor_brightness

Hello,

I keep getting this message in mij log. I’ve seen other people had the same problem, but could nog clearly see a sollutuion. I’m a bit of a newbee. :grinning:

Error parsing value: ‘list object’ has no attribute ‘state’ (value: [{“error”:{“type”:3,“address”:"/sensors/00:17:88:01:02:01:e5:5b-02-0402",“description”:“resource, /sensors/00:17:88:01:02:01:e5:5b-02-0402, not available”}}], template: {{ value_json.state.temperature | float / 100 }}

The sensor is showing but nog messurement is collected/showing

So this guide was a thoroughly great walkthrough and worked like a charm 1st time.
Thanks alot for the intro into the HUE Api + much more :+1:

As a fairly newb in HA, RB+, etc. (< 1 month)…
I haven’t quite found how to setup actions like sending e-mail or other push notification so that I can use the HUE Motion Sensor as an Alarm for our home.

Need to setup something along the lines of:

  1. Activate/Deactivate: “Alarm” state via remote/app/webpage button or whatever.

  2. Notifications: E-mail (preferred), SMS gateway or whatever avail push notifications.

  3. Turning on Sonos playing the “home alone sound” real loud :wink: or something along those lines, flashing HUE etc.

  4. Stop/Start Alarm state (for test and turning the Alarm state off…)

Edit: got an email script up and running, still need to get the motion detection to trigger the script.

Again thanks a lot! (Ohh and Happy New Year!)

You’re welcome :slight_smile:

I activate/deactivate alarm by enabling an input_boolean. Then I have triggers on certain changes like a door/window sensor that opens.
If the alarm is turned on (boolean enabled) and no one is home, I run the alarm script. In the script you can put whatever you want like your email notification, telegram notification, turn on sonos etc.

As an example:

- alias: 'Alarm Raam achter Open Not Home'
  trigger:
  - platform: state
    entity_id: sensor.overloop
    from: "0"
    to: "1"
  condition: 
    condition: and
    conditions: 
      - condition: state
        entity_id: input_boolean.alarm
        state: 'on'
      - condition: state
        entity_id: input_boolean.guests
        state: 'off'
      - condition: state
        entity_id: binary_sensor.anyone_presence
        state: 'off'
  action:
    - service: homeassistant.turn_on
      entity_id: script.alarmtrigger3
1 Like

can anyone confirm this approach works also for the new outdoor motion sensor?

I wouldn’t know why not. It’s a matter of finding the device in the API.
By the way you can also use Zigbee2mqtt. It has much much faster responses!
Because the motion sensor sends it directly to the zigbee2mqtt usbstick so there is no polling happening by the Philips hue hub.
I have the motion sensors now linked to zigbee2mqtt and only the lights are linked to the Hue hub.

2 Likes