Simulated Presence plus Tasker plus Variables


#1

1) Give a description of the problem
I have given up on WC Presence Sensors. It works great on my wife’s phone but after 1 initial trigger on my phone it never triggers again whether WC app is open or not and I have all the battery optimization turned off and even disabled the Huawei powergenie thru adb. I also can’t use the Wi-Fi presence app because of very limited public wifi where I live and the app also does not recognize the WiFi NEAR concept.

2) What is the expected behaviour?
So current exploration is using geo fences in tasker and passing data to WC and using a Simulated Presence Device. This also means no limits to geo fences and having to set up multiple WC instances to get past the 10 limit that is in WC.

3) What is happening/not happening?
I Set up several geo fences in Tasker/AutoLocation…all good and so far working well (which would seem to point to a problem in the WC app’s Presence Sensor).
I am passing 5 variables from Tasker to WC and they all arrive.
I am setting the simulated Presence Sensor to present/not present no problem.

4) Post a Green Snapshot of the pistonimage
First I set Variables based on the passed parameters from Tasker
Then I set Presence based on what CurrentPlace came in
Then I just test to make sure I can trigger on presence and that it was set correctly.

So then I decided to look into $ARGS to see what was in there as well as looking to see what happened with other things like $currentEventDevice…and that is when things started to look ‘interesting’.

  1. I successfully passed the EventTime from tasker but it does not show up in $ARGS as the others do. Also before I added the EventTime, there seemed to be a proper order to passing the parameters from Tasker. A couple other variables were not showing up until I changed the order (so now Tasker Order = Definition order = Order I set/extracted them in the piston). Is there a method/sequence/??? that these parameters have to follow so show up in $ARGS when I write them to “somewhere” other than into a variable?

  2. currentEventDevice = Home from some strange reason. It should be = Name = PresenceDevice

  1. Can I expect to use any of the currentEventDevice and related variables like previousEventDevice or statements like this:

    …or do they only apply if I am using the WC Presence Sensor? I am still trying to sort out if these kind of things are only available because they are exposed by the Device Handler and how to know which of these device attributes I can inquire on or even if there are some I can set (probablly another separate question/topic).

And here is the tasker GET for the Enter Location task.

Enough questions for now…thanks in advance.

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)

LEAVING
2/26/2020, 5:11:21 PM +503ms
+144ms ║Michael…Left…ARRIVED: Travelling …CAME FROM: Home…TIME: Wed, Feb 26 2020 @ 5:11:21 PM CST

+207ms ║Michael was set to Away: PRESENCE not present ARGS: [Action:Left, CurrentPlace:Travelling, Name:Michael, PreviousPlace:Home, param1:execute, param2::3520d3750b5c8c029a4748c5179528ae:, remoteAddr:xxx.xxx.xxx.xxx]

+241ms ║AWAY…PRESENCE: not present ARGS: [Action:Left, CurrentPlace:Travelling, Name:Michael, PreviousPlace:Home, param1:execute, param2::3520d3750b5c8c029a4748c5179528ae:, remoteAddr:xxx.xxx.xxx.xxx]

ARRIVING
2/26/2020, 5:10:08 PM +358ms
+776ms ║Michael…Arrived…ARRIVED: Home …CAME FROM: Home…TIME: Wed, Feb 26 2020 @ 5:10:08 PM CST

+925ms ║Michael was set to Arrived: PRESENCE present ARGS: [Action:Arrived, CurrentPlace:Home, Name:Michael, PreviousPlace:Home, param1:execute, param2::3520d3750b5c8c029a4748c5179528ae:, remoteAddr:xxx.xxx.xxx.xxx] CURRDEV: Home

+953ms ║ HOME…PRESENCE: present ARGS: [Action:Arrived, CurrentPlace:Home, Name:Michael, PreviousPlace:Home, param1:execute, param2::3520d3750b5c8c029a4748c5179528ae:, remoteAddr:xxx.xxx.xxx]


#2

If the name of the arg’s spelling is exact on both Tasker and the piston (it’s case sensitive) then my second guess would be an illegal character may be involved.


This is likely because the piston is being called from an external source.
(IE: It was triggered by the ST hub, not a device)


Nearly any text can be passed… but keep in mind that special characters can cause errors.
(space, tab, equals, ampersand, slashes etc)


#3

The event that fires your piston is generated by webCoRE itself. It is a location event so $currentEventDevice will be your ST Location name. I can’t remember what the attribute and value get set to off hand.

I don’t have an immediate explanation for EventTime not showing in the log when it is clearly being passed.


#4

So the strange part is the EventTime is actually coming into the piston

Set Variable EventTime = $args.EventTime

and I am able to display it in the Log to Console using the EventTime variable and it shows up in the variable definition.

It just does not show up with Log to Console using Expression = $args so something is not consistent.

But the good news is I have the data I need.

Thanks.


#5

Oftentimes, the formatting affects the display.

For example:

pic


And here is one that bothered me back in the day…

pic


#6

For what it’s worth, I find the “Set variable” is better at capturing “pure” text…

pic


#7

Let’s look at it another way. $args.EventTime isn’t shown because it doesn’t exist. Where does that thinking take us? Is %eventTime actually set in Tasker for example?

The thing is you can set EventTime to $args.IMadeThisUp or to "Complete Drivel", and EventTime will be set to the current date and time, and at worst that is only going to be seconds later than the event time in Tasker.