Open sphh opened 5 years ago
To make it clear: do you expect Easer not listen to the NOT Bluetooth Headset connected
condition under the circumstance (after returning with the headset still connected), because you are back to the office and the NOT cell location
condition should be false
?
If yes, I suggest you check the "cool down time" setting. Try decreasing it to see if it improves the situation.
As I understand @sphh 's problem, he wants to skip the 2nd script immediately if it's not true, because otherwise the state machines token stays between the two scripts "Departure" and "Departure 2" as long as "Departure 2" stays in state "false". Anyway, "Departure 2" becomes true sometimes later and will then activate profile "Switch off Bluetooth" , which is a point in time being much to late.
To say it in other words:
The problem is the absence of a real "logical and" operation. In that case, the sequential processing doesn't lead to desired behavior. Alternatively, a real "conditional branch" would do its job in that situation as well:
if Script_Departure_2 = true then
Profile_Switch_off_Bluetooth := true;
else
break;
end if;
Personally, I would also appreciate the availability of a "logical and" operation.
Thanks @just-Nob to rephrase it in a clearer language. That's exactly what I want.
@renyuneyun, if I understand you correctly, that's what I'd expect. Could you please tell me the unit of the "cool down time", so that I can make a more educated guess what I am aiming for.
What would be the side-effects of reducing the "cool down time"? Higher battery usage?
Well, I think, @just-Nob's suggestion of a real "logical and" would solve my problem by way of a work-around. In real life, the tree branches at script Departure
and another profile switches off WiFi:
Service start
|
Script: Departure
Condition: NOT cell location
|
+–––––––––––+–––––––––––––––+
| |
Profile: Switch off WiFi Script: Departure 2
Condition: NOT Bluetooth Headset connected
|
Profile: Switch off Bluetooth
With a "logical and" I would need a two branches:
Service start
|
+–––––––––––+––––––––––––––––––+
| |
Script: Departure A Script: Departure
Condition: NOT cell location Condition: NOT cell location
| AND NOT BT Headset connected
| |
Profile: Switch off WiFi Profile: Switch off Bluetooth
If there were a Profile's action "Reset the state engine of branch below Script XXX", I could add new branch:
Service start
|
Script: Arrival
Condition: Cell location
|
Profile: Reset state engine of branch "Departure"
But maybe that's a stupid idea and there are better ways to achieve this …
Hi @sphh, just have a look at issue #268 - may that error be the reason for the problem described na you at the issue's start?
Thanks @just-Nob for pointing this out. I tried it, but this seems not be an issue with BT headsets. That is the condition is not reversed.
Some update after the looong time...
@sphh I guess you are already aware of the unit of "cooldown time" is "second".
The downside of reducing "cooldown time" is sometimes an Event (well, actually two -- a true
and a false
) happens back and forth, without really knowning why (e.g. Wi-Fi connected (seen in an early issue)). Battery usage should not increase significantly as far as I'm concerned, because Easer listens to things passively.
(Is this still a problem now?)
Logical "or" is implemented (in a sense) and is being tested in v0.7.9-beta. Multiple predecessors (parents) is the graphical description.
My scenario is as follows:
I have the following set-up (Pivot view):
When I start Easer, that works well when I leave the office for the first time. The problem I run into, happens when I have the headset connected and leave the office, returning with the headset still connected. Than the condition
NOT Bluetooth Headset connected
never became true and it looks like Easer is waiting for this condition to become true. Now I plug the headset in to charge and it switches off (or I get out of reach with the Bluetooth headset). The conditionNOT Bluetooth Headset connected
becomes true and Easer switches the Bluetooth off.Is there a way to cancel a branch of Easer's tree? Or is there another way to get it to work as I want it to do?
Thanks for your help!
Easer version: v0.7.7.7