Questions "Locus Tasker App" "Request sensors and Stats"

Started by freischneider, March 23, 2023, 20:32:48

0 Members and 1 Guest are viewing this topic.

freischneider

I have some questions about "Request sensors and Stats".
Guide Navipoint1 Dist:
1.
Is Navipoint a turn indication (turn right) ?
2.
Navipoint 1 and 2. is 1 the next turn hint in the track ? and 2 the next ?
3.
Do 1 and 2 always move up when I pass them ? Example I have 3 pcs. 1. turn right 2. straight ahead 3. turn left. When I have turned right and thus passed 1. Is then 2 straight ahead-- now 1 straight ahead and 2 is then turn left.

4.
Navipoint1 Time: is it the time to the turn, based on the current speed ? Is it given in seconds ?

5.
What is Navipoint1 Extra and Navipoint1 Action ?

6.
What is Navigation Point Index ?

7.
If I understand correctly, these values are stored as variables in Tasker.  Is this permanent and in which intervals is it updated. Does it need a permanent battery ? And how much ?
Poco F5, Xiaomi Redmi Note 10 Pro, Android 13
Locus Map 4 Gold (always latest version)
LM4 User-ID: 11cec7cb5  (Devices-ID poco F5)
  •  

Tapio

Freischneider, I personally don't need and poll those navipoint values. I guess your assumptions 1-3 are right. But idk.

7: Those data are retrieved every time you execute "request sensors and stats". You define when you need fresh values.

Cost on battery - I would say it's negligible. The battery intensive part is rather the GPS, bright screen etc...

Yes, the values are stored to local variables and tasker makes them easily accessible. See screenshots.

Important read on variables, scope, arrays...:
https://tasker.joaoapps.com/userguide/en/variables.html
Tapiola MFV4+ theme for OAM Maps:
Discuss - Releases - DL latest - Install latest
  •  

freischneider

Thanks Tapio
Ah I see, the value I store in the variable is only the one at that time of retrieval. It does not adjust itself. This is how I have used it since. I retrieved the zoom factor and saved it. Then zoomed in and after 10s zoomed back to the saved value.
I have since used Logcat Entry as the trigger. But on Android 13 there is no access to logs anymore.

I then tried to use the distance from the notification. I have attached the profile below: Zoom Distance

As trigger I took the notification Locus Map with the title Navigation. The zoom worked. Only zoom back to old value did not work. But I don't know why.
But distance is not ideal. If I drive very slowly, the zoom comes too early. If I drive very fast it comes too late.

That's why I want to look at Navipoint1 Time. I would like to zoom to level 20 15s before reaching the turn.
But if I use the trigger Notification Locus Map with the title Navigation, the value is only saved once at the very beginning. I would like to have it up to date during the whole navigation.
Otherwise I would use the same profile. Smaller 15s zoom and larger 20s back to the old value.
I made %ZoomTaskRun so that if I make 2 turns in quick succession, the zoom stays and doesn't go in and out all the time.

But if the value of time does not adjust then I can forget it.

https://taskernet.com/shares/?user=AS35m8myXKtjIGNUWsV%2B9rrY700mXg7J6ZfEVVnMRuKgnB7lCQSX4FKkJo5qdMP9dVIWhJcG9G%2BstQ%3D%3D&id=Project%3AZoomDistanz

Profil: Distanz
Ereignis: Benachrichtigung [ Besitz Applikation:Locus Map Titel:Navigation Text:* Subtext:* Messages:* Other Text:* Typ:* New Only:Aus ]



Eingang Aufgabe: Anon

A1: Variable Aufteilen [
Name: %evtprm3
Teiler: , ]

A2: Variable Suchen Ersetzen [
Variable: %evtprm32
Suche: m
Übereinstimmungen Ersetzen: An ]

A3: If [ %evtprm32 < 70 & %ZoomTaskRun !~ 1 ]

A4: Request sensors and stats [
Konfiguration: map_zoom_level
Timeout (Sekunden): 10 ]

