I assume that you’ve installed the app on your device. Let's see the steps to do the task.
Open the app.
The default code is null. Type null in the "Enter Current Code".
Enter the new code as per your wish. Provide the code which is easily remembered by you and keep it as secret.
Click on "Change Secret Code" button.
Now I suggest you to try this yourself first. Just grab another phone and send SMS (your secret code only; Keep in mind that the secret code is case sensitive) to your Android device.
Once your device received the SMS, you’ll be prompted to provide the root permission for the app. This is just one time only and it will not prompt you to provide root permission in future. Just tap “Grant” option.
Your device will begin to shutdown. Now we know that the setup works perfectly.
That’s it. From now on, when you send the secret code in the SMS to your Android handset, the phone will shutdown.
Install and open AutomateIt app. Provide root permissions if prompted. We need to create a rule to achieve this task.
Tap "My Rules" section > "+" icon.
Now you should be in the Trigger screen. Find and tap “Call State Trigger”.
Now under the “Contact Name” section, you can choose any of these three options (Note that the other options are not suitable for this task):
Selected Contact - The rule will be triggered when you got an incoming call from selected contact. Keep in mind that a contact may have multiple phone numbers. So any number within the contact can trigger the rule when you selected this option.
Selected Phone Number - Only the call from a specific phone number of a contact will trigger this rule.
Manual Phone Number - the name itself explains it, right?
In this instance, I choose “Selected contact”. Now tap the person icon beside it and choose the contact you wish.