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

Ok I just re-read what you posted earlier and I completely misunderstood you. But I got it now, thanks!

I added the dimmer switches based on the status and the last_updated events.
What is bugging me is that any automation is really slow. I have a latency of about 5seconds from pushing a button to turning on a light.
The automation triggers on the last_updated status and just switches on a light, no conditions or anything.
I have set the update interval to 1 second.

Any ideas how to speed things up?

Yes, do like I described a couple of posts ago. Essentially you let HA adjust a scene but HA doesn’t turn on the lights. The hue bridge turns on the lights.

If there is interest enough, I can create a new thread with better examples on how to do this. The information above should be enugh though.

Yes please

Is it possible to disable a HUE Motion sensor ? I would like to disable it when an activity is running with the Harmony hub or within a scene.

This would be possible if sensors were supported

Natively, indeed… but following the tutorial described above, motion sensors can be added to HA, is it correct ?

Then, using CLIP API Debugger, a sensor can be disabled using:

{"address":"/sensors/ID/config","method":"PUT","body":{"on":false}

The question is: how do you “translate” that into HA config ?

Good shout! :+1:

I use the motion sensors in HA. I use the rest-component in HA to set it up.

I don’t know if this has been mentioned but the Hue API also exposes the presence as a sensor, appearing in mine as:

{
  "state": {
    "presence": true,
    "lastupdated": "2017-07-22T11:52:42"
  },
  "config": {
    "on": true,
    "reachable": true
  },
  "name": "Robins iPhone",
  "type": "Geofence",
  "modelid": "HA_GEOFENCE",
  "manufacturername": "Philips",
  "swversion": "A_1",
  "uniqueid": "L_02_IYwHM",
  "recycle": false
}

Thanks for sharing.
I personally don’t want Philips to know where I am so I don’t have an account linked and thus no presence detection.

Anyone have an issue with these virtual sensors disappearing upon a power cycle/loss with the HUE hub? Power went out a few days ago and I lost all of my virtual sensors. It was only two so it wasn’t a big deal to recreat, but still…

Is there a way to back up the configuration? Should it store these changes?

Thanks,

Yes that happens. Also when you change the sensitivity for instance through the Hue app I noticed I lost some rules and entries.
So what I did is keep a copy of what I entered in a document and once it happens I copy paste is quickly again.

I’m using the motion sensors without using the ‘virtual sensors’ and work great!

binary_sensor:
  - platform: rest 
    resource: http://<bridge ip address>/api/<username>/sensors/15 
    name: living_room_motion_sensor 
    value_template: '{{value_json.state.presence}}' 
    scan_interval: 1

I’m having some problems setting this up.

I guess this is my motion sensor:

“5”:{“state”:{“status”:0,“lastupdated”:“2017-08-10T05:30:39”},“config”:{“on”:true,“reachable”:true},“name”:“MotionSensor 3.Companion”,“type”:“CLIPGenericStatus”,“modelid”:“PHA_STATE”,“manufacturername”:“Philips”,“swversion”:“1.0”,“uniqueid”:“MotionSensor 3.Companion”,“recycle”:true},

And this is my config:

My sensor will show up in homeassistant but it doesnt report any state. It is just empty

Doesn’t look correct return from the API. See https://www.hackster.io/robin-cole/boil-my-kettle-when-i-get-out-of-bed-in-the-morning-10e7de

You are right, thank you for the link.

This is how the sensor should look like:

"3": {
	"state": {
		"presence": false,
		"lastupdated": "2017-04-15T19:32:23"
	},
	"config": {
		"on": true,
		"battery": 100,
		"reachable": true,
		"alert": "none",
		"ledindication": false,
		"usertest": false,
		"sensitivity": 2,
		"sensitivitymax": 2,
		"pending": []
	},
	"name": "Unten Sensor",
	"type": "ZLLPresence",
	"modelid": "SML001",
1 Like

Great tutorial. Have followed and worked out great… twice. Seems if you change IP address the key needs to be reset. Am I right in saying that as I moved from one hardwired access point to another (with different IP) I just setup again after no motion sensor detection? Had no issues in doing so but just wanted to double check

Glad I did as I setup the lux and temp sensors now. :slight_smile: Pal I owe you a few internet pints

One thing i’ve noted with my dealings though is that instead of motion sensor detection “True” is that it shows as “1” or “0”… which is no biggie but just wondering why it aint matching with “true” or “false”

Always grateful for an internet pint :grin:
To avoid the changing IP I recommend setting a DHCP reservation on your router.
I’ve also noticed that if you remove and then re-add a sensor in the Hue app, it is assigned a different index.
Re 1, 0, I haven’t encountered that, be interested to hear if you get to the bottom of it. Cheers

Is it possible to set the scan_interval to less than a sec (e.g. 500 ms) ?