A5: Execute Action Task [
Konfiguration: tasks: {"map_zoom":{"action":"value","value":"20"}}
Timeout (Sekunden): 0 ]

A6: Variable Setzen [
Name: %ZoomTaskRun
Zu: 1
Max Rounding Digits: 3
Structure Output (JSON, etc): An ]

A7: End If

A8: If [ %evtprm32 > 80 & %ZoomTaskRun ~ 1 ]

A9: Execute Action Task [
Konfiguration: tasks: {"map_zoom":{"action":"value","value":"%map_zoom_level"}}
Timeout (Sekunden): 0 ]

A10: Variable Lösche [
Name: %ZoomTaskRun ]

A11: End If
Poco F5, Xiaomi Redmi Note 10 Pro, Android 13
Locus Map 4 Gold (always latest version)
LM4 User-ID: 11cec7cb5  (Devices-ID poco F5)
  •  

Tapio

Adjust zoom level based on distance to next turn is what I understand you want to do?

Maybe use a Tick event triggered profile, Tick just fires the entry task every n milliseconds. You can go up to 2 minutes. You can use a profile variable there and have it fire dynamically and intelligent (tick more often, the closer you get to the point of action).

Dynamic ticks (i. e. with variable ms, not a fixed value) are not perfect, need a specific workaround in order to work, which I can tell you if you're interested. You can of course already do testing with fixed values. Just let your task run like every 2000 ms
Tapiola MFV4+ theme for OAM Maps:
Discuss - Releases - DL latest - Install latest

freischneider

Distance to Navipoint I wanted but the problem is the distance. Depending on the speed is very different.
That's why I try to use Time now. Zoom in 15s before Navipoint.
I just do not know where I apply the tick. If I apply it alone in the profile it goes day and night. Can I say in the profile notification Locus / navigation + tick ?
I also don't know if the value is displayed in s or min. or maybe 22:08.
The variable is deleted immediately after the task. Therefore I cannot see its value.
At the moment I am ready, only tick is missing for the test.
https://taskernet.com/shares/?user=AS35m8myXKtjIGNUWsV%2B9rrY700mXg7J6ZfEVVnMRuKgnB7lCQSX4FKkJo5qdMP9dVIWhJcG9G%2BstQ%3D%3D&id=Project%3AZoomTime

Dynamic ticks: yes I am also interested. But for now it has to run like this. And then we have to switch to the German forum.

Translated with www.DeepL.com/Translator (free version)
Poco F5, Xiaomi Redmi Note 10 Pro, Android 13
Locus Map 4 Gold (always latest version)
LM4 User-ID: 11cec7cb5  (Devices-ID poco F5)
  •  

Andrew Heard

@tapio I'd be interested to read about the dynamic ticks too.
LM4.22.0 GOLD user ID:c7d47597a
  •  

Tapio

Quote from: Andrew Heard on March 24, 2023, 23:12:25@tapio I'd be interested to read about the dynamic ticks too.
OK.

a) You will use %tick as a variable which holds the tick time in milliseconds.
b) That variable needs to live in the profile scope. So you have to define it as a "profile variable". (longtap profile, tap gear wheel, or however that's called)
Avoid global variables mess, keeping scope limited is good.

Now there's a problem: if you assign a new %tick value in the entry task, this will be unnoticed by the tick trigger (profile event). It would continue ticking with the old value.
This is what needs a workaround. Profile off/on would work, but it's bad. So...

Instead of just "Variable set %tick=newvalue" do this:

c) Variable Clear %tick; wait 300ms; variable set %tick=newvalue
d) Add an additional variable state trigger to the profile: "%tick !~ \%tick"

Done.

The concept is in action here, just for you to compare:
https://taskernet.com/shares/?user=AS35m8kdDIMDeveQcQfRglam%2Fah1mTW%2FWcg05FZ39c0i1q%2F77iY3E7cIwxCkXqJTaTA%3D&id=Profile%3A%40%40Alarm

That is an alarm profile, where tick time gets smaller as it approaches alarm time.
Tapiola MFV4+ theme for OAM Maps:
Discuss - Releases - DL latest - Install latest

