AutoWeb Google Calendar events to notification bar.

Discussion in 'AutoApps' started by Shaun Wray, Nov 13, 2017.

  1. Shaun Wray

    Shaun Wray New Member

    Joined:
    Dec 16, 2015
    Messages:
    20
    Likes Received:
    3
    Hello,
    I'm trying to grab today's Google calendar events as well as tomorrow's and place them in my notifications using AutoNotification.
    Regarding the Google calendar query..is AutoWeb a good route to take for this endeavor?
    I want a time based profile to run at 7 am to trigger the calendar query. Though just not sure of the task settings I'll need. The AutoNotification side of this project I've got a good handle on..just the grabbing of the calendar events is giving me trouble.
    Any ideas would be a great help.
    Shaun
     
    edukardo likes this.
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Yes, AutoWeb should be able to handle that I think :) I haven't used the Google Calendar API much yet, but I think it should be able to query events for today...
     
  3. Shaun Wray

    Shaun Wray New Member

    Joined:
    Dec 16, 2015
    Messages:
    20
    Likes Received:
    3
    Joao,
    Excellent, thank you for your reply..I appreciate that.
    I run a task with the AutoWeb plugin and this is my result. Curious what your thoughts are on it..and what I may be missing.

    09.19.43/ActionArgBundle key: JoinOutputArray: replace <null> String value with null
    09.19.43/E FIRE PLUGIN: AutoWeb Web Service / com.twofortyfouram.locale.intent.action.FIRE_SETTING: 14 bundle keys
    09.19.43/E AutoWeb Web Service: plugin comp: com.joaomgcd.autoweb/com.joaomgcd.autoweb.broadcastreceiver.BroadcastReceiverFire
    09.19.43/E add wait type Plugin1 time 120
    09.19.43/E add wait type Plugin1 done
    09.19.43/E add wait task
    09.19.43/E Error: 1180823888
    09.19.43/E { "error": { "errors": [ { "domain": "global", "reason": "notFound", "message": "Not Found" } ], "code": 404, "message": "Not Found" }}

    In the meantime I'll keep messing around with it.
    Thanks so much.
    Shaun
     
  4. Shaun Wray

    Shaun Wray New Member

    Joined:
    Dec 16, 2015
    Messages:
    20
    Likes Received:
    3
    More info..
    If I remove one of the Calender ID's..then it works. Perhaps I'm using the wrong syntax when adding the second calendar id (my wife's email - our calendars are synched ).
     
  5. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Can you please export your task's description (not xml) so I can take a look? Long-click the task in Tasker->export description Thanks in advance
     
  6. Shaun Wray

    Shaun Wray New Member

    Joined:
    Dec 16, 2015
    Messages:
    20
    Likes Received:
    3
    Joao,

    Calendar Array (25)
    A1: Variable Set [ Name:%items_description To:0 Recurse Variables:Off Do Maths:Off Append:Off ]
    A2: Variable Set [ Name:%count To:1 Recurse Variables:Off Do Maths:Off Append:Off ]
    A3: AutoWeb Authentication [ Configuration:Web Service: Google Calendar Timeout (Seconds):60 ]
    A4: AutoWeb Web Service [ Configuration:API: Google Calendar
    API Action: List Events
    Calendar ID: (myemailaccountname)@Gmail.com
    Time Min: 2017-11-11T06:00:00Z
    Time Max: 2017-11-15T22:00:00Z
    Single events: false Timeout (Seconds):120 ]
    A5: Flash [ Text:%items_description(#) %count %location(1) %location(#) %description Long:On ]
    A6: Variable Set [ Name:%count To:%count+1 Recurse Variables:Off Do Maths:On Append:Off ]
    A7: Goto [ Type:Action Number Number:4 Label: ] If [ %count < 4 ]
    A8: Variable Set [ Name:%count To:1 Recurse Variables:Off Do Maths:Off Append:Off ]
    A9: Write File [ File:Tasker/projects/calendarsw.txt Text:%items_description(%count)
    %location(%count) Append:On Add Newline:On ]
    A10: Variable Set [ Name:%count To:%count+1 Recurse Variables:Off Do Maths:On Append:Off ]
    A11: Goto [ Type:Action Number Number:10 Label: ] If [ %count < 4 ]
    -----
    Only the location of the first entry is being returned..the description will not appear at all. Do I even need to loop the query or is an array returned under '%items_description'?
    Thanks for taking a look at it. I'm in time zone -10:00 but it only worked when I replaced with the 'Z'.
     
  7. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Can you let me know how much items are reported to exist in A5?
     
  8. Shaun Wray

    Shaun Wray New Member

    Joined:
    Dec 16, 2015
    Messages:
    20
    Likes Received:
    3
    0, 1 (then 2 then 3), (the correct location for the first event on the queried date - stored as %location(1)), 1, %description

    %items_description(#) - remains '0'
    %count - correctly has values of 1, 2, then 3
    %location(1) - as expected, remains as the correct location for the first event
    %location(#) - remains '1'
    %description - remains as '%description'

    Shaun.
     
  9. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Can you please enable system logs in AutoWeb and check what the service returns when you call it? Thanks in advance!
     
  10. Shaun Wray

    Shaun Wray New Member

    Joined:
    Dec 16, 2015
    Messages:
    20
    Likes Received:
    3
    I will absolutely do that ..in the morning! Haha ..thanks! I'll let you know what I find.
     
  11. Shaun Wray

    Shaun Wray New Member

    Joined:
    Dec 16, 2015
    Messages:
    20
    Likes Received:
    3
    This is what was returned .
     

    Attached Files:

  12. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Sorry can you please export the full logs with the copy button on the top right? Thanks!
     
  13. Shaun Wray

    Shaun Wray New Member

    Joined:
    Dec 16, 2015
    Messages:
    20
    Likes Received:
    3
    If you can erase that after...
     
  14. Shaun Wray

    Shaun Wray New Member

    Joined:
    Dec 16, 2015
    Messages:
    20
    Likes Received:
    3
    I tried a simplified version of this task and I got it to work (partially). I call for items summary and I get the desired results however it won't return events that are ..
    1. Repeated (my work days repeat on a regularly defined schedule.)
    2. Under my wife's email (our calendars are synched. Events she puts in aren't returned by this task. Even if I put her email in as the calendar ID..then an error results. Presumably because the task is running into ownership / authentication issues trying to retrieve events that I personally didn't put in.)
     
  15. Shaun Wray

    Shaun Wray New Member

    Joined:
    Dec 16, 2015
    Messages:
    20
    Likes Received:
    3
    I got this to work perfectly. Though I'd still like to fix my AutoWeb..your plugins are first rate.
     

    Attached Files:

  16. Shaun Wray

    Shaun Wray New Member

    Joined:
    Dec 16, 2015
    Messages:
    20
    Likes Received:
    3
    Calendar This Works (70)
    A1: Variable Set [ Name:%Timeseclow To:%TIMES Recurse Variables:Off Do Maths:Off Append:Off ]
    A2: Variable Set [ Name:%Timelow To:%TIME Recurse Variables:Off Do Maths:Off Append:Off ]
    A3: Variable Split [ Name:%Timelow Splitter:. Delete Base:Off ]
    A4: Variable Set [ Name:%Hourdif To:21-%Timelow1 Recurse Variables:Off Do Maths:On Append:Off ]
    A5: Variable Set [ Name:%Mindif To:60-%Timelow2 Recurse Variables:Off Do Maths:On Append:Off ]
    A6: Variable Set [ Name:%Timesechigh To:%Timeseclow+(%Hourdif*3600)+(%Mindif*60) Recurse Variables:Off Do Maths:On Append:Off ]
    A7: Get events [ Configuration:All from %Timeseclow to %Timesechigh Timeout (Seconds):30 ]
    A8: Variable Set [ Name:%Calevents To:%cttitles() Recurse Variables:Off Do Maths:Off Append:Off ]
    A9: Write File [ File:Tasker/projects/caltime.txt Text:%Hourdif %Mindif %Timesechigh %Calevents at %TIME Append:On Add Newline:On ]

    This task runs at first screen awakening of the day and the top of every hour following.
    Then I send %Calevents to my AutoNotification notification bar status panel.
     
    edukardo likes this.
  17. edukardo

    edukardo New Member

    Joined:
    Mar 12, 2016
    Messages:
    5
    Likes Received:
    0
    Pretty curious. I ve got the same problem as you explained in post #1. The curious thing is that when I execute it from remix os, it works perfectly. When I try it from phone, same error message as you described.
     
  18. Shaun Wray

    Shaun Wray New Member

    Joined:
    Dec 16, 2015
    Messages:
    20
    Likes Received:
    3
    Oh good to know, thanks for sharing that info. I'm going to take another crack at the AutoWeb calendar plugin feature, want to get that working. But for the meantime, just wanted to get something up and running and the CalendarTask plugin app worked without issues.
     
  19. Shaun Wray

    Shaun Wray New Member

    Joined:
    Dec 16, 2015
    Messages:
    20
    Likes Received:
    3
    Calendar This Works (70)
    A1: Variable Set [ Name:%Timeseclow To:%TIMES Recurse Variables:Off Do Maths:Off Append:Off ]
    A2: Variable Set [ Name:%Timelow To:%TIME Recurse Variables:Off Do Maths:Off Append:Off ]
    A3: Variable Split [ Name:%Timelow Splitter:. Delete Base:Off ]
    A4: Variable Set [ Name:%Hourdif To:21-%Timelow1 Recurse Variables:Off Do Maths:On Append:Off ]
    A5: Variable Set [ Name:%Mindif To:60-%Timelow2 Recurse Variables:Off Do Maths:On Append:Off ]
    A6: Variable Set [ Name:%Timesechigh To:%Timeseclow+(%Hourdif*3600)+(%Mindif*60) Recurse Variables:Off Do Maths:On Append:Off ]
    A7: Get events [ Configuration:All from %Timeseclow to %Timesechigh Timeout (Seconds):30 ]
    A8: Variable Set [ Name:%Calevents To:%cttitles() Recurse Variables:Off Do Maths:Off Append:Off ]
    A9: Write File [ File:Tasker/projects/caltime.txt Text:%Hourdif %Mindif %Timesechigh %Calevents at %TIME Append:On Add Newline:On ]
    This is what I have so far. Running on the hour.
     
    edukardo likes this.
  20. edukardo

    edukardo New Member

    Joined:
    Mar 12, 2016
    Messages:
    5
    Likes Received:
    0
    Yep, my friend. I've got autocalendar up and working. But I find interesting to use autoweb for consistency purposes.
    Thank you
     

Share This Page