Hue Motion Sensor?

Hey guys! Just got my Hue motion sensor, and it doesn’t seem to be picked up by HASS. Tried looking through pull requests and didn’t see anything, so I’m assuming this isn’t built yet? Or am I missing a configuration step? Thanks!!

1 Like

I’ve moved this topic into the Feature Request category, as support for the Hue Motion Sensor has yet to be added to HASS, as far as I know.

You can vote for this feature request yourself, and other people can do the same.

I’m not sure how practical this will be - the current Hue implementation relies on polling the bridge every 10 seconds, there is no way I am aware of in the Hue API to push info out of the bridge. This would be a fairly bad experience, although probably works fine if using the sensor to turn on Hue light directly as this all stays within the bridge.

I will caveat the above by saying I haven’t looked to see if they introduced any kind of push capability into the API since I last looked at it several months ago …

A similar explanation was given in the feature request for support for Hue switches (Tap/Dimmer).

1 Like

For a start it might be enough if it was possible to get the ‘last triggered’ info and -if possible- the current light condition out of that thing.

This would still be useful for things that don’t need to be triggered immediately when motion is detected, e.g. turn on the heat when you’re in the living room…

Sebastian

EDIT:
The light conditions don’t seem to be available in the bridge state.
FYI, here’s how it looks:

		"41": {
			"name": "MotionSensor 17.day-on",
			"owner": "<hue bridge userid>",
			"created": "2016-10-21T16:18:31",
			"lasttriggered": "2016-10-21T20:56:13",
			"timestriggered": 4,
			"status": "enabled",
			"recycle": true,
			"conditions": [
				{
					"address": "/config/localtime",
					"operator": "in",
					"value": "T16:00:00/T00:00:00"
				},
				{
					"address": "/sensors/17/state/presence",
					"operator": "eq",
					"value": "true"
				},
				{
					"address": "/sensors/17/state/presence",
					"operator": "dx"
				},
				{
					"address": "/sensors/19/state/status",
					"operator": "lt",
					"value": "1"
				},
				{
					"address": "/sensors/18/state/dark",
					"operator": "eq",
					"value": "true"
				}
			],
			"actions": [
				{
					"address": "/groups/1/action",
					"method": "PUT",
					"body": {
						"scene": "Ks-IB09WBX9MrRs"
					}
				},
				{
					"address": "/sensors/19/state",
					"method": "PUT",
					"body": {
						"status": 1
					}
				}
			]
		},
		"42": {
			"name": "MotionSensor 17.day-dark-on",
			"owner": "<hue bridge userid>",
			"created": "2016-10-21T16:18:31",
			"lasttriggered": "none",
			"timestriggered": 0,
			"status": "enabled",
			"recycle": true,
			"conditions": [
				{
					"address": "/config/localtime",
					"operator": "in",
					"value": "T16:00:00/T00:00:00"
				},
				{
					"address": "/sensors/17/state/presence",
					"operator": "eq",
					"value": "true"
				},
				{
					"address": "/sensors/18/state/dark",
					"operator": "eq",
					"value": "true"
				},
				{
					"address": "/sensors/18/state/dark",
					"operator": "dx"
				},
				{
					"address": "/sensors/19/state/status",
					"operator": "lt",
					"value": "1"
				}
			],
			"actions": [
				{
					"address": "/groups/1/action",
					"method": "PUT",
					"body": {
						"scene": "Ks-IB09WBX9MrRs"
					}
				},
				{
					"address": "/sensors/19/state",
					"method": "PUT",
					"body": {
						"status": 1
					}
				}
			]
		},
		"43": {
			"name": "MotionSensor 17.night-on",
			"owner": "<hue bridge userid>",
			"created": "2016-10-21T16:18:31",
			"lasttriggered": "2016-10-22T07:20:59",
			"timestriggered": 1,
			"status": "enabled",
			"recycle": true,
			"conditions": [
				{
					"address": "/config/localtime",
					"operator": "in",
					"value": "T00:00:00/T16:00:00"
				},
				{
					"address": "/sensors/17/state/presence",
					"operator": "eq",
					"value": "true"
				},
				{
					"address": "/sensors/17/state/presence",
					"operator": "dx"
				},
				{
					"address": "/sensors/19/state/status",
					"operator": "lt",
					"value": "1"
				},
				{
					"address": "/sensors/18/state/dark",
					"operator": "eq",
					"value": "true"
				}
			],
			"actions": [
				{
					"address": "/sensors/19/state",
					"method": "PUT",
					"body": {
						"status": 1
					}
				}
			]
		},
		"44": {
			"name": "MotionSensor 17.night-dark-on",
			"owner": "<hue bridge userid>",
			"created": "2016-10-21T16:18:31",
			"lasttriggered": "none",
			"timestriggered": 0,
			"status": "enabled",
			"recycle": true,
			"conditions": [
				{
					"address": "/config/localtime",
					"operator": "in",
					"value": "T00:00:00/T16:00:00"
				},
				{
					"address": "/sensors/17/state/presence",
					"operator": "eq",
					"value": "true"
				},
				{
					"address": "/sensors/18/state/dark",
					"operator": "eq",
					"value": "true"
				},
				{
					"address": "/sensors/18/state/dark",
					"operator": "dx"
				},
				{
					"address": "/sensors/19/state/status",
					"operator": "lt",
					"value": "1"
				}
			],
			"actions": [
				{
					"address": "/sensors/19/state",
					"method": "PUT",
					"body": {
						"status": 1
					}
				}
			]
		},
		"45": {
			"name": "MotionSensor 17.dim",
			"owner": "<hue bridge userid>",
			"created": "2016-10-21T16:18:31",
			"lasttriggered": "2016-10-21T20:52:23",
			"timestriggered": 3,
			"status": "enabled",
			"recycle": true,
			"conditions": [
				{
					"address": "/sensors/17/state/presence",
					"operator": "eq",
					"value": "false"
				},
				{
					"address": "/sensors/17/state/presence",
					"operator": "ddx",
					"value": "PT00:14:15"
				}
			],
			"actions": [
				{
					"address": "/sensors/19/state",
					"method": "PUT",
					"body": {
						"status": 2
					}
				}
			]
		},
		"46": {
			"name": "MotionSensor 17.recover",
			"owner": "<hue bridge userid>",
			"created": "2016-10-21T16:18:31",
			"lasttriggered": "none",
			"timestriggered": 0,
			"status": "enabled",
			"recycle": true,
			"conditions": [
				{
					"address": "/sensors/17/state/presence",
					"operator": "eq",
					"value": "true"
				},
				{
					"address": "/sensors/17/state/presence",
					"operator": "dx"
				},
				{
					"address": "/sensors/19/state/status",
					"operator": "gt",
					"value": "1"
				}
			],
			"actions": [
				{
					"address": "/sensors/19/state",
					"method": "PUT",
					"body": {
						"status": 1
					}
				}
			]
		},
		"47": {
			"name": "MotionSensor 17.off",
			"owner": "<hue bridge userid>",
			"created": "2016-10-21T16:18:31",
			"lasttriggered": "2016-10-21T20:52:53",
			"timestriggered": 3,
			"status": "enabled",
			"recycle": true,
			"conditions": [
				{
					"address": "/sensors/17/state/presence",
					"operator": "eq",
					"value": "false"
				},
				{
					"address": "/sensors/19/state/status",
					"operator": "ddx",
					"value": "PT00:00:30"
				},
				{
					"address": "/sensors/19/state/status",
					"operator": "gt",
					"value": "1"
				}
			],
			"actions": [
				{
					"address": "/sensors/19/state",
					"method": "PUT",
					"body": {
						"status": 0
					}
				}
			]
		},
		"48": {
			"name": "MotionSensor 17.arm",
			"owner": "<hue bridge userid>",
			"created": "2016-10-21T16:18:31",
			"lasttriggered": "2016-10-22T07:19:58",
			"timestriggered": 1,
			"status": "enabled",
			"recycle": true,
			"conditions": [
				{
					"address": "/groups/1/state/any_on",
					"operator": "eq",
					"value": "false"
				},
				{
					"address": "/sensors/17/state/presence",
					"operator": "eq",
					"value": "false"
				}
			],
			"actions": [
				{
					"address": "/sensors/19/state",
					"method": "PUT",
					"body": {
						"status": 0
					}
				}
			]
		}
	},	
	
		"17": {
			"state": {
				"presence": true,
				"lastupdated": "2016-10-22T07:20:59"
			},
			"config": {
				"on": true,
				"battery": 100,
				"reachable": true,
				"alert": "lselect",
				"ledindication": false,
				"usertest": false,
				"sensitivity": 1,
				"sensitivitymax": 2,
				"pending": []
			},
			"name": "Wohnzimmer Sensor",
			"type": "ZLLPresence",
			"modelid": "SML001",
			"manufacturername": "Philips",
			"swversion": "6.1.0.18912",
			"uniqueid": "00:11:22:33:44:55:66:aa-XX-XXXX"
		},

