[Tasker Tips & Tricks] CrashOverride93:
Hello everyone!

Here I bring you a profile plus it task, responsible to giving us the notice when our device reaches certain temperature.

The task I created analyzes data from three specific areas (thermal sensors) using the hwmon under the 'sys' folder, although it is also possible to read the information from 'thermal_zone' in sys/class/thermal. But this depends on our device, each phone is different. The profile & task bundle also include two scenes for each temperature warning (high and very high).

I've decided to create it because one day while I was playing Kandy Crash [don't judge me ;)] and I suddenly had to go, me, without realizing or thinking about what I have done, I forgot to close the game and turn off the screen (it was at 100% brightness which after a long time can become quite hot, increasing the overall device temperature a little faster), and if that was not enough, I left the smartphone under my coat. Well, after a while, about 10 minutes, I arrive, pick up the phone and OH MY GOD! It burned when I grabbed it.

Never before had this temperture, so I guess the temp will be exceeded in 75°C or 80°C at CPU, and 55°C in motherboard (I have tested it). While on the other hand, I wanted a profile that will alert me when the temperture is high but within some limits.

Before continuing, I have a doubt on the information provided by each temperature sensor.

To specify the temperature readings I use the files that I think are correct, although two of them I get into a mess and I'm not sure if I have selected the correct file to interpret data or not. Them are the 'bms' and 'tsens_tz_sensor1' sensors. With the first one guess I'm getting temperature reading of the device, but the strange thing is that it always is the same as the battery one. (at least on my device)

And on the other hand, hope I'm receiving the cpu information reading itself, instead of each core separately, which is what I don't want. Although if I wanted to get the temperature of the CPU also could get the temp of each core (4 in my case), then calculate the data of the CPU total temp doing the arithmetic calc. But that is not what I want. But if there is no other way...

PROFILES

(x1)

[COLOR="Blue"]Battery Temperature[/COLOR]
[U]State[/U]: Battery Temperature [ From:40.0 To:200.0 ]
[U]Time[/U]: Every 5m

TASKS

(x1)

[COLOR="Blue"]Device Temperature[/COLOR]
[U]A1[/U]: Show Scene [ Name:Temperature 2 Display As:Dialog, Dim Behind Horizontal Position:100 Vertical Position:92 Animation:System Show Exit Button : Off Continue Task Immediately : On ]
[U]A2[/U]: Read File [ File:/sys/class/hwmon/hwmon2/temp1_input To Var:%cpureadfile Continue Task After Error : On ]
[U]A3[/U]: Read File [ File:/sys/class/hwmon/hwmon7/temp1_input To Var:%bmsreadfile Continue Task After Error : On ]
[U]A4[/U]: Read File [ File:/sys/class/hwmon/hwmon8/temp1_input To Var:%battreadfile Continue Task After Error : On ]
[U]A5[/U]: Variable Section [ Name:%bmsreadfile From:1 Length:2 Adapt To Fit : Off Store Result In: ]
[U]A6[/U]: Variable Section [ Name:%battreadfile From:1 Length:3 Adapt To Fit : Off Store Result In: ]
[U]A7[/U]: If [ %cpureadfile > 75 | %bmsreadfile > 45 | %battreadfile > 425 ]
[U]A8[/U]: Show Scene [ Name:Temperature 1 Display As:Dialog, Dim Behind Horizontal Position:100 Vertical Position:92 Animation:System Show Exit Button : Off Continue Task Immediately : On ]
[U]A9[/U]: If [ %SILENT !~ vibrate/on & %INTERRUPT !~ none/priority ]
[U]A10[/U]: Variable Set [ Name:%volmultimedia To:%VOLM Do Maths:eek:ff Append : Off ]
[U]A11[/U]: Media Volume [ Level:15 Display : Off Sound : Off ]
[U]A12[/U]: Say [ Text:The device temperature is high, but does not represent significant damage. Proceed with caution. Engine:Voice:default:default Stream:3 Pitch:5 Speed:5 Respect Audio Focus : On Network : Off Continue Task Immediately : Off ]
[U]A13[/U]: Media Volume [ Level:%volmultimedia Display : Off Sound : Off ]
[U]A14[/U]: End If
[U]A15[/U]: End If
[U]A16[/U]: If [ %cpureadfile > 82 | %bmsreadfile > 50 | %battreadfile > 475 ]
[U]A17[/U]: Show Scene [ Name:Temperature 2 Display As:Dialog, Dim Behind Horizontal Position:100 Vertical Position:92 Animation:System Show Exit Button : Off Continue Task Immediately : On ]
[U]A18[/U]: If [ %SILENT !~ vibrate/on & %INTERRUPT !~ none/priority ]
[U]A19[/U]: Variable Set [ Name:%volmultimedia To:%VOLM Do Maths : Off Append : Off ]
[U]A20[/U]: Media Volume [ Level:15 Display : Off Sound : Off ]
[U]A21[/U]: Say [ Text:The device temperature is too high. It will automatically shutdown in 15 seconds. Engine:Voice:default:default Stream:3 Pitch:5 Speed:5 Respect Audio Focus : On Network : Off Continue Task Immediately : Off ]
[U]A22[/U]: Media Volume [ Level:%volmultimedia Display : Off Sound : Off ]
[U]A23[/U]: End If
[U]A24[/U]: Wait [ MS:0 Seconds:15 Minutes:0 Hours:0 Days:0 ]
[U]A25[/U]: Secure Settings [ Configuration:Shutdown Timeout (Seconds):0 ]
[U]A26[/U]: End If

SCENES

(x2)

[B]Temperature 1[/B]
-----------------------------------------------
[COLOR="Blue"]Accept Button[/COLOR]
[U]A1[/U]: Destroy Scene [ Name:Temperature 1 ]

[B]Temperature 2[/B]
-----------------------------------------------
[COLOR="Blue"]Accept Button[/COLOR]
[U]A1[/U]: Destroy Scene [ Name:Temperature 2 ]

SCREENSHOTS

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _​

ABOUT THE PROJECT

Â· There are available two ways by you can import the project (profiles, tasks, scenes). One is by just importing it using the file on "projects" folder, it will import the whole project at once; the other, by importing it "part-by-part". The 'Files' folder (if included) have to be ALWAYS copied to Tasker directory.

Â· All scenes are adjusted to work on 1280x720 device (LG K10). You'll have to resize them to fit it on yours.

Â· Almost all devices have an 'offset' in its thermal control files (thermal-engine-XXXX.conf or other) responsible for actions like: lowering the frequency of the CPU and/or GPU, changing the screen brightness, etc, to try to lower the temperature when some of these areas reaches the set value. So, as I have changed the paramaters on there, means that the device won't never lower its temperature automatically, and I have made this task for that. Be warned by my device if it reaches a certain temperature. And just for clarify: why did you edited the thermal-zone file? = I don't want the CPU, GPU and display brightness get slower/lower never, so I have made it to have the maximum performance all the time.

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _​

My Tasker PROJECTS & TASKS

--> [PROJECT] Android TTS Assistant (interactive & multilingual)

--> [PROJECT] Anti-Theft System

--> [PROJECT] Automate all your backup tasks

--> [PROJECT] Call Recorder

--> [TASK] Auto-Switch Keyboard(s)

--> [TASK] Talking Clock

Tasker Chat Groups

--> Tasker on WhatsApp

--> Tasker on Telegram

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

If you liked the project. . .

. . . and you decide to invite me to a coffee, I would be very greatful to you ;P

Account

: ceedcv@outlook.com