Page 1 of 1

Proximity sensor condition bug?

Posted: 07 May 2013 11:14
by colabi
trigger: Proximity Sensor: Distance < 2.5cm
>
condition: Proximity Sensor: Distance < 2.5cm
>
true
>
action: vibrate

condition always return false

this is log
log.txt
(21.58 KiB) Downloaded 935 times

Re: Proximity sensor condition bug?

Posted: 07 May 2013 11:26
by Rm.
Up vote. The same happens to me - when I use proximity sensor in condition, it always returns false (even on screen on), but in the designer of the condition, I can see the proximity value changing.

Re: Proximity sensor condition bug?

Posted: 07 May 2013 12:15
by syndromtr
also i have problems with proximity sensor trigger values in my smartphone,
(razr xt910 rooted - android 4.0.4)

when i create a new flow and insert proximity trigger, it gives "current value" in cm's.
by default it's 100 cm. when i move my hand over sensor, it becomes 3 cm. (no other values)
even i touch my finger on the sensor it's still 3 cm.

however, i have created a flow with that trigger, <5 cm and it's triggered. i use it to turn screen on by waving hand over sensor.. so i can use it with only two values.. 100 cm and 3 cm..

Re: Proximity sensor condition bug?

Posted: 08 May 2013 09:39
by Martin
Proximity sensor on many models only returns two values (near and far). The exact values measured depend on model and can be checked using a trigger or condition Proximity Sensor.

It is a known limitation that the condition Proximity Sensor can not access the current value on some devices. The sensor only provides a new measurement to apps, when the value changes between the near and far value. The condition will not work on such a device (see help). Only possibility is to use a trigger on such a phone and to continuously read the sensor value, but this will consume a lot of battery.

Regards,
Martin

Re: Proximity sensor condition bug?

Posted: 08 May 2013 10:48
by colabi
OK Martin, thanks
but I noticed that this is working an return true:

trigger: Proximity Sensor: Distance < 2.5cm
>
sleep 500ms
>
condition: Proximity Sensor: Distance < 2.5cm
>
true
>
action: vibrate

maybe you coud delay a little condition checking