Author Topic: HB keeps refreshing  (Read 3325 times)

Offline bbredewold

  • Sr. Newbie
  • *
  • Posts: 23
  • Karma: +0/-0
HB keeps refreshing
« on: June 30, 2012, 07:55:19 pm »
Hi there,

can anyone tell me, why is my Home Buddy refreshing almost all the time when I open up the app?
I thought that it only refreshes when I changed something in my Vera?

Thanks,

Bert

Offline garrettwp

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6376
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: HB keeps refreshing
« Reply #1 on: June 30, 2012, 08:08:28 pm »
3rd party apps have to poll the data from Vera. There is no way of the app knowing that the data has changed with out the app polling.

- Garrett

Offline bbredewold

  • Sr. Newbie
  • *
  • Posts: 23
  • Karma: +0/-0
Re: HB keeps refreshing
« Reply #2 on: July 01, 2012, 08:03:08 am »
So it's normal that if I want to switch a light, I have to wait 10 seconds while refreshing?

Offline garrettwp

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6376
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: HB keeps refreshing
« Reply #3 on: July 01, 2012, 08:13:16 am »
Are you referring to when you turn the light on or off or before you perform any action on the light? Are you on your local network or remotely connected?

- Garrett

Offline bbredewold

  • Sr. Newbie
  • *
  • Posts: 23
  • Karma: +0/-0
Re: HB keeps refreshing
« Reply #4 on: July 01, 2012, 08:46:50 am »
Yes, local network. Starting the app, asks me to refresh now.

Offline garrettwp

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6376
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: HB keeps refreshing
« Reply #5 on: July 01, 2012, 09:34:40 am »
How often do you load the app? If you do not use the app regularly, It would make sense as the data has probably changes quite a bit in which requires a full refresh. This is pretty normal. In my app, I have an option to refresh the data in the background to prevent the app taking too long when first opening it to refresh the data.

- Garrett

Offline OtisPresley

  • Full Member
  • ***
  • Posts: 144
  • Karma: +2/-1
Re: HB keeps refreshing
« Reply #6 on: July 01, 2012, 09:38:17 am »
You should also be able to answer No to the full refresh and still be able to operate your lights and such.

Offline rakstar

  • Moderator
  • Sr. Member
  • *****
  • Posts: 342
  • Karma: +0/-0
    • Home Buddy - Home Automation for Android and BlackBerry Playbook
Re: HB keeps refreshing
« Reply #7 on: July 01, 2012, 10:22:19 am »
I typed this up then saw OtisPreslsy's response.  He's absolutely right, I mention the same below...

@bbredewold I agree with Garrett.  You might have a device that's constantly changing Vera's state.  I'm not 100% on Vera's implementation  but here's how I think of it (note that this will be over-simplified)...  If say Vera keeps a log of 10 changes and your Vera has made less than 10 changes since Home Buddy's last refresh, when HB makes a request, Vera will tell HB to do a partial refresh.  If your Vera made more than 10, it will tell HB to do a full refresh.  I can probably get around this by implementing a service that will constantly poll your Vera behind the scenes to keep updated, but your battery probably won't last very long -- that's why I chose not to implement it like this.

Not sure how you could check which device is causing this -- perhaps MCV could help you figure that out.  Sorry I don't have a better answer, but I have no control over when Vera requests a refresh.

To address your use case of just wanting to switch on a light, you have 2 options:
1. Upon opening HB, pick No when it asks you to do a full refresh.  Turn on your light, then agree to the full refresh prompt after your light command executes.
2. Create a scene that turns on your light and create a shortcut on your Home screen.  I have a home screen dedicated to these shortcuts

Offline garrettwp

  • Beta Testers
  • Master Member
  • *****
  • Posts: 6376
  • Karma: +227/-128
  • Vera 3, Lite, ISY994
Re: HB keeps refreshing
« Reply #8 on: July 01, 2012, 10:40:43 am »
In my app I have the option for the user to turn on or off background polling and to set the frequency. I have mine set between 10 - 20 minutes and experience little to know battery drain.

- Garrett

Offline jjwatmyself

  • Jr. Member
  • **
  • Posts: 73
  • Karma: +0/-0
Re: HB keeps refreshing
« Reply #9 on: July 01, 2012, 08:07:02 pm »
I have an idea of how to handle this. Possibly, if refresh has been declined or turned off by the user, upon expanding (opening) a device, perform a poll on that single device. Stated another way, currently upon turning on a light, or tweaking a thermostat, about 1 second later the device is polled. The concept is to perform that step at the time the user opens the device. BUT only if the full refresh was bypassed. Make sense? For people with large device populations, this would offer an improvement in performance with the advantage of accuracy on the specific device being inspected. I agree that waiting 10 seconds is not practical but that's only the case when there are many many devices. Hope this helps.

Offline davem2421

  • Jr. Member
  • **
  • Posts: 83
  • Karma: +0/-1
Re: HB keeps refreshing
« Reply #10 on: July 29, 2012, 08:45:08 am »
I typed this up then saw OtisPreslsy's response.  He's absolutely right, I mention the same below...

@bbredewold I agree with Garrett.  You might have a device that's constantly changing Vera's state.  I'm not 100% on Vera's implementation  but here's how I think of it (note that this will be over-simplified)...  If say Vera keeps a log of 10 changes and your Vera has made less than 10 changes since Home Buddy's last refresh, when HB makes a request, Vera will tell HB to do a partial refresh.  If your Vera made more than 10, it will tell HB to do a full refresh.  I can probably get around this by implementing a service that will constantly poll your Vera behind the scenes to keep updated, but your battery probably won't last very long -- that's why I chose not to implement it like this.

Not sure how you could check which device is causing this -- perhaps MCV could help you figure that out.  Sorry I don't have a better answer, but I have no control over when Vera requests a refresh.

To address your use case of just wanting to switch on a light, you have 2 options:
1. Upon opening HB, pick No when it asks you to do a full refresh.  Turn on your light, then agree to the full refresh prompt after your light command executes.
2. Create a scene that turns on your light and create a shortcut on your Home screen.  I have a home screen dedicated to these shortcuts

I can see where you are coming from but my complaint is that I deny the full refresh (on my home network) but it won't stop asking me to do one. Very frustrating as other apps don't seem to have this problem, Square Connect SQ Remote for the iPad. I use HB way more than I use SQ Remote yet once I connect it knows the state of all my devices and works instantly as if I we clicking the switch on and off manually. I love HB but this latest update I keep getting more frustrated with because no matter how often I use it I'm always prompted for a full refresh before and after anything I do anything. I understand one way around it is to create a scene and put that on one of my screens but I don't want to do that. When working on remote I get the refresh and it makes sense but on my home network I shouldn't have to especially when other apps don't have this problem.


Offline bbredewold

  • Sr. Newbie
  • *
  • Posts: 23
  • Karma: +0/-0
Re: HB keeps refreshing
« Reply #11 on: July 29, 2012, 03:21:30 pm »
Thanks, this is the problem I was asking about.
I did not found an answer yet.
I just have 8 lightswitches.