EDIT 2:
I have to correct myself: the light conditions ARE available (I should have read on in the state output):
This seems to be realized as a second sensor.

		"18": {
			"state": {
				"lightlevel": 19388,
				"dark": false,
				"daylight": true,
				"lastupdated": "2016-10-22T10:00:23"
			},
			"config": {
				"on": true,
				"battery": 100,
				"reachable": true,
				"alert": "none",
				"tholddark": 4539,
				"tholdoffset": 7000,
				"ledindication": false,
				"usertest": false,
				"pending": []
			},
			"name": "Hue ambient light sensor 1",
			"type": "ZLLLightLevel",
			"modelid": "SML001",
			"manufacturername": "Philips",
			"swversion": "6.1.0.18912",
			"uniqueid": "00:11:22:33:44:55:66:aa-XX-XXXX"
		},
		"19": {
			"state": {
				"status": 0,
				"lastupdated": "2016-10-22T10:00:23"
			},
			"config": {
				"on": true,
				"reachable": true
			},
			"name": "MotionSensor 17.Companion",
			"type": "CLIPGenericStatus",
			"modelid": "PHA_STATE",
			"manufacturername": "Philips",
			"swversion": "1.0",
			"uniqueid": "MotionSensor 17.Companion",
			"recycle": true
		}
	},
1 Like

It seems that you can also pull temperature from the sensor etc.
It’s described in this Dutch blog post.

The code is readable for non-dutchies :wink:
https://nickyb2.tweakblogs.net/blog/14037/home-assistant-philips-hue-motion-sensor

I’ll try to dive into the code for the Hue, but I have very little experience with Python thus far.
It would be awesome to be able to detect movement in HASS as well as the temperatures per room. Saves me from having to buy other smart thermometers.

- platform: rest
  resource: http://[bridge IP]/api/[API-key]/sensors/[sensor id]
  value_template: '{{ value_json.state.lightlevel }}'
  unit_of_measurement: Lux
  name: 'Woonkamer'
  
- platform: rest
  resource: http://[bridge IP]/api/[API-key]/sensors/[sensor id]
  value_template: '{{ value_json.state.temperature | float / 100 }}'
  unit_of_measurement: °C
  name: 'Woonkamer'
4 Likes

Temperature would be cool too, but I didn’t see this in my state file (see my last post above).
Maybe there are different versions of the sensor around?

Anyway, I decided to sell my Hue motion sensor again, because the configuration options offered by the Hue app were very limited.
For an additional 10 EUR, one can get a ZWave multisensor like the Aeon Labs or Fibaro.
I just got the Fibaro and it works well. As we’re already all running HA it is pretty easy to integrate with Hue and offers much more flexible configuration.

Sebastian

I translated: Tutorial adding HUE Motion sensor (Lux,Temp and Motion)

Sensors are available in the phue library which the Hue lights component uses. Should be relatively straightforward to add the sensors, and I may have a go, but should this then be a separate Hue sensor component?

I’d say so yes. I’d be very interested in this having just bought into hue.

1 Like

The current hue implementation uses aiohue, which already has support for sensors. It would be cool if this could be included in home assistant.

@marthocoo is working on this

1 Like

Initial PR for this: https://github.com/home-assistant/home-assistant/pull/22598

1 Like

Version 0.92.0 has support for the HUE motion sensor.

2 Likes