If you have an Android phone you are trying to repurpose, this could be a good use case. With the way I set it up, you do not need a SIM card on the old phone, but you will need Internet access. We will be using TextNow as the way to send text messages to your main phone number. You will need the old phone, a USB cable and a PC to connect the phone to (I used a Windows PC).
You will have to install IP Webcam Pro from the Play Store. It is just $4.99 for a one-time purchase. This will give it compatibility with sending a motion detection event to the Tasker app. There may be other apps you can do this with that would take less configuration and apps, but it is usually either a cloud service or a subscription service or both, so I tried this method instead.
1. Install the Tasker app to your phone, as well as AutoInput. This will be used to set off a macro that will send a text to your main phone.
2. On your old phone, enable Developer Options. You usually do this by going into Settings > About > Software Information, then clicking on the build number 7 times to enable Developer mode. Then you should have an option for Developer options in the Options menu.
3. Go into Developer options and enable USB debugging, so your PC can modify your phone settings via the Tasker-Permissions program in the next step.
4. Download Tasker-Permissions on your PC, and plug your old phone into the PC. Run Tasker-Permissions. Click Grant All Permissions to give all available permissions to Tasker. If you do not see Grant All Permissions, try to click Reload Devices/Permissions button and see if it appears. Other Android versions should be similar, but you can look up enabling Developer options for your Android version if you have trouble finding it.
If step #4 works successfully, then you are good to go and you can continue. Otherwise, you can try some troubleshooting by trying different USB cables. If this does not work, you may have to use a different method using an app that has these features built-in, such as Alfred, or try a different phone if you have others lying around.
5. Install TextNow on the old phone for the free texting feature. (You can probably use other methods such as email if you wanted with the use of Tasker, but the notifications may be slower)
6. Go into TextNow and set up the app, and grant the permissions the app requests. Once you get to the chat screen, start a chat with the phone number you want, with whatever contact name you want to use for it. You may have to create a contact through your phone for TextNow. Once you get that set up, send a text message to make sure your main phone receives a text. Then continue to the next step.
7. Go into Tasker. If it is your first time using it, select Tasker, not Tasky. Make sure to give it the permissions it needs to work, and disable Battery Optimization through your phone’s settings for Tasker and AutoInput.
8. In Tasker, create a new profile by clicking the + button on the bottom right. Click Create, then State. Search for IP Webcam Pro, then select it.
9. Click the pencil button to the right of Configuration. Select Motion is detected/timed out, then click OK. When brought back into Tasker, click the back button on the top left.
10. Click New Task on the next screen. Name the task Send Text, then click the checkmark.
11. In the Task Edit screen, click the + on the bottom right. Search for input, and select AutoInput Actions v2. On the next screen, click the pencil button for Configuration. If the next screen asks you about Run in the Background or ignoring Doze, click OK, then Allow, then back and OK again to get back to the AutoInput Actions v2 screen.
12. Click on Actions To Perform, then click OK on the Accessibility Service pop-up. Click on Installed Apps and navigate to AutoInput, turn it on, and click Allow to give it Accessibility permissions. (This step may vary depending on your Android version). Go back out of settings, and if it does not bring you back to AutoInput settings, go back into Tasker. You may have to redo step 10 and 11 to get back to the AutoInput Actions v2 screen to click on Actions To Perform, and AutoInput may have to enable other permissions as well such as Draw Above Other Apps.
13. Once you clicked on Actions To Perform and enabled all requested permissions, Need Help? should pop-up. Click YES. For the first action, select Open App, then find and select TextNow. Test to make sure it works by clicking Yes on the ‘Do Now’ prompt. If successful, click Yes on the ‘More Actions?’ prompt.
14. Select Click for the next action, then click Find. Make sure you are in the Chats screen of TextNow, where it would show all your chats. Move the red dot that shows up on the screen to the name of the contact you configured before. Then click on the red dot, and select click Element in the next prompt. You may have to try different elements, but the first one should work. On the ‘Use this element by…’ screen, select the Text option, then click OK. Click First Found, then click Yes on the test prompt to make sure it works. If it does, continue to the next step; otherwise, repeat this step. You can delete the parts you messed up later, or start over with the Actions to Perform setup.
15. TextNow should now be in your contact’s chat screen. For the next action, select Set Text, then click Find. Put the red dot over the input text area, then click on the red dot. Select the first element, then click Text (this could take multiple tries again). Click OK on Confirm Text, then First Found. Here, you can write the motion detection notification text. For example, write “Motion Detection Alert!”. Then click OK. Test it to make sure it inputs text into the chat. If successful, move on.
16. For the next event, select Click. then click Find. Put the red dot over the Send button on the bottom right, then click the red dot. Select the first element, then click Element. Select the first element, then select Id. Click on First Found, then test it. If the text sends, then the rest of the set up is easy.
17. For the next action, select Back. Test it by clicking Yes; it should bring you back to the Chats screen. Create another action for Back Out Of App, and it should take you out of the app. If this works, click No on More Actions.
If all is well, you should have a script set up under Actions to Perform. Click No on the ‘Need Help?’ prompt. I would add a few wait actions in between the actions to make sure it works and does not go too fast. You can change the timings if you want a faster response time, but you would want to test to make sure it works once you have IP Webcam set up and running. Your script should go something like this:
openApp(...)
wait(500) #add this line
click(...)
wait(500) #add this line
setText(...)
wait(500) #add this line
click(...)
wait(300) #add this line
back()
wait(200)
backOutOfApp()
18. Click Cancel if you are in the Actions to Perform script screen. Then click the Checkmark on the top right. This should bring you back to Action Edit in Tasker. Click the Back button on the top left. Click Stop Reminding if it pops up. You can click the Play button on the bottom left to test the AutoInput Actions v2 script. If it works, then click the back button on the top left, then the Checkmark on the next screen to save your settings.
19. Open IP Webcam Pro. Go into ‘Motion and sound detection’ and Enable motion detection. You can adjust sensitivity for motion as well, or enable video recording to the phone’s storage. Once you configure all of that, click back on the top left.
20. For testing it out, click on Start server. Give the app permissions if it asks, then you should see your camera. Test the motion detection; it should automatically pop up with TextNow and send the alert message you set up, then bring you back to the camera screen. Once you are done testing, click on Actions…, then Stop.
You can configure other settings in the app from there, such as password settings, set up continuous/circular recording via Plugins, among other options. You can configure a static IP through your phone’s network settings if you want to access it more easily through the web browser, as well.
You may have to configure your phone settings to make sure battery optimization does not put IP Webcam Pro to sleep, either. You also have to make sure your phone display stays on by turning on the Stay awake settings in Developer Options, but you will have to keep the phone plugged in.
I was looking into ways to mount your phone, and found this article on it which could be helpful: Webcam Mount Guide. Otherwise, you could probably use a tripod or a desk mount to keep your phone pointed where you want it to be, or find some ways to mount your phone to the wall.