Hello,
I have the following problem. I got my real switches in my automation software modeled to the bits of one global variable. This saves time transfering all states of all switches with one "get http" call from tasker instead of 32 individual calls. Now I need a way to do bitwise operations on this variable in tasker to get the individual state of each switch/bit . Like adding a certain mask to the variable with logic AND to filter the individual bit state.
Any ideas how to to that in tasker?
Thanks
I'm thinking the only way to do this is with a tasker javascriptlet.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Related
For those who may not be aware, changes to Tasker are being forced by Google, else they are threatening to pull the app (as others using the accessibility API) from the play store. This has the potential to affect users' existing profiles.
Here's Pent's post on the Tasker group page.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Wth is wrong with google? This is not funny. I am using Tasker with a huge Profile and a lot of Tasks that help me through my disabilities. Reconfiguring all the tasks will cost a lot of effort. It seems that I need to backup the current APK of tasker.
Thank you for the info cause I am used to update Tasker without even checking the changelog.
Looks like Google is rethinking their position on tasker being forced to remove access to the accessibility API. Pent's post.
Hello,
How can I have Tasker turn on Bluetooth whenever I'm in motion?
I have a connected vehicle and whenever I leaving work, home, shipping etc., I would like Tasker to turn Bluetooth on and when I'm not in motion for more than 10 minutes turn Bluetooth off.
Any assistance is appreciated.
Micheao
If you really v want this to be motion sensing, then I suggest the AutoLocation plug-in. It does required GPS to be on for most precision/accuracy. Additionally, your location will be constantly monitored so you're going to be draining the battery.
If this is too turn on Bluetooth to connect to the car radio and turn off when you've left the car, then I'd be using the Bluetooth near context.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
ktmom said:
If you really v want this to be motion sensing, then I suggest the AutoLocation plug-in. It does required GPS to be on for most precision/accuracy. Additionally, your location will be constantly monitored so you're going to be draining the battery.
If this is too turn on Bluetooth to connect to the car radio and turn off when you've left the car, then I'd be using the Bluetooth near context.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Click to expand...
Click to collapse
Yes, I want it to be motion sensing using the GPS and battery is not a problem. Is it a limitation with Tasker that makes it impossible to do?
Regards
Tasker is a framework first. Plugins add features that not all users will want. This method of using plugins helps keep the core app under control from a maintenance and size point of view.
You can create a task that gets your location, then gets a second location, compare those results and determine if the device is moving. Read Tasker's online documentation: location without tears.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Thanks for the no help
So what have you tried since the last post 2 weeks ago? How about you post your profile and indicate what's not working.
To do that, make sure it's named - not a default name assigned by tasker. Then long press on the name to highlight the profile. Go to the 3-dot menu and select export -> Description to Clipboard.
Then you'll be able to paste it. Be aware, it easier to use pastebin then link to a post here. If you paste in a post here, the forum software will convert all semicolons with characters after, typically "on" and "off" to emoticons making it very hard to read.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Hi,
I would like to read the secure setting "location_providers_allowed" and write the value to a variable named %Locmode.
When the task is executed and the location setting / variable is empty, which means the location mode is off, it should enable the location mode e.g. GPS.
But when my task reads the value of "location_providers_allowed" with the shell command "settings get secure location_providers_allowed" and it's empty / location mode is off, the variable is set to an invisible value.
When I build a check which queries if the variable %Locmode is set or not, the result is TRUE. But in the tab with the variables overview the value of my variable is empty.
If I execute an "Flash %Locmode" the shown message is "%Locmode".
Is this an issue? Is there another way to query if the location mode is off or not?
Nexus 5X with Android 8.1, rooted
Tasker 5.2.bf1
Thank you.
Jas Man
If the location mode is set to off, the variable %Locmode will not have a value so the flash action returns just the variable name. This is an "Uninitialized Variable" and the behavior you're seeing is described further down the Tasker user guide variables page.
When the location mode is high accuracy, your variable should return "gps,network", or battery saving mode it would return just "network".
In theory, just having the variable checked for "is set" would return true if location mode is anything but off. But because the variable is initialized in the process of reading the setting, it will pass the "is set" test but it will be empty causing Tasker to flash the variable name. I suspect this is an unintended gotcha, but it is working as currently designed.
Maybe better to test for the possible values rather than just if it's set.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Thank you @ktmom for the explanation.
I will try the opposite way to check if the location mode is on or not (IF %Locmode is GPS or NETWORK or WIFI)
JasMan78 said:
Thank you @ktmom for the explanation.
I will try the opposite way to check if the location mode is on or not (IF %Locmode is GPS or NETWORK or WIFI)
Click to expand...
Click to collapse
You could try using;
Code:
%Locmode !~ \%Locmode
That should behave in the manner you previously described. "!~" means "does not match" and we're specifying the variable contains nothing thus mimicking an "is set" test.
The \ character is being used as a Java regular expression match. In Java the character after the \ is evaluated and in this case it's the content of the variable %Locmode. So the expression is evaluating the variable %Locmode does not contain anything.
And thanks, because researching this caused me to learn something [emoji4]
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Code:
%Locmode !~ \%Locmode
Works! But for me a little bit to exotic, because I'm not very familiar with java. When I will edit this task in e.g. one year, I will have no clue why I did this in the past.
Maybe I will get a little bit more into this later. Thank you again.
Put a note to self into the task using an anchor. Plus sign -> Task -> anchor
Put your note into the input field then pause the action.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Wow, I'm using Tasker for many years now, but I've never realized the action "Anchor". Nice
Any input field on any action can give the same effect. You could use the input field in the action you have the if statement in. I just think the anchor action stands out more.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Hello everyone,
I'm very new and I was hoping I can get some assistance from you.
I want to have my screen timeout changed when Im running Tasker in foreground. Is there any way to do this?
Thank you,
From the Tasker FAQ;
Why isn't Tasker shown in the Application Context list ?
Because it's easy to get into trouble firing tasks in Tasker. For example, if a profile is setup with a Tasker Application Context and a task with Load App Calculator, it will not be possible to enter Tasker anymore.
Click to expand...
Click to collapse
When the accessibility service is enabled for Tasker, the %WIN variable won't detect Tasker either. Of course, disabling accessibility prevents Tasker from intercepting what app is running.
It *might* be possible to do what you want using the app factory and making a kid app.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Recently, I stumbled upon this nice little app, called Detact. It uses the new Activity Recognition Transition API to detect your current activity (driving, running, biking,...). I use this app to automatically enable Bluetooth while I am driving, so that it connects to my car's Bluetooth system. Until now, it does the job properly.
The thing is: it will always enable Bluetooth while I am inside a driving vehicle. I would like to have it enabled while connected to my own car, but not while I am driving any other car. My idea would be some kind of task that will (periodically?) check if I am connected to my car. If not connected after a pre-defined amount of time (say, three minutes), the task (named "driving mode" for example) should be aborted and not re-enabled by the initial profile afterwards.
Any help would be highly appreciated.
So this takes 2 profiles to accomplish.
The first one is a check that the car BT is connected. The profile context is a BT Connected state and enter the connection information for your car. The associated entry task should set a variable (e.g. %CarBT to true). In this case, you must have at least one capital letter in the variable so its available to other tasks. The associated exit task is a variable clear for the above variable.
The second profile is your existing plugin context for Detact. The entry task I assume starts with a BT on action. Then add a 3 minute wait then a BT off action which has an if statement: IF %CarBT does not match true.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
ktmom said:
So this takes 2 profiles to accomplish.
The first one is a check that the car BT is connected. The profile context is a BT Connected state and enter the connection information for your car. The associated entry task should set a variable (e.g. %CarBT to true). In this case, you must have at least one capital letter in the variable so its available to other tasks. The associated exit task is a variable clear for the above variable.
The second profile is your existing plugin context for Detact. The entry task I assume starts with a BT on action. Then add a 3 minute wait then a BT off action which has an if statement: IF %CarBT does not match true.
"Good judgment comes from experience, and a lot of that comes from bad judgment." - Will Rogers
Click to expand...
Click to collapse
Thank you for your explanation :good: I will give it a try and report back if any question arises.
Short feedback from my side: the above mentioned solution by setting up two different profiles works as I intended it to run. Thanks again, @ktmom :good: