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

I don’t know which one is better, but the solution with hue-mqtt-bridge is working great and works with Hue Tap and Hue Motion. If it fails at npm install, maybe you don’t have node installed on your pi. This should help:

curl -sL https://deb.nodesource.com/setup_9.x | bash -
apt-get install -y nodejs

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