Page 1 of 1
variables returns null
Posted: 01 Aug 2015 14:50
by albatrosxl
Hi all, I tried to get the battery level and show UT via a messagebox or statusbar information. But any variable (except the date and time) returns NULL. Even if i download some examples.
Null will be returned for any variable which belonfs to battery....
Has anybody any idea?
I have a huawei y550, Android 4.3
Thanks
Albatrosxl
Re: variables returns null
Posted: 02 Aug 2015 12:49
by albatrosxl
This happrns also in my Tablett (medion\lenivo).
What might be the Problem?
Both are not rooted.
In the other Hand, tasker, Automaten, macrodruide are able to return a correct value
Re: variables returns null
Posted: 02 Aug 2015 15:28
by bogdyro
Hei. How are you trying to access the info? Using some variable like this? {battery_percentage,numberformat,0}
You have to use it in a flow that first initializes these values, by either using the trigger battery level or condition battery level. Otherwise they are null. There should be an acrion like init variables battery info.
Re: variables returns null
Posted: 02 Aug 2015 15:46
by bogdyro
While you could use the cobdition in your flow and link it to the next block weather its true or false, you can also get the battery percentage with execute command
cat /sys/class/power_supply/battery/capacity
Re: variables returns null
Posted: 03 Aug 2015 05:59
by albatrosxl
Thanks for the response.
The flow is a very simple one and has only one trigger, one action.
The trigger is "ACCU LADEZUSTAND"(battery level)
The action is "benachrichtigung auf display anzeigen"(show message on display" ) using the variable battery percentage… ..
I also tried some downloaded flows from this forum like “battery log, strom an, strom weg… . And here are the same results. All values of the variables are null (independent if i use battery level, battery health, battery percentage… )
Is it possible to upload the flow to give you more information?
Thanks,
Albatros
Re: variables returns null
Posted: 03 Aug 2015 14:13
by bogdyro
Yes. But since i'm not having this issue it may be device dependent. I have a HTC on lollipop.
Try the execute command way
Re: variables returns null
Posted: 03 Aug 2015 19:08
by Martin
Hi,
Maybe some typo in the variable names. Automagic is case sensitive so using Battery_percentage (upper case B) would show null.
Try to remove the action and add a condition Debug Dialog instead. The condition shows a list of all variables and the corresponding values when the flow is executed. Also ensure that the real trigger executes the flow and you do not manually execute the flow with menu->Execute/Ausführen since variables are not provided when executing manually.
Regards,
Martin
Re: variables returns null
Posted: 04 Aug 2015 03:57
by bogdyro
For testing purposes you can add a battery level condition and a debug dialog next, then trigger the flow manually and see what comes out. Works for me on 2 devices> sony tablet and htc phone, both lollipop
Re: variables returns null
Posted: 04 Aug 2015 15:28
by albatrosxl
Perfect. The hinter of Martin was the solution.next i will try that hinter regarding the debug Prozess.
Thumbs up
Re: variables returns null
Posted: 04 Aug 2015 16:57
by albatrosxl
Hi, i tried now the debug mose and all variables show NULL.
Thanks agäin for your help in this
Albatrosxl