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

These both work by polling the Hue API. The MQTT package recommends 500ms polling interval, which you can also set with the custom component if you wish.

Iā€™ve added a Hue Motion sensor to Home Assistant using deConz Rest API and Node Red.
This is working ok, but I see that the reported temperature from my sensor is way off, Iā€™d guess it is 4 or 5 Ā°C too high.
Anyone else having this problem or is it just my sensor that has a bad thermometer?

Is it possible to install/use hue-mqtt-bridge on a system using https://github.com/home-assistant/hassio-build/releases/tag/1.1 ? I logged in via SSH to the host system as explained at https://home-assistant.io/developers/hassio/debugging/ but thereā€™s no nodejs, npm, apt-get etc. available. I saw that itā€™s based on Resin OS and I canā€™t find a way to install NPM there.

If you canā€™t install npm. then unfortunately you canā€™t get hue-mqtt-bridge.

According to this, it seems that you canā€™t override the polling interval with the custom component, thatā€™s why Iā€™m using the hue-mqtt-bridge and I get much faster response time with the motion sensor.

You can override scan_interval:

sensor:
  - platform: hue_sensors
    scan_interval: 0.1

Btw the dev branch uses an interval of 0.1 by default. I welcome testing but please note this is a WIP.
https://github.com/robmarkcole/Hue-sensors-HASS/tree/dev-phue

Nice, thanks! I tried out the dev-phue branch and it seems to work fine. Including the scan interval of 0.1, so my switch now instantly triggers actions when I press a button :slight_smile: Will report back if I find any issues/bugs.

1 Like

I have recently setup the motion sensor via a rest template sensor. All is working fine the UI and i can see the motion sensor is updated from False to True when motion is detected however if i create an automation with a trigger state from ā€˜Falseā€™ to ā€˜Trueā€™ the automation doesnt run.

Should i be using False/True or On/Off?

Can someone share an example of what they have used to trigger automation from hue motion detection

I use this for my trigger:

  trigger:
    - platform: state
      entity_id: sensor.entry_motion
      to: 'True'
1 Like

Awesome, thanks - i didnt realise it was case sensitive. I was using ā€˜trueā€™ and should have been using ā€˜Trueā€™

Took way longer than it should to figure that out. :roll_eyes:

Iā€™ve had three philips hue motions sensors set up as temperature sensors in Hass and itā€™s been working perfectly until about a couple a weeks ago when the sensors disappeared in Hass. No errors in the log-file. If I paste the resource URL in my browser I get the response from the Hue bridge. Any idea whatsā€™ wrong?

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.