EXTENSIONS / CUSTOMIZATIONS:

Using the Ambient Light Sensor & Proximity Sensor

Creating the Proximity Profile

Creating the Ambient Light Sensor Profile

Integrating with your existing profile

It makes sense to bind at least one of those sensors to the profile, to make sure, the phone is actually lifted to your face, and not just picked up from the table.Here is a simple guide on how to integrate both sensors, again, this is a very basic approach and open for suggestions and improvements by you guys, so please share, if you tweaked this or found an entirely better way to solve this.1. Create a new Profile "Proximity"2. As first Context, select "State", then "Sensor", then "Proximity Sensor" and click the check mark.3. Create a new task "Proximity On"4. Add an action by clicking the +, then select "Variable", then "Variable Set"5. Name it "%Prox" (It is important to use at least one capital letter, so it is available globally)6. In the field "To", write "On" (without the quotes)7. Click your way out with the check marks8. Long click the Proximity On task and select "Add Exit Task"9. Repeat steps 3 through 7, but name the task "Proximity Off" and set in the field "To", write "Off"10. Have a look at the screenshots to make sure you are good to go. Drag down the notification bar and cover the proximity sensor to see if the profile "Proximity" can be activated and deactivated.1. Create a new Profile "Light Sensor"2. As first Context, select "State", then "Sensor", then "Light Level" and select from 0 to 20 (or customize it to another number, needs testing).3. Create a new task "Dark"4. Add an action by clicking the +, then select "Variable", then "Variable Set"5. Name it "%Dark" (It is important to use at least one capital letter, so it is available globally)6. In the field "To", write "True" (without the quotes).7. Click your way out with the check marks8. Long click the Dark task and select "Add Exit Task"9. Repeat steps 3 through 7, but name the task "Not Dark" and set in the field "To", write "False"10. Have a look at the screenshots to check.1. Go to your "Call Whatsapp" profile2. Click the "Call" task, and click the +3. Select "Task" and click "Wait Until"4. Select 1 ms waiting time (necessary)5. Scroll down to the "Until" field. In the left box, select "%Prox", in the right field, write "On" and make sure, there is a tilde (~) in between.6. Create another "Wait Until" Task with the Variable "%Dark" and "True"7. Make sure, these two tasks are first in list, before the key combination macro. You can move them by long clicking, "Cut" and clicking the first action and "Paste"8. Look at the screenshot.P.S. I could not get the light sensor to work properly, I had to remove the action and deactivate the profile in my configuration. If someone with an AOSP rom could test, if they get the light sensor to work, please let me know, how.