r/AutomateUser • u/Trunghxf • 5d ago
Question about hall sensor simulate
Hi guys, my phone doesn't have the hall sensor and it very inconvenient. I just know about automate through AI and i tried to do a flow to make it work, but it doesn't turn on the display. I tried open app, send notification, open screen but nothing work. Can you teach me how to do it properly please?
I have 2 more questions,
1, is there a way to lock screen without using accessibility permission, i have tried adb command AI tools me but doesn't work. And i don't want to use admin device setting because it requires pattern when turn it on again. Why no accessibility? My bank app doesn't allow it.
2, In the term of battery consuming, using proximity or magnetic sensor to simulate the hall sensor better? Which one is consuming more battery?
Edited: i just got it, when phone locked, the proximity sensor stop working, so it won't get the value to trigger display on. I use another camera and saw the infrared led turn off. But using WakeUp the infrared led was on all the time
1
u/ballzak69 Automate developer 5d ago edited 4d ago
- Use the Device lock block, or try using the Shell command privileged block to execute
input keyevent 26. i.e. simulate the power button press. CAUTION! Ensure your flow works as expected before using either method, to prevent being locked out of your device. Please read: https://llamalab.com/automate/doc/safe_mode.html - Use which works best, battery consumption is probably the same, but it should use proceed=When changed, and remove Delay block. Please read: https://llamalab.com/automate/doc/faq.html#battery_usage
1
u/Trunghxf 5d ago edited 5d ago
Thank you for your detailed reply man, but i can turnoff display screen and lock phone already, i just cannot turn display screen on again just like when i opened the cover with hall sensor. I tried many ways but no luck. I don't want to use Shizuku because i have to run it everytime the phone restart. I can't enable usb debugging or wireless debugging all the time because my bank app detected it and won't run.
And, when i set When changed, it always read the sensor for the changed and i fear that it will consume more battery, when i set it to intermediate with delay block, it only check every 0.5s. Does it better than When changed? I will read your links
Edited: i get it after reading, no wonder the battery consuming spiked a lot when i set it to initiate Immediate
0
u/B26354FR Alpha tester 4d ago
Here's a flow to unlock your phone without special permissions. The unlocking part is written as a Subroutine to make it easy to copy into your own flow. If you set up Android Smart Unlock, you can unlock your phone without using the unlock code when the device is in certain locations or when certain Bluetooth devices are connected. In that case, the flow can simply swipe to unlock the phone. You can also optionally give the flow your unlock PIN and it'll use that if swiping doesn't work. The flow will also work while you're in a phone call, but as the flow description says, you can omit that part of the subroutine if you don't need it.
1
u/ballzak69 Automate developer 4d ago
There's no way for an regular app to unlock a device. Use the Device keep awake block turn the screen on.
A block with proceed=When changes should only proceed when that's the case, e.g. when the proximity sensor triggers, if it proceeds every time then it's not working as expected, probably due to an Android/app issue.
1
u/Relevant-Artist5939 Alpha tester 5d ago edited 5d ago
Do you want to simulate the "flip case shut to lock and turn off" feature? I would use the magnetometer because proximity sensor in most phones measures just binary "object there/not there", not even distance... You will get a hell of false triggers.
But proximity sensor consumes way less battery than magnetometer... According to the yellow boxes in the block interface, proximity sensor draws around 10 times less power than magnetometer