magnetic sensor help please?

Post your questions and help other users.

Moderator: Martin

Post Reply
User avatar
Autumn-Leigh
Posts: 67
Joined: 15 Mar 2018 19:23
Location: UK
Contact:

magnetic sensor help please?

Post by Autumn-Leigh » 07 Apr 2018 17:42

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?
Attachments
Screenshot_2018-04-07-18-36-12.png
Screenshot_2018-04-07-18-36-12.png (128.99 KiB) Viewed 19419 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 :)

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: magnetic sensor help please?

Post by Desmanto » 07 Apr 2018 18:24

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
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.

User avatar
Autumn-Leigh
Posts: 67
Joined: 15 Mar 2018 19:23
Location: UK
Contact:

Re: magnetic sensor help please?

Post by Autumn-Leigh » 07 Apr 2018 18:28

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
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?
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 :)

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: magnetic sensor help please?

Post by Desmanto » 08 Apr 2018 11:35

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.
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.

User avatar
Autumn-Leigh
Posts: 67
Joined: 15 Mar 2018 19:23
Location: UK
Contact:

Re: magnetic sensor help please?

Post by Autumn-Leigh » 08 Apr 2018 11:56

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.
Okay, so i set that up, now how do i do this?

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 :)

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: magnetic sensor help please?

Post by Desmanto » 08 Apr 2018 12:32

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 :D)
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.

User avatar
Autumn-Leigh
Posts: 67
Joined: 15 Mar 2018 19:23
Location: UK
Contact:

Re: magnetic sensor help please?

Post by Autumn-Leigh » 08 Apr 2018 12:57

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 :D)
My proximity sensor worker once, and stopped :/
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 :)

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: magnetic sensor help please?

Post by Desmanto » 08 Apr 2018 13:19

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.

User avatar
Autumn-Leigh
Posts: 67
Joined: 15 Mar 2018 19:23
Location: UK
Contact:

Re: magnetic sensor help please?

Post by Autumn-Leigh » 08 Apr 2018 13:26

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?
trouble is, with proximity sensor, its turning of my smart case sview also :/
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 :)

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: magnetic sensor help please?

Post by Desmanto » 08 Apr 2018 17:02

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.

Post Reply