Solved Time context in the form of time variable is not working

Discussion in 'Tasker' started by jarkd, Mar 2, 2019.

  1. jarkd

    jarkd New Member

    Joined:
    Feb 27, 2019
    Messages:
    4
    Likes Received:
    0
    Hello,
    I wanted to trigger an event based on the dynamically calculate time. However i run into the problem that the time event is not triggered correctly.
    I have input debug variables as below and this is a test run:
    upload_2019-3-2_14-32-28.png
    Red lines show incorrect matching. Green what i want to achieve when i trigger time context.
    T1 & T2 are 2 separate tasks above.
    Task T2 should be triggered via time context on the date setup in Task T1

    Am I getting something wrong?
    I'm on Samsung S9+ rooted custom ROM.

    Exported profile
    https://taskernet.com/shares/?user=AS35m8lXI8IEQQOGPGL/wSxnL3IkQjFjlEghmwvecQAQ4Wx+K3+3zNQq2ldtyxNjVLZGZY6S67gMtA==&id=Project:BatteryAlert

    And the profile itself:
    Profile: BatteryLifeAlert (55)
    State: Battery Level [ From:0 To:50 ]
    State: Not USB Connected [ Class:Any ]
    Enter: Anon (56)
    A1: Variable Add [ Name:%vol Value:%VOLM Wrap Around:0 ]
    A2: Media Volume [ Level:10 Display:Off Sound:Off ]
    A3: Music Play [ File:/system/media/audio/notifications/Robot.ogg Start:0 Loop:Off Stream:3 Continue Task Immediately:On ]
    A4: Wait [ MS:0 Seconds:3 Minutes:0 Hours:0 Days:0 ]
    A5: Media Volume [ Level:%vol Display:Off Sound:Off ]
    A6: Variable Set [ Name:%Battery1AlertPlayed To:1 Recurse Variables:Off Do Maths:Off Append:Off ]
    <DEBUG> A7: Variable Set [ Name:%CheckT1Date1 To:%TIMES Recurse Variables:Off Do Maths:On Append:Off ]
    <Next alarm setting>
    A8: Variable Set [ Name:%BatteryAlarmNextTime To:%TIMES+10 Recurse Variables:Off Do Maths:On Append:Off ]
    <DEBUG> A9: Variable Set [ Name:%CheckT1Date2 To:%BatteryAlarmNextTime Recurse Variables:Off Do Maths:On Append:Off ]
    A10: Flash [ Text:Battery alarm at %BATT% level Long:Off ]

    Profile: BatteryLifeAlertRepeat (86)
    Time: From %BatteryAlarmNextTime Till %BatteryAlarmNextTime
    State: Not USB Connected [ Class:Any ]
    State: Battery Level [ From:0 To:50 ]
    Enter: Anon (87)
    <DEBUG> A1: Variable Set [ Name:%CheckT2Date1 To:%TIMES Recurse Variables:Off Do Maths:On Append:Off ]
    A2: Variable Add [ Name:%vol Value:%VOLM Wrap Around:0 ]
    A3: Media Volume [ Level:10 Display:Off Sound:Off ]
    A4: Music Play [ File:/system/media/audio/notifications/Robot.ogg Start:0 Loop:Off Stream:3 Continue Task Immediately:On ]
    A5: Wait [ MS:0 Seconds:3 Minutes:0 Hours:0 Days:0 ]
    A6: Media Volume [ Level:%vol Display:Off Sound:Off ]
    <Next alarm setting>
    A7: Variable Set [ Name:%BatteryAlarmNextTime To:%TIMES+10 Recurse Variables:Off Do Maths:On Append:Off ]
    <DEBUG> A8: Variable Set [ Name:%CheckT2Date2 To:%BatteryAlarmNextTime Recurse Variables:Off Do Maths:On Append:Off ]
    A9: Flash [ Text:REPEATED! Battery alarm at %BATT% level Long:Off ]
     
    Last edited: Mar 2, 2019
  2. jarkd

    jarkd New Member

    Joined:
    Feb 27, 2019
    Messages:
    4
    Likes Received:
    0
    The issue is here:
    Variable Set [ Name:%BatteryAlarmNextTime To:%TIMES+10 Recurse Variables:Off Do Maths:On Append:Off ]

    The context is working based on full minutes only so either you must add minutes or use
     

Share This Page