Tapio

Freischneider, I have changed your profile to use Tick. As for the times returned by the plugin, those are always in unix seconds since 1970..., a big number. The current time is in %TIMES. You can use the flash action and look yourself.

I have added flash, 2 plugin independent zoom intents and the tick set as disabled code on top of your task, for your inspiration. It runs only if Locus on top.

https://taskernet.com/shares/?user=AS35m8kdDIMDeveQcQfRglam%2Fah1mTW%2FWcg05FZ39c0i1q%2F77iY3E7cIwxCkXqJTaTA%3D&id=Profile%3ADistanz
Tapiola MFV4+ theme for OAM Maps:
Discuss - Releases - DL latest - Install latest

Tapio

"It goes day and night" - it's up to you to define when it runs. You could add an additional variable context, make it run only eg if "%IAmOutside=true", you could control the profile through other tasks - there's an action "Profile status" which turns profiles off/on. You could add a time context. Whatever you wish.

See in my attachment how a profile is tamed by multiple conditions. Often I have to let the entry task start, but if certain other conditions are not met, I will stop it (via the Stop action) as soon as possible.

To your profile, I have added the condition of Locus being on top, just an idea.
Tapiola MFV4+ theme for OAM Maps:
Discuss - Releases - DL latest - Install latest

Andrew Heard

Quote from: Tapio on March 25, 2023, 11:09:40d) Add an additional variable state trigger to the profile: "%tick !~ \%tick"
Done.
@tapio - a simple "SAY THANKS" click wasn't enough this time - thanks (again)!
LM4.22.0 GOLD user ID:c7d47597a
  •  
    The following users thanked this post: Tapio

freischneider

From me also once again a thank you
Have now been doing various tests all day and testing other combinations of If and Endif and variables. Once it was not zoomed at all and mostly only in and not out. I just thought of something else and I think that will work. Will be tested tomorrow.
The Unix seconds are not used with Navipoint1_Time. I have found out through various tests that it is specified in miliseconds. Unfortunately I found this out only after many unsuccessful tests.
I have to take a closer look at the tick later.

The examples for inspiration are all grayed out. Are they inactive ? How do you do that ?
Poco F5, Xiaomi Redmi Note 10 Pro, Android 13
Locus Map 4 Gold (always latest version)
LM4 User-ID: 11cec7cb5  (Devices-ID poco F5)
  •  
    The following users thanked this post: Tapio

Tapio

Yes, I added deactivated entries. Longtap -> Screenshot.

Ah, I looked at %guide_navpoint1_time, it seems to be remaining time in ms, you're right.

Often you rather get a unix timestamp and calculate the difference. You probably know you can do maths in Variable Set actions.
Tapiola MFV4+ theme for OAM Maps:
Discuss - Releases - DL latest - Install latest

freischneider

I haven't quite reached my goal yet, but I've come a lot closer. With the Logcat, I had only one defined trigger. Then when the announcement comes. And it comes only once 15s before.
With the current setting, I now have to work longer in practice.
I have also found out so that it also goes without tick. I have tick and Locus App active replaced by notification query. Notification from Locus with the title Navigation.
In any case, I have learned a lot again.
A big thank you for that !
Poco F5, Xiaomi Redmi Note 10 Pro, Android 13
Locus Map 4 Gold (always latest version)
LM4 User-ID: 11cec7cb5  (Devices-ID poco F5)
  •  

Tapio

Sounds good. Please upload at some point, never used logcat event myself, but it's very interesting.
Tapiola MFV4+ theme for OAM Maps:
Discuss - Releases - DL latest - Install latest
  •  

freischneider

You can find the logcat here.
https://forum.locusmap.eu/index.php?topic=8047.0
Unfortunately I can't use it with Android 13 anymore. The current one follows. Will post it there as well.
Poco F5, Xiaomi Redmi Note 10 Pro, Android 13
Locus Map 4 Gold (always latest version)
LM4 User-ID: 11cec7cb5  (Devices-ID poco F5)
  •