Page 1 of 1

Flow gets disabled [solved]

Posted: 07 Sep 2018 10:52
by Glatzi
Hi there,

I'm evaluating the actual EAP 1.36.0 DEV version as a Tasker replacement & I'm quite happy how Automagic works! :D
I've got a Danalock & I've used Tasker as a replacement for the original Danalock app because the geofence function consumes quite a lot of battery juice under Oreo 8.1.

I've created a flow which checks every 30 seconds if I'm connected to a cell tower near of our house. If this is the case serveral actions are triggered.
A few variables get checked & if some conditions are true I'm sure that I'm at home & the lock can be unlocked.

The flow gets disabled by Automagic & I'm not sure why? To check that I'm near my house I'm checking if Wifi is connected. If this is not the case, I wait 2s & call the flow again.
I've already increased the actions to 600 per minute but the flow does not work correct. I've attached the flow & the log. The error only appears when the cell tower connected condition
is true.

Any help is appreciated.

Re: Flow gets disabled

Posted: 07 Sep 2018 17:20
by Desmanto
You are using a infinite loop logic in the flow. Thus a single execution can end up with multiple copy of the running flow, exhausting the element execution per minute and reach the Automagic Emergency Stop (default 60) just within 5 seconds. Adjusting AES to 600 doesn't help, since the multiple copy will cascade fast enough to exhaust that too. When the flow is disabled already, action execute flow will result in error.

For location geofencing, you can see my flow at my index, section Geofencing. I am using wifi, but you can change it to cell tower trigger too (Phone Cell GSM/CDMA). It is better to use a event based trigger to trigger the entrance/exit state, rather than periodic timer trigger.

Re: Flow gets disabled

Posted: 10 Sep 2018 06:54
by Glatzi
Desmanto wrote:You are using a infinite loop logic in the flow. Thus a single execution can end up with multiple copy of the running flow, exhausting the element execution per minute and reach the Automagic Emergency Stop (default 60) just within 5 seconds. Adjusting AES to 600 doesn't help, since the multiple copy will cascade fast enough to exhaust that too. When the flow is disabled already, action execute flow will result in error.

For location geofencing, you can see my flow at my index, section Geofencing. I am using wifi, but you can change it to cell tower trigger too (Phone Cell GSM/CDMA). It is better to use a event based trigger to trigger the entrance/exit state, rather than periodic timer trigger.
Thanks for your reply. But there is an option in the flow that a new instance will be destroyed if already one instance is running? So in my understanding no other instance should be launched then? I'll have a look at your geofence solution too!

Re: Flow gets disabled

Posted: 11 Sep 2018 10:55
by Desmanto
Glatzi wrote: Thanks for your reply. But there is an option in the flow that a new instance will be destroyed if already one instance is running? So in my understanding no other instance should be launched then? I'll have a look at your geofence solution too!
Yes, there are several FEP option you can choose, "Stop" is the one you need if you need to "destroy" the existing instance. Look at my index, search for Flow execution policy

To loop in the same flow, don't use execute flow. Simply connect the last action in the flow back to the first action after the initializing the variable. I have a similar speech flow that require to loop in the same flow, and I reconnect the last element to the 5th action for the Input Speech; thus looping the voice command.

Re: Flow gets disabled [solved]

Posted: 14 Sep 2018 07:29
by Glatzi
Thanks for the hint. I've implemented & adapted your flow & it is working fine allthough I'm only using WLAN for the geofencing smartlock function!

Re: Flow gets disabled [solved]

Posted: 10 Mar 2019 13:30
by yxd0018
When your flow got disabled by emergency stop, do you get log and timestamp updated? Mine show empty log file and not sure timestamp is correct.my flow doesn't have infinite loop.

Re: Flow gets disabled [solved]

Posted: 11 Mar 2019 14:43
by Desmanto
Just tried, with AES set to 1 and execute flow with 2 elements. Flow stopped with notification "interrupting and disabling flow". Tap it will bring to the flow. Check at 3 dot menu > log > error "Emergency stop count reached, disabling flow and current flow execution", including its timestamp.