Philips HUE Motion Sensor

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

User avatar
constapel
Posts: 15
Joined: Friday 30 December 2016 21:43
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Philips HUE Motion Sensor

Post by constapel »

How do you feel about one more decimal value in temperature measuring:?

Your implementation:
Knipsel2.PNG
Knipsel2.PNG (18 KiB) Viewed 6625 times

My old implementation ( with time update lua script) ( asking too much system resources)
Knipsel.PNG
Knipsel.PNG (18.26 KiB) Viewed 6625 times
Jordy
Posts: 11
Joined: Tuesday 21 February 2017 10:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: Philips HUE Motion Sensor

Post by Jordy »

Good point on the temperature. The value was not converted nicely (so it was rounded to a whole number), I fixed that. Sadly Domoticz will only show 1 decimal and not two. I hope that's ok.

As for the Lux part: The lightlevel itself is not in lux. So I added a conversion to lux (as indicated in https://developers.meethue.com/document ... ed-sensors chapter 2.7.1 Typical light levels for indoor use cases).

I'm not really satisfied with the default names (and apparently they are not updated by the Philips Hue app). So expect names like: ZLLLightLevel Hue ambient light sensor 9 and ZLLLightLevel Lux Hue ambient light sensor 9. You can trace it back to which sensor it belongs by fetching a full config from the bridge and search for the name and then check the "uniqueid": "00:17:88:01:02:00:AA:BB-02-0400" (minus the 02-0400 part). Then search again with the uniqueid.

Will create a pull request soon, so you can expect an update today or tomorrow :)

Preview:
Attachments
Lux_and_temp.png
Lux_and_temp.png (135.12 KiB) Viewed 6617 times
User avatar
constapel
Posts: 15
Joined: Friday 30 December 2016 21:43
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Philips HUE Motion Sensor

Post by constapel »

Great!

This was my lua script to get the lux value:

Code: Select all

function My.LeesSensorsLux(t)

 	huestring = tostring(table.concat(t))
  	obj, pos, err = json.decode(huestring,1,nil)

	if err then
		print ("Error:", err)
	else

		   if (obj.name) then 
			hue_name = (obj.name)
     			hue_lux = (obj.state.lightlevel)
     			hue_lux = hue_lux /100

			if Debug=="YES" then
			    	print (hue_lux)
			end
		  end 
	end
	return  hue_lux
end
But now its obsolete because i can use your implementation.
Thanks Again.
Jordy
Posts: 11
Joined: Tuesday 21 February 2017 10:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: Philips HUE Motion Sensor

Post by Jordy »

I see that you just deviced the lightlevel by 100. The calculation to lux is slightly different: 10^(lightlevel -1/ 10000).
To be sure check the table in https://developers.meethue.com/document ... ed-sensors chapter 2.7.1
gingercat
Posts: 4
Joined: Friday 21 October 2016 18:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Philips HUE Motion Sensor

Post by gingercat »

Now got the latest beta with this support added - thanks for your hard work. My only query is should I expect ~5s delay for any triggers? I've got a bash script that turns on the lights in a particular order, with a short delay between each, but when walking into the hallway, it takes far too long for anything to happen.
Dropshot
Posts: 44
Joined: Tuesday 20 December 2016 22:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Philips HUE Motion Sensor

Post by Dropshot »

I've updated to the beta version to be able to use the motion sensor, but now the LUA scripts don't update my virtual sensors anymore. Does anyone have the same issue/have a solution for it?

Image

-- Update --
I found out that the method I used to update my sensors didn't work any more.
This one doesn't work anymore:

Code: Select all

