AutoVera Notification Delays

Discussion in 'AutoApps' started by TomTcom, Jun 28, 2015.

  1. TomTcom

    TomTcom Member

    Joined:
    Mar 18, 2015
    Messages:
    124
    Likes Received:
    5
    Hi Joao,

    On my devices, both a door lock and a sensor, I can sometimes get near instantaneous alerts. On other occasions it's delayed 20 minutes, an hour, maybe I'll never get it.

    I know that my actions are working because my lights turn on after the door lock unlocks and turns off after the lock is locked. So I have proof my scene is firing correctly.

    I have tried a push notification app to send out the GCM heartbeat on the phone but I'm thinking the issue could be AutoVera and the time it sends GCM per the logs in the app.

    Can you provide any insight or assistance on how to make these alerts more reliable?
    Can I monitor a scene for its execution and trigger on that instead?
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,477
    Likes Received:
    799
    Can you please check if, when that delay happens, you get the message in the logs right away, or does that have a delay too? Sorry for the trouble
     
  3. TomTcom

    TomTcom Member

    Joined:
    Mar 18, 2015
    Messages:
    124
    Likes Received:
    5
    @joaomgcd - I unlocked my door manually at 17:18 and I received a notification right on time and the scene fired which turns on my lights.

    About 10 minutes later I locked the door manually. No notification, no update in the logs, but my scene fired and the lights are off.

    The last GCM entry is from 6/27. The last "Changing State" entry is from 6/27.

    Received Status Updates - 2015-06-29 17:18:50.666 - New com.joaomgcd.autovera.util.StatusUpdate: Vera: Home
    Device: Front Door Lock
    Device Number: 11
    Service: urn:micasaverde-com:serviceId:DoorLock1
    Variable: Status
    Old Value: 1
    New Value: 0;
    Received Status Updates - 2015-06-29 17:18:49.570 - New com.joaomgcd.autovera.util.StatusUpdate: Vera: Home
    Device: Front Door Lock
    Device Number: 11
    Service: urn:micasaverde-com:serviceId:DoorLock1
    Variable: Status
    Old Value: 1
    New Value: 0;
     
  4. TomTcom

    TomTcom Member

    Joined:
    Mar 18, 2015
    Messages:
    124
    Likes Received:
    5
    *******Looking more closely, I got 2 notifications both with Old Value 1. I also use AutoNotification and it plays a sound. My sound always plays 2 times. Is my Door Lock reporting "unlocked" 2 times in a row? Why?
     
  5. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,477
    Likes Received:
    799
    Unfortunately I don't have a door lock to test it with myself, but all AutoVera does is send every update it gets to your phone. Is it possible you had a weak or no internet connection when that happened?
     
  6. TomTcom

    TomTcom Member

    Joined:
    Mar 18, 2015
    Messages:
    124
    Likes Received:
    5
    Modifying my post. While I simplified my alerts, it is clearly a delay receiving the push notification. In the AV logs I am not getting the updates till way later. Anywhere from minutes to 20 minutes or so. I eventually get them.

    For example, I tripped the sensor at 18:19. I got the AV alert finally at 18:30 and so the time of my alert is reported as 18:30 instead of 18:19.

    I checked in my Vera logs and they are accurately reporting device status change.

    Is there a way to force the GCM heartbeat more often? Or tell AV to refresh itself more often?
     
    Last edited: Jul 13, 2015
  7. TomTcom

    TomTcom Member

    Joined:
    Mar 18, 2015
    Messages:
    124
    Likes Received:
    5
    Hey Joao, looking to bump this. Can you explain the frequency of your GCM updated in the log? Seems like every 2 days sometimes and maybe it's not enough for sending the key.
     
  8. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,477
    Likes Received:
    799
    Sorry for the delay. Have you tried the gcm suggestion from here? There are apps to change the gcm heartbeat there. Hope this helps
     
  9. TomTcom

    TomTcom Member

    Joined:
    Mar 18, 2015
    Messages:
    124
    Likes Received:
    5
    Thank you for the response. Yes I had the No Root Push Notification Fixer installed. There was no noticeable difference. Some days I would get my alerts near instantly and other days upwards of 20 minutes. Even after I did several activities on the phone to ensure it was alive and communicating. I'm well aware of the TCP timeout and many other functions.

    I guess I'm wondering if you can make AutoVera, as a function in Tasker, do the device refresh? I know according to the logs that will resend the GCM key and hopefully reduce the delays.

    I'm just not sure if it is my phone or what because it is random where I get the messages instantly or late and I can't explain it. I have a stock Samsung Galaxy Note 4.
     
  10. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,477
    Likes Received:
    799
    For example, if you're at home and produce a bunch of events in a controlled environment.. do those always arrive? Or are those also randomly delayed?
     
  11. TomTcom

    TomTcom Member

    Joined:
    Mar 18, 2015
    Messages:
    124
    Likes Received:
    5
    Correct, randomly delayed. The log time on autovera does not match trip times of the sensor or lock.
     
  12. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,477
    Likes Received:
    799
    Have you tried using AutoRemote yet? Does the same happen there?
     
  13. TomTcom

    TomTcom Member

    Joined:
    Mar 18, 2015
    Messages:
    124
    Likes Received:
    5
    I have autoremote and for the function I used in the past like rebooting 2 cell phones and turning on led I did have similar sporadic success.

    I have reinstalled PNF and selected smart Network switch on the phone settings which keeps 4g available even when not used in case of weak wifi signal. I confirm I don't have weak wifi but I'll test how this works.

    For example, yesterday and today I received notifications perfectly on time with the above settings. I'll keep checking.
     
  14. TomTcom

    TomTcom Member

    Joined:
    Mar 18, 2015
    Messages:
    124
    Likes Received:
    5
    Ran a test on the lock and the door sensor. Notification was delayed even with my settings above. After waiting I turned on the screen and the messages flooded in.

    So if it's my phone, Lollipop, and Android deep sleep I'm not sure what else can be done. So that's why I'm asking if AV can use Tasker to refresh the devices so I could do it maybe once an hour.
     
  15. TomTcom

    TomTcom Member

    Joined:
    Mar 18, 2015
    Messages:
    124
    Likes Received:
    5
    So after all those options the tests are still the same. Just now I had 12 minutes delay for the door notification. Vera registers the correct time but AV is not.

    I also had a Tasker task running all day every 2 minutes.

    I did a run shell for "am broadcast --user 0 com.google.android.intent.action.MCS_HEARTBEAT
    and am broadcast --user 0 com.google.android.intent.action.GTALK_HEARTBEAT.

    This did not help.
     
  16. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,477
    Likes Received:
    799
    Sorry about that. :( Do you maybe have another device or network you could test this on? Does this happen on any network you're on? Unfortunately there's not much I could change since this relies solely on GCM... sorry
     
  17. TomTcom

    TomTcom Member

    Joined:
    Mar 18, 2015
    Messages:
    124
    Likes Received:
    5
    Thanks Joao, I will check device options, wifi, and other routes with Tasker to keep it alive.
     
  18. TomTcom

    TomTcom Member

    Joined:
    Mar 18, 2015
    Messages:
    124
    Likes Received:
    5
    Sorry to keep pestering you Joao. What intents are sent when you hit the Refresh button on the "Your Veras" page? Perhaps I can use send intent or the am package from the command line to trigger a refresh. Again, I did this just now and all my lock messages came through.
     
  19. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,477
    Likes Received:
    799
    Hi there, sorry for the delay. Sorry, there's no intent associated with that action. So it seems it would be handy for you to have an action to refresh stuff in Tasker, correct?
     
  20. TomTcom

    TomTcom Member

    Joined:
    Mar 18, 2015
    Messages:
    124
    Likes Received:
    5
    Thanks Joao. I'm trying with autoinput and have some moderate success. The major issue appears to be wifi closing the gcm socket Port connection after 5 minutes. Your refresh on the app shows the logs where the gcm key is sent again forcing the wakeup. I'll keep poking around but maybe you could have device refresh as an option to be used in Tasker?
     
: autovera, delay, gcm

Share This Page