magnetic sensor help please?
Moderator: Martin
- Autumn-Leigh
- Posts: 67
- Joined: 15 Mar 2018 19:23
- Location: UK
- Contact:
magnetic sensor help please?
Some one help please, I have this flow for security, problem is, I have a smart case so when i shut it, i have a display bit so its classed as display on.
is there a way I can trigger this flow when the case is shut and picked up by the magnet? if so, how please? and should i set the magnetic sensor as?
is there a way I can trigger this flow when the case is shut and picked up by the magnet? if so, how please? and should i set the magnetic sensor as?
- Attachments
-
- Screenshot_2018-04-07-18-36-12.png (128.99 KiB) Viewed 19630 times
YouTube Channel - https://youtu.be/fui3RO9EmNU
If anyone wants a shoutout, or has a flow they want me to do, be it theirs or a new one, let me know
If anyone wants a shoutout, or has a flow they want me to do, be it theirs or a new one, let me know

Re: magnetic sensor help please?
The flow will drain a lot battery if you use trigger magnetic sensor. Proximity sensor trigger will also drain quite a lot during idle. So you have to create a helper flow and disable them after the check.
The magnetic flow will be enabled by another flow using Trigger User present. So magnetic flow only available when you have passed the lock screen. It will continue to check until you close the case, which trigger the magnetic flow and do all the check. At the last action, disable this magnetic flow (itself). So it won't consume any battery during device idle, as you don't need to continuously check when device sleep.
Flow 1
Trigger : User Present
Action : Set Flows State : Magnetic flow - enable
Flow 2
Trigger : Magnetic sensor
Action : all the check action
Action last : disable flow 2
The magnetic flow will be enabled by another flow using Trigger User present. So magnetic flow only available when you have passed the lock screen. It will continue to check until you close the case, which trigger the magnetic flow and do all the check. At the last action, disable this magnetic flow (itself). So it won't consume any battery during device idle, as you don't need to continuously check when device sleep.
Flow 1
Trigger : User Present
Action : Set Flows State : Magnetic flow - enable
Flow 2
Trigger : Magnetic sensor
Action : all the check action
Action last : disable flow 2
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
- Autumn-Leigh
- Posts: 67
- Joined: 15 Mar 2018 19:23
- Location: UK
- Contact:
Re: magnetic sensor help please?
okay, so what i want it to do is when BLE isnt near, set keyguard, when it is near, disable it, but i mean doing it immediatly when the case is shut and even if smart case display is on. also, i dont know how to work the magnetic feild?Desmanto wrote:The flow will drain a lot battery if you use trigger magnetic sensor. Proximity sensor trigger will also drain quite a lot during idle. So you have to create a helper flow and disable them after the check.
The magnetic flow will be enabled by another flow using Trigger User present. So magnetic flow only available when you have passed the lock screen. It will continue to check until you close the case, which trigger the magnetic flow and do all the check. At the last action, disable this magnetic flow (itself). So it won't consume any battery during device idle, as you don't need to continuously check when device sleep.
Flow 1
Trigger : User Present
Action : Set Flows State : Magnetic flow - enable
Flow 2
Trigger : Magnetic sensor
Action : all the check action
Action last : disable flow 2
YouTube Channel - https://youtu.be/fui3RO9EmNU
If anyone wants a shoutout, or has a flow they want me to do, be it theirs or a new one, let me know
If anyone wants a shoutout, or has a flow they want me to do, be it theirs or a new one, let me know

Re: magnetic sensor help please?
Do your case have magnet attached? The magnetic sensor works by the sensing nearby magnetic field, so the case must have magnet. If not, you can't use that. You can use proximity sensor instead, it is almost the same. Just replace the trigger in my previous post with proximity near.
When the proximity sensor is near, then it will trigger the flow immediately, do all the check and disable itself. When the device is unlocked (user present), proximity will be enabled back and ready to be trigger again.
When the proximity sensor is near, then it will trigger the flow immediately, do all the check and disable itself. When the device is unlocked (user present), proximity will be enabled back and ready to be trigger again.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
- Autumn-Leigh
- Posts: 67
- Joined: 15 Mar 2018 19:23
- Location: UK
- Contact:
Re: magnetic sensor help please?
Okay, so i set that up, now how do i do this?Desmanto wrote:Do your case have magnet attached? The magnetic sensor works by the sensing nearby magnetic field, so the case must have magnet. If not, you can't use that. You can use proximity sensor instead, it is almost the same. Just replace the trigger in my previous post with proximity near.
When the proximity sensor is near, then it will trigger the flow immediately, do all the check and disable itself. When the device is unlocked (user present), proximity will be enabled back and ready to be trigger again.
when Display is on, and using it, and BLE isnt picked up, it goes to lock screen with pin then ends?
YouTube Channel - https://youtu.be/fui3RO9EmNU
If anyone wants a shoutout, or has a flow they want me to do, be it theirs or a new one, let me know
If anyone wants a shoutout, or has a flow they want me to do, be it theirs or a new one, let me know

Re: magnetic sensor help please?
The BLE check only triggerred when the case is closed. So you only need that proximity sensor as the trigger. (no display state on and periodic timer anymore) User present trigger only enable the proximity flow, and should be put on another flow. (since it is active all the time) Or maybe you want to do another additional check before closing the case? I think the closing the case is enough for this case. (no pun intended
)

Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
- Autumn-Leigh
- Posts: 67
- Joined: 15 Mar 2018 19:23
- Location: UK
- Contact:
Re: magnetic sensor help please?
My proximity sensor worker once, and stopped :/Desmanto wrote:The BLE check only triggerred when the case is closed. So you only need that proximity sensor as the trigger. (no display state on and periodic timer anymore) User present trigger only enable the proximity flow, and should be put on another flow. (since it is active all the time) Or maybe you want to do another additional check before closing the case? I think the closing the case is enough for this case. (no pun intended)
YouTube Channel - https://youtu.be/fui3RO9EmNU
If anyone wants a shoutout, or has a flow they want me to do, be it theirs or a new one, let me know
If anyone wants a shoutout, or has a flow they want me to do, be it theirs or a new one, let me know

Re: magnetic sensor help please?
Did the flow got enabled back by user present? When you edit the trigger Proximity sensor, does the value change when you cover and uncover it?
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
- Autumn-Leigh
- Posts: 67
- Joined: 15 Mar 2018 19:23
- Location: UK
- Contact:
Re: magnetic sensor help please?
trouble is, with proximity sensor, its turning of my smart case sview also :/Desmanto wrote:Did the flow got enabled back by user present? When you edit the trigger Proximity sensor, does the value change when you cover and uncover it?
YouTube Channel - https://youtu.be/fui3RO9EmNU
If anyone wants a shoutout, or has a flow they want me to do, be it theirs or a new one, let me know
If anyone wants a shoutout, or has a flow they want me to do, be it theirs or a new one, let me know

Re: magnetic sensor help please?
So, what is something that is always happen when you close the case, but doesn't interfere with the sview? Does the Display state off triggered when you close it? If yes, just use that, much battery-friendly. Or maybe the sview has the broadcast intent too that you can catch, try general Broadcast maybe?
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.