commandArray[#commandArray + 1]={['OpenURL']="http://"..localhost.."/json.htm?type=command&param=udevice&idx="..idx.."&nvalue=0&svalue="..tostring(data) }
This one does work:

Code: Select all

commandArray[#commandArray + 1]={['UpdateDevice'] = idx .. '|0|' .. tostring(data)}
Last edited by Dropshot on Friday 10 March 2017 16:07, edited 5 times in total.
Jordy
Posts: 11
Joined: Tuesday 21 February 2017 10:00
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: Philips HUE Motion Sensor

Post by Jordy »

@gingercat worst case it could be 10 seconds. That is currently the 'default' poll interval. I'm not sure if you can adjust that interval.
scottydj2
Posts: 15
Joined: Monday 06 February 2017 11:09
Target OS: Windows
Domoticz version:
Contact:

Re: Philips HUE Motion Sensor

Post by scottydj2 »

Hi,

I've added a change in the latest beta to allow the poll interval to be configured from the hardware devices screen.

Cheers

Scott
Dropshot
Posts: 44
Joined: Tuesday 20 December 2016 22:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Philips HUE Motion Sensor

Post by Dropshot »

scottydj2 wrote:Hi,

I've added a change in the latest beta to allow the poll interval to be configured from the hardware devices screen.

Cheers

Scott
Great! Thank you.

Question: default is '0', what interval is used then?
scottydj2
Posts: 15
Joined: Monday 06 February 2017 11:09
Target OS: Windows
Domoticz version:
Contact:

Re: Philips HUE Motion Sensor

Post by scottydj2 »

Question: default is '0', what interval is used then?
If 0, the existing default 10s is used.

Cheers

Scott
Off112
Posts: 3
Joined: Saturday 15 April 2017 14:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Philips HUE Motion Sensor

Post by Off112 »

Hi,

I'm new to Domoticz and trying to get my philips hue motion sensor to work with domoticz.

I have just installed the latest beta and and can se my devices. But there is no values. Lux and temp is 0 and motions sensor is always off. What have I missed?


UPDATE: I solved it. For some reason was the motion sensor deactivated in the Philips hue app.

/Arild
Benneton
Posts: 111
Joined: Thursday 08 December 2016 9:46
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Philips HUE Motion Sensor

Post by Benneton »

Hi,

I have this sensor installed today. I can see it in the Philips App and after upgrading to Beta program of Domoticz I can see it in Domoticz to.
I made a little script to switch lichts in the hal to 15% when it is "dark" according to the light sensor and there is motion detected.
I hope it will override my time switched Hal lights so it will go from 5 to 15% when motion is detected and when lights are off due to time schedule they will light up when motion is detected.

Problem I have, must not understand it fully, is that the philips Hue App also switches the lights which it should not. I just want Domotizs to rule.
How do I set it up in the Hue App?
In the App I have Accessoire configuration --> There I have the sensor, switched on (when I switch it off Domoticz does not see it)
I tried to make a room with no lights in it but this I cannot select in the sensor.

What do I need to set to enable Domoticz to 'see' the sensor and bridge/app not taking any action

UPDATE: I have I believe worked it out, in the Hue App set Day, Night and Motion to TAKE NO ACTION.

Thanks for the support,

Bernard

A super great piece of work this Domotizs!
gingercat
Posts: 4
Joined: Friday 21 October 2016 18:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Philips HUE Motion Sensor

Post by gingercat »

scottydj2 wrote:Hi,

I've added a change in the latest beta to allow the poll interval to be configured from the hardware devices screen.

Cheers

Scott
Thanks for this - will give it a try.
Mazzokun
Posts: 89
Joined: Thursday 28 April 2016 23:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Milan, Italy
Contact:

Re: Philips HUE Motion Sensor

Post by Mazzokun »

Hi all! I have Domoticz beta 3.8144.
Is Hue ambient light sensor broken? :?:
Because HUE lux is 14444 but the light sensor is always On even with 4 lux.
Thank you
sion
Posts: 113
Joined: Friday 08 January 2016 12:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Philips HUE Motion Sensor

Post by sion »

Hi guys.
Does anyone know if this is working in the latest stable?
Haven't updated yet - and don't want to loose this.
I didn't see it mentioned in the release notes.

Thanks.
running domoticz 3.4834 on rpi2, with
Hue bridge / bulbs.
lightwave rf sockets, mood controlers, sensors & contacts.
Home bridge / Siri.
Ha bridge / echo Alexa.
Hard wired alarm system - setting home / away status.

Next: harmony hub.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest