SmartPhoneLover
27/07/18, 15:42:56
Aquí os traigo un pequeño proyecto para estar al tanto del estado de nuestra bateria al momento de cargala, como también al usarla (no conectada a la corriente). Y funciona sin root, ya que no necesita leer el valor en crudo directamente de los archivos localizados en /sys/class/power_supply.
Dos son los modos en los que funciona: automático, activándose al detectar inicio de carga; y manual, si queremos conocer alguna medición de manera puntual, haciendo uso de un "Quick Settings Tile" (AutoNotification requerido) en Android Nougat.
Y estos son los datos que nos proporcionará mediante una notificación permanente en barra de estado:
· Porcentaje de bateria (%)
· Temperatura actual (ºC)
· Voltaje (V)
· Carga/Suministro en miliamperios hora (mAh)
· Tipo de conexión, si existe (AC, USB, Wireless)
· Tiempo total aproximado de carga/descarga (TESTING)
Para descarga los XMLs actualizados, click aquí (https://drive.google.com/drive/folders/1EqVs5yS8aUYJtqsZoAeIVkpiTAZ_V8O6?usp=sharing). Y para ver mis otros aportes, click aquí (https://drive.google.com/drive/folders/1p3zOuXMuor2xLIwZi06MXHk0zJg8okgP?usp=sharing).
-PRINCIPAL-
Profile: X - Conexión Dispositivo
State: Power [ Source:Any ]
Enter: X - Monitor Bateria (on)
A1: Java Function [ Return:(BatteryManager) temp Class Or Object:CONTEXT Function:getSystemService
{Object} (String) Param:batterymanager Param: Param: Param: Param: Param: Param: ]
<Porcentaje Bateria (%)>
A2: Java Function [ Return:%temp1 Class Or Object:temp Function:getIntProperty
{int} (int) Param:4 Param: Param: Param: Param: Param: Param: ]
<Miliamperios Hora (mAh)>
A3: Java Function [ Return:%temp2 Class Or Object:temp Function:getIntProperty
{int} (int) Param:2 Param: Param: Param: Param: Param: Param: ]
A4: Variable Set [ Name:%temp2 To:abs(%temp2) Recurse Variables:Off Do Maths:On Append:Off ]
A5: Variable Set [ Name:%temp2 To:round((%temp2)/1000) Recurse Variables:Off Do Maths:On Append:Off ]
A6: Variable Set [ Name:%temp2x To:%temp2 Recurse Variables:Off Do Maths:Off Append:Off ]
A7: Variable Set [ Name:%temp2 To:-%temp2 Recurse Variables:Off Do Maths:Off Append:Off ]
<Tiempo Descarga>
A8: Variable Set [ Name:%temp3 To:round((((2300 / 100) * %temp1) / %temp2x) * 60) Recurse Variables:Off Do Maths:On Append:Off ]
A9: If [ %temp3 > 1439 ]
A10: Variable Set [ Name:%temp31 To:floor(%temp3 / (24 * 60)) Recurse Variables:Off Do Maths:On Append:Off ]
A11: Variable Set [ Name:%temp32 To:floor((%temp3 % (24 * 60)) / 60) Recurse Variables:Off Do Maths:On Append:Off ]
A12: Variable Set [ Name:%temp33 To:floor((%temp3 % (24 * 60)) % 60) Recurse Variables:Off Do Maths:On Append:Off ]
A13: Variable Set [ Name:%temp3 To:~ %temp31 d %temp32 h %temp33 m Recurse Variables:Off Do Maths:Off Append:Off ]
A14: Else If [ %temp3 > 60 & %temp3 < 1440 ]
A15: Variable Set [ Name:%temp31 To:floor(%temp3 / 60) Recurse Variables:Off Do Maths:On Append:Off ]
A16: Variable Set [ Name:%temp32 To:%temp3 % 60 Recurse Variables:Off Do Maths:On Append:Off ]
A17: Variable Set [ Name:%temp3 To:~ %temp31 h %temp32 m Recurse Variables:Off Do Maths:Off Append:Off ]
A18: Else
A19: Variable Set [ Name:%temp3 To:~ %temp3 m Recurse Variables:Off Do Maths:Off Append:Off ]
A20: End If
A21: Notify [ Title:Monitor Bateria Text:%temp1 % • - - °C • - - V • %temp2 mAh • - - • %temp3 Icon:mw_device_battery_unknown Number:0 Permanent:On Priority:5 ]
A22: Profile Status [ Name:X - Intent (estado bateria) Set:On ]
Exit: X - Monitor Bateria (off)
A1: Profile Status [ Name:X - Intent (estado bateria) Set:Off ]
A2: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
A3: Notify Cancel [ Title:Monitor Bateria Warn Not Exist:Off ]Profile: X - Intent (estado bateria)
Event: Intent Received [ Action:android.intent.action.BATTERY_CHANGED Cat:None Cat:None Scheme:* Mime Type:* Stop Event: On ]
Enter: X - Monitor Bateria
A1: Java Function [ Return:(BatteryManager) temp Class Or Object:CONTEXT Function:getSystemService
{Object} (String) Param:batterymanager Param: Param: Param: Param: Param: Param: ]
A2: If [ %plugged ~ 0 ]
<Porcentaje Bateria (%)>
A3: Java Function [ Return:%temp1 Class Or Object:temp Function:getIntProperty
{int} (int) Param:4 Param: Param: Param: Param: Param: Param: ]
<Temperatura (°C)>
A4: Variable Set [ Name:%temp2 To:%temperature * 0.1 Recurse Variables:Off Do Maths:On Append:Off ]
<Voltaje (V)>
A5: Variable Set [ Name:%temp3 To:%voltage * 0.001 Recurse Variables:Off Do Maths:On Append:Off ]
<Miliamperios Hora (mAh)>
A6: Java Function [ Return:%temp4 Class Or Object:temp Function:getIntProperty
{int} (int) Param:2 Param: Param: Param: Param: Param: Param: ]
A7: Variable Set [ Name:%temp4 To:abs(%temp4) Recurse Variables:Off Do Maths:On Append:Off ]
A8: Variable Set [ Name:%temp4 To:round(%temp4 / 1000) Recurse Variables:Off Do Maths:On Append:Off ]
A9: Variable Set [ Name:%temp4x To:%temp4 Recurse Variables:Off Do Maths:Off Append:Off ]
A10: Variable Set [ Name:%temp4 To:-%temp4 Recurse Variables:Off Do Maths:Off Append:Off ]
<Tipo Conexión>
A11: Variable Set [ Name:%temp5 To:N/A Recurse Variables:Off Do Maths:Off Append:Off ]
<Tiempo Descarga>
A12: Variable Set [ Name:%temp6 To:round((((2300 / 100) * %temp1) / %temp4x) * 60) Recurse Variables:Off Do Maths:On Append:Off ]
A13: If [ %temp6 > 1439 ]
A14: Variable Set [ Name:%temp61 To:floor(%temp6 / (24 * 60)) Recurse Variables:Off Do Maths:On Append:Off ]
A15: Variable Set [ Name:%temp62 To:floor((%temp6 % (24 * 60)) / 60) Recurse Variables:Off Do Maths:On Append:Off ]
A16: Variable Set [ Name:%temp63 To:floor((%temp6 % (24 * 60)) % 60) Recurse Variables:Off Do Maths:On Append:Off ]
A17: Variable Set [ Name:%temp6 To:~ %temp61 d %temp62 h %temp63 m Recurse Variables:Off Do Maths:Off Append:Off ]
A18: Else If [ %temp6 > 60 & %temp6 < 1440 ]
A19: Variable Set [ Name:%temp61 To:floor(%temp6 / 60) Recurse Variables:Off Do Maths:On Append:Off ]
A20: Variable Set [ Name:%temp62 To:%temp6 % 60 Recurse Variables:Off Do Maths:On Append:Off ]
A21: Variable Set [ Name:%temp6 To:~ %temp61 h %temp62 m Recurse Variables:Off Do Maths:Off Append:Off ]
A22: Else
A23: Variable Set [ Name:%temp6 To:~ %temp6 m Recurse Variables:Off Do Maths:Off Append:Off ]
A24: End If
A25: Else
<Porcentaje Bateria (%)>
A26: Java Function [ Return:%temp1 Class Or Object:temp Function:getIntProperty
{int} (int) Param:4 Param: Param: Param: Param: Param: Param: ]
<Temperatura (°C)>
A27: Variable Set [ Name:%temp2 To:%temperature * 0.1 Recurse Variables:Off Do Maths:On Append:Off ]
<Voltaje (V)>
A28: Variable Set [ Name:%temp3 To:%voltage * 0.001 Recurse Variables:Off Do Maths:On Append:Off ]
<Miliamperios Hora (mAh)>
A29: Java Function [ Return:%temp4 Class Or Object:temp Function:getIntProperty
{int} (int) Param:2 Param: Param: Param: Param: Param: Param: ]
A30: Variable Set [ Name:%temp4 To:abs(%temp4) Recurse Variables:Off Do Maths:On Append:Off ]
A31: Variable Set [ Name:%temp4 To:round(%temp4 / 1000) Recurse Variables:Off Do Maths:On Append:Off ]
<Tipo Conexión>
A32: Variable Set [ Name:%temp5 To:AC Recurse Variables:Off Do Maths:Off Append:Off ] If [ %plugged ~ 1 ]
A33: Variable Set [ Name:%temp5 To:USB Recurse Variables:Off Do Maths:Off Append:Off ] If [ %plugged ~ 2 ]
A34: Variable Set [ Name:%temp5 To:WIRELESS Recurse Variables:Off Do Maths:Off Append:Off ] If [ %plugged ~ 4 ]
<Tiempo Carga>
A35: Variable Set [ Name:%temp6 To:round(((2300 - ((2300 / 100) * %temp1)) / %temp4) * 60) Recurse Variables:Off Do Maths:On Append:Off ]
A36: If [ %temp6 > 1439 ]
A37: Variable Set [ Name:%temp61 To:floor(%temp6 / (24 * 60)) Recurse Variables:Off Do Maths:On Append:Off ]
A38: Variable Set [ Name:%temp62 To:floor((%temp6 % (24 * 60)) / 60) Recurse Variables:Off Do Maths:On Append:Off ]
A39: Variable Set [ Name:%temp63 To:floor((%temp6 % (24 * 60)) % 60) Recurse Variables:Off Do Maths:On Append:Off ]
A40: Variable Set [ Name:%temp6 To:~ %temp61 d %temp62 h %temp63 m Recurse Variables:Off Do Maths:Off Append:Off ]
A41: Else If [ %temp6 > 60 & %temp6 < 1440 ]
A42: Variable Set [ Name:%temp61 To:floor(%temp6 / 60) Recurse Variables:Off Do Maths:On Append:Off ]
A43: Variable Set [ Name:%temp62 To:%temp6 % 60 Recurse Variables:Off Do Maths:On Append:Off ]
A44: Variable Set [ Name:%temp6 To:~ %temp61 h %temp62 m Recurse Variables:Off Do Maths:Off Append:Off ]
A45: Else If [ %temp6 = 0 ]
A46: Variable Set [ Name:%temp6 To:¡CARGADA! Recurse Variables:Off Do Maths:Off Append:Off ]
A47: Else
A48: Variable Set [ Name:%temp6 To:~ %temp6 m Recurse Variables:Off Do Maths:Off Append:Off ]
A49: End If
A50: End If
A51: Notify [ Title:Monitor Bateria Text:%temp1 % • %temp2 °C • %temp3 V • %temp4 mAh • %temp5 • %temp6 Icon:mw_device_battery_unknown Number:0 Permanent:On Priority:5 ] -OPCIONAL- (quick setting tile)
Profile: QS - Monitor Bateria
Event: com.joaomgcd.autonotification.activity.ActivityCon figConditionTaskerEvent [ Configuration:Event Behaviour
Filter: battery=:= ]
Enter: QS - Quick Settings Tiles
<Monitor Bateria>
A1: If [ %ancomm ~ battery ]
A2: If [ %QS_tile4 ~ 0 ]
A3: *Unknown Plugin* [ Configuration:Tile: AutoNotification 4
Command: battery=:=battery
Label: Monitor Bateria
Icon: /storage/emulated/0/Tasker/Resources/Quick Settings Tiles/battery.png
State: Active Timeout (Seconds):60 ]
A4: Perform Task [ Name:X - Monitor Bateria (on) Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]
A5: Variable Set [ Name:%QS_tile4 To:1 Recurse Variables:Off Do Maths:Off Append:Off ]
A6: Stop [ With Error:Off Task: ]
A7: Else If [ %QS_tile4 ~ 1 ]
A8: *Unknown Plugin* [ Configuration:Tile: AutoNotification 4
Command: battery=:=battery
Label: Monitor Bateria
Icon: /storage/emulated/0/Tasker/Resources/Quick Settings Tiles/battery.png
State: Inactive Timeout (Seconds):60 ]
A9: Perform Task [ Name:X - Monitor Bateria (off) Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]
A10: Variable Set [ Name:%QS_tile4 To:0 Recurse Variables:Off Do Maths:Off Append:Off ]
A11: End If
A12: End IfNotas:
- En las acciones referidas al control del proyecto mediante el Quick Tile hacen referencia todos a '4', tanto en variables, como en nº de baldosa, porque tengo otros configurados.
- Al momento de la conexión, o de activación manual es normal que quizás no aparezcan algunos de los valores actualizados, o establecidos durante los primeros segundos, o quizás minutos. Eso es debido a que Tasker debe esperar a que el intent recoja todos los datos correspondientes. (por ello he modificado las tareas para que aquellos valores sin valor alguno, aparezcan como '- - x')
- En las tareas 'X - Monitor Bateria' y 'X - Monitor Bateria (on)' hará falta ajustar el valor '2300' por la cantidad de mAh que tenga nuestra bateria de serie.
Dos son los modos en los que funciona: automático, activándose al detectar inicio de carga; y manual, si queremos conocer alguna medición de manera puntual, haciendo uso de un "Quick Settings Tile" (AutoNotification requerido) en Android Nougat.
Y estos son los datos que nos proporcionará mediante una notificación permanente en barra de estado:
· Porcentaje de bateria (%)
· Temperatura actual (ºC)
· Voltaje (V)
· Carga/Suministro en miliamperios hora (mAh)
· Tipo de conexión, si existe (AC, USB, Wireless)
· Tiempo total aproximado de carga/descarga (TESTING)
Para descarga los XMLs actualizados, click aquí (https://drive.google.com/drive/folders/1EqVs5yS8aUYJtqsZoAeIVkpiTAZ_V8O6?usp=sharing). Y para ver mis otros aportes, click aquí (https://drive.google.com/drive/folders/1p3zOuXMuor2xLIwZi06MXHk0zJg8okgP?usp=sharing).
-PRINCIPAL-
Profile: X - Conexión Dispositivo
State: Power [ Source:Any ]
Enter: X - Monitor Bateria (on)
A1: Java Function [ Return:(BatteryManager) temp Class Or Object:CONTEXT Function:getSystemService
{Object} (String) Param:batterymanager Param: Param: Param: Param: Param: Param: ]
<Porcentaje Bateria (%)>
A2: Java Function [ Return:%temp1 Class Or Object:temp Function:getIntProperty
{int} (int) Param:4 Param: Param: Param: Param: Param: Param: ]
<Miliamperios Hora (mAh)>
A3: Java Function [ Return:%temp2 Class Or Object:temp Function:getIntProperty
{int} (int) Param:2 Param: Param: Param: Param: Param: Param: ]
A4: Variable Set [ Name:%temp2 To:abs(%temp2) Recurse Variables:Off Do Maths:On Append:Off ]
A5: Variable Set [ Name:%temp2 To:round((%temp2)/1000) Recurse Variables:Off Do Maths:On Append:Off ]
A6: Variable Set [ Name:%temp2x To:%temp2 Recurse Variables:Off Do Maths:Off Append:Off ]
A7: Variable Set [ Name:%temp2 To:-%temp2 Recurse Variables:Off Do Maths:Off Append:Off ]
<Tiempo Descarga>
A8: Variable Set [ Name:%temp3 To:round((((2300 / 100) * %temp1) / %temp2x) * 60) Recurse Variables:Off Do Maths:On Append:Off ]
A9: If [ %temp3 > 1439 ]
A10: Variable Set [ Name:%temp31 To:floor(%temp3 / (24 * 60)) Recurse Variables:Off Do Maths:On Append:Off ]
A11: Variable Set [ Name:%temp32 To:floor((%temp3 % (24 * 60)) / 60) Recurse Variables:Off Do Maths:On Append:Off ]
A12: Variable Set [ Name:%temp33 To:floor((%temp3 % (24 * 60)) % 60) Recurse Variables:Off Do Maths:On Append:Off ]
A13: Variable Set [ Name:%temp3 To:~ %temp31 d %temp32 h %temp33 m Recurse Variables:Off Do Maths:Off Append:Off ]
A14: Else If [ %temp3 > 60 & %temp3 < 1440 ]
A15: Variable Set [ Name:%temp31 To:floor(%temp3 / 60) Recurse Variables:Off Do Maths:On Append:Off ]
A16: Variable Set [ Name:%temp32 To:%temp3 % 60 Recurse Variables:Off Do Maths:On Append:Off ]
A17: Variable Set [ Name:%temp3 To:~ %temp31 h %temp32 m Recurse Variables:Off Do Maths:Off Append:Off ]
A18: Else
A19: Variable Set [ Name:%temp3 To:~ %temp3 m Recurse Variables:Off Do Maths:Off Append:Off ]
A20: End If
A21: Notify [ Title:Monitor Bateria Text:%temp1 % • - - °C • - - V • %temp2 mAh • - - • %temp3 Icon:mw_device_battery_unknown Number:0 Permanent:On Priority:5 ]
A22: Profile Status [ Name:X - Intent (estado bateria) Set:On ]
Exit: X - Monitor Bateria (off)
A1: Profile Status [ Name:X - Intent (estado bateria) Set:Off ]
A2: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
A3: Notify Cancel [ Title:Monitor Bateria Warn Not Exist:Off ]Profile: X - Intent (estado bateria)
Event: Intent Received [ Action:android.intent.action.BATTERY_CHANGED Cat:None Cat:None Scheme:* Mime Type:* Stop Event: On ]
Enter: X - Monitor Bateria
A1: Java Function [ Return:(BatteryManager) temp Class Or Object:CONTEXT Function:getSystemService
{Object} (String) Param:batterymanager Param: Param: Param: Param: Param: Param: ]
A2: If [ %plugged ~ 0 ]
<Porcentaje Bateria (%)>
A3: Java Function [ Return:%temp1 Class Or Object:temp Function:getIntProperty
{int} (int) Param:4 Param: Param: Param: Param: Param: Param: ]
<Temperatura (°C)>
A4: Variable Set [ Name:%temp2 To:%temperature * 0.1 Recurse Variables:Off Do Maths:On Append:Off ]
<Voltaje (V)>
A5: Variable Set [ Name:%temp3 To:%voltage * 0.001 Recurse Variables:Off Do Maths:On Append:Off ]
<Miliamperios Hora (mAh)>
A6: Java Function [ Return:%temp4 Class Or Object:temp Function:getIntProperty
{int} (int) Param:2 Param: Param: Param: Param: Param: Param: ]
A7: Variable Set [ Name:%temp4 To:abs(%temp4) Recurse Variables:Off Do Maths:On Append:Off ]
A8: Variable Set [ Name:%temp4 To:round(%temp4 / 1000) Recurse Variables:Off Do Maths:On Append:Off ]
A9: Variable Set [ Name:%temp4x To:%temp4 Recurse Variables:Off Do Maths:Off Append:Off ]
A10: Variable Set [ Name:%temp4 To:-%temp4 Recurse Variables:Off Do Maths:Off Append:Off ]
<Tipo Conexión>
A11: Variable Set [ Name:%temp5 To:N/A Recurse Variables:Off Do Maths:Off Append:Off ]
<Tiempo Descarga>
A12: Variable Set [ Name:%temp6 To:round((((2300 / 100) * %temp1) / %temp4x) * 60) Recurse Variables:Off Do Maths:On Append:Off ]
A13: If [ %temp6 > 1439 ]
A14: Variable Set [ Name:%temp61 To:floor(%temp6 / (24 * 60)) Recurse Variables:Off Do Maths:On Append:Off ]
A15: Variable Set [ Name:%temp62 To:floor((%temp6 % (24 * 60)) / 60) Recurse Variables:Off Do Maths:On Append:Off ]
A16: Variable Set [ Name:%temp63 To:floor((%temp6 % (24 * 60)) % 60) Recurse Variables:Off Do Maths:On Append:Off ]
A17: Variable Set [ Name:%temp6 To:~ %temp61 d %temp62 h %temp63 m Recurse Variables:Off Do Maths:Off Append:Off ]
A18: Else If [ %temp6 > 60 & %temp6 < 1440 ]
A19: Variable Set [ Name:%temp61 To:floor(%temp6 / 60) Recurse Variables:Off Do Maths:On Append:Off ]
A20: Variable Set [ Name:%temp62 To:%temp6 % 60 Recurse Variables:Off Do Maths:On Append:Off ]
A21: Variable Set [ Name:%temp6 To:~ %temp61 h %temp62 m Recurse Variables:Off Do Maths:Off Append:Off ]
A22: Else
A23: Variable Set [ Name:%temp6 To:~ %temp6 m Recurse Variables:Off Do Maths:Off Append:Off ]
A24: End If
A25: Else
<Porcentaje Bateria (%)>
A26: Java Function [ Return:%temp1 Class Or Object:temp Function:getIntProperty
{int} (int) Param:4 Param: Param: Param: Param: Param: Param: ]
<Temperatura (°C)>
A27: Variable Set [ Name:%temp2 To:%temperature * 0.1 Recurse Variables:Off Do Maths:On Append:Off ]
<Voltaje (V)>
A28: Variable Set [ Name:%temp3 To:%voltage * 0.001 Recurse Variables:Off Do Maths:On Append:Off ]
<Miliamperios Hora (mAh)>
A29: Java Function [ Return:%temp4 Class Or Object:temp Function:getIntProperty
{int} (int) Param:2 Param: Param: Param: Param: Param: Param: ]
A30: Variable Set [ Name:%temp4 To:abs(%temp4) Recurse Variables:Off Do Maths:On Append:Off ]
A31: Variable Set [ Name:%temp4 To:round(%temp4 / 1000) Recurse Variables:Off Do Maths:On Append:Off ]
<Tipo Conexión>
A32: Variable Set [ Name:%temp5 To:AC Recurse Variables:Off Do Maths:Off Append:Off ] If [ %plugged ~ 1 ]
A33: Variable Set [ Name:%temp5 To:USB Recurse Variables:Off Do Maths:Off Append:Off ] If [ %plugged ~ 2 ]
A34: Variable Set [ Name:%temp5 To:WIRELESS Recurse Variables:Off Do Maths:Off Append:Off ] If [ %plugged ~ 4 ]
<Tiempo Carga>
A35: Variable Set [ Name:%temp6 To:round(((2300 - ((2300 / 100) * %temp1)) / %temp4) * 60) Recurse Variables:Off Do Maths:On Append:Off ]
A36: If [ %temp6 > 1439 ]
A37: Variable Set [ Name:%temp61 To:floor(%temp6 / (24 * 60)) Recurse Variables:Off Do Maths:On Append:Off ]
A38: Variable Set [ Name:%temp62 To:floor((%temp6 % (24 * 60)) / 60) Recurse Variables:Off Do Maths:On Append:Off ]
A39: Variable Set [ Name:%temp63 To:floor((%temp6 % (24 * 60)) % 60) Recurse Variables:Off Do Maths:On Append:Off ]
A40: Variable Set [ Name:%temp6 To:~ %temp61 d %temp62 h %temp63 m Recurse Variables:Off Do Maths:Off Append:Off ]
A41: Else If [ %temp6 > 60 & %temp6 < 1440 ]
A42: Variable Set [ Name:%temp61 To:floor(%temp6 / 60) Recurse Variables:Off Do Maths:On Append:Off ]
A43: Variable Set [ Name:%temp62 To:%temp6 % 60 Recurse Variables:Off Do Maths:On Append:Off ]
A44: Variable Set [ Name:%temp6 To:~ %temp61 h %temp62 m Recurse Variables:Off Do Maths:Off Append:Off ]
A45: Else If [ %temp6 = 0 ]
A46: Variable Set [ Name:%temp6 To:¡CARGADA! Recurse Variables:Off Do Maths:Off Append:Off ]
A47: Else
A48: Variable Set [ Name:%temp6 To:~ %temp6 m Recurse Variables:Off Do Maths:Off Append:Off ]
A49: End If
A50: End If
A51: Notify [ Title:Monitor Bateria Text:%temp1 % • %temp2 °C • %temp3 V • %temp4 mAh • %temp5 • %temp6 Icon:mw_device_battery_unknown Number:0 Permanent:On Priority:5 ] -OPCIONAL- (quick setting tile)
Profile: QS - Monitor Bateria
Event: com.joaomgcd.autonotification.activity.ActivityCon figConditionTaskerEvent [ Configuration:Event Behaviour
Filter: battery=:= ]
Enter: QS - Quick Settings Tiles
<Monitor Bateria>
A1: If [ %ancomm ~ battery ]
A2: If [ %QS_tile4 ~ 0 ]
A3: *Unknown Plugin* [ Configuration:Tile: AutoNotification 4
Command: battery=:=battery
Label: Monitor Bateria
Icon: /storage/emulated/0/Tasker/Resources/Quick Settings Tiles/battery.png
State: Active Timeout (Seconds):60 ]
A4: Perform Task [ Name:X - Monitor Bateria (on) Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]
A5: Variable Set [ Name:%QS_tile4 To:1 Recurse Variables:Off Do Maths:Off Append:Off ]
A6: Stop [ With Error:Off Task: ]
A7: Else If [ %QS_tile4 ~ 1 ]
A8: *Unknown Plugin* [ Configuration:Tile: AutoNotification 4
Command: battery=:=battery
Label: Monitor Bateria
Icon: /storage/emulated/0/Tasker/Resources/Quick Settings Tiles/battery.png
State: Inactive Timeout (Seconds):60 ]
A9: Perform Task [ Name:X - Monitor Bateria (off) Priority:%priority Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]
A10: Variable Set [ Name:%QS_tile4 To:0 Recurse Variables:Off Do Maths:Off Append:Off ]
A11: End If
A12: End IfNotas:
- En las acciones referidas al control del proyecto mediante el Quick Tile hacen referencia todos a '4', tanto en variables, como en nº de baldosa, porque tengo otros configurados.
- Al momento de la conexión, o de activación manual es normal que quizás no aparezcan algunos de los valores actualizados, o establecidos durante los primeros segundos, o quizás minutos. Eso es debido a que Tasker debe esperar a que el intent recoja todos los datos correspondientes. (por ello he modificado las tareas para que aquellos valores sin valor alguno, aparezcan como '- - x')
- En las tareas 'X - Monitor Bateria' y 'X - Monitor Bateria (on)' hará falta ajustar el valor '2300' por la cantidad de mAh que tenga nuestra bateria de serie.