Announcement

Collapse
No announcement yet.

Update Frequency

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Update Frequency

    The Update Frequency determines how often the Plug-in automatically contacts the SurePet Servers and downloads all the information relating to your installation.

    The SurePet API is not official published and I am not aware of whether SurePet currently place any restrictions on the amount of access, or might do in the future. This is obviously a concern. If you use the SurePet App on iOS or Android, or login to the Web Page, then there may be fairly rapid traffic for a short period but only whilst you have the App or Web Page open. Using the Plug-in the downloads will continue 24/7. Currently the plug-in sets a lower limit of once per minute, but even this amounts to 1440 downloads a day, so think whether this is necessary before selecting a short frequency.

    My setup consists of a Cat Door a Hub and 2 pets. The only things of importance that I desire frequent updates for are the pet locations. Other updates, such as battery, signal level, renaming devices, etc are not needed at any rapid frequency. I happen to have a number of web cams, one of which covers an area which includes the cat door. The web cams also act as motion sensors controlling virtual devices in HS. For the web cam that covers the cat door I have a 'mask' set to fine tune the motion detection so that it only really triggers if something goes in or out of the cat door. I also have a very dim low powered LED light next to the door which is enough that the motion triggers still work at night. I have the motion detection timeout set at 30 seconds and an event in HS to update the SurePet information whenever motion ceases. I have the automatic Update Frequency set at 1 hour intervals and an event in HS to update the SurePet information every time motion ends. This way the pet locations are updated within 30 seconds of a pet entering or exiting the cat door but the total number of information downloads a day is quite low.

    Click image for larger version

Name:	Motion.JPG
Views:	251
Size:	19.3 KB
ID:	1508448
    I used the existing web cam, because it was convenient, but any type of motion sensor could be used in a similar manner.

    Another possibility I considered was to find a way to trigger an HS device based on the real time notifications that SurePet send to the Phone App when a pet enters or exits. However, I have an iPhone and there doesn't appear to be anyway to automatically react to notifications. On Android this is probably possible and would be an excellent way of triggering the plug-in to download updated information.

    It is worth noting that the Time that the plug-in shows against the pet location is the time reported from the API, not the time the information was downloaded. So, if the Pet last entered at 14:20:06 but the plug-in didn't update the information until 14:30:00 the Last Change Time will correctly show as 14:20:06. This is relevant if you say setup an event to notify you if your pet has been out for longer than a certain period of time.

    Anyway, the purpose of this post is really to think about whether you really need to be hitting the SurePet Servers with hundreds of repeated requests when chosing your update frequency.

    Steve

    #2
    Originally posted by SteveMSJ View Post
    The Update Frequency determines how often the Plug-in automatically contacts the SurePet Servers and downloads all the information relating to your installation.

    The SurePet API is not official published and I am not aware of whether SurePet currently place any restrictions on the amount of access, or might do in the future. This is obviously a concern. If you use the SurePet App on iOS or Android, or login to the Web Page, then there may be fairly rapid traffic for a short period but only whilst you have the App or Web Page open. Using the Plug-in the downloads will continue 24/7. Currently the plug-in sets a lower limit of once per minute, but even this amounts to 1440 downloads a day, so think whether this is necessary before selecting a short frequency.

    My setup consists of a Cat Door a Hub and 2 pets. The only things of importance that I desire frequent updates for are the pet locations. Other updates, such as battery, signal level, renaming devices, etc are not needed at any rapid frequency. I happen to have a number of web cams, one of which covers an area which includes the cat door. The web cams also act as motion sensors controlling virtual devices in HS. For the web cam that covers the cat door I have a 'mask' set to fine tune the motion detection so that it only really triggers if something goes in or out of the cat door. I also have a very dim low powered LED light next to the door which is enough that the motion triggers still work at night. I have the motion detection timeout set at 30 seconds and an event in HS to update the SurePet information whenever motion ceases. I have the automatic Update Frequency set at 1 hour intervals and an event in HS to update the SurePet information every time motion ends. This way the pet locations are updated within 30 seconds of a pet entering or exiting the cat door but the total number of information downloads a day is quite low.

    Click image for larger version

Name:	Motion.JPG
Views:	251
Size:	19.3 KB
ID:	1508448
    I used the existing web cam, because it was convenient, but any type of motion sensor could be used in a similar manner.

    Another possibility I considered was to find a way to trigger an HS device based on the real time notifications that SurePet send to the Phone App when a pet enters or exits. However, I have an iPhone and there doesn't appear to be anyway to automatically react to notifications. On Android this is probably possible and would be an excellent way of triggering the plug-in to download updated information.

    It is worth noting that the Time that the plug-in shows against the pet location is the time reported from the API, not the time the information was downloaded. So, if the Pet last entered at 14:20:06 but the plug-in didn't update the information until 14:30:00 the Last Change Time will correctly show as 14:20:06. This is relevant if you say setup an event to notify you if your pet has been out for longer than a certain period of time.

    Anyway, the purpose of this post is really to think about whether you really need to be hitting the SurePet Servers with hundreds of repeated requests when chosing your update frequency.

    Steve
    One thing I have noticed is that the ears on the SurePet Hub flash, usually 3 times, just after a pet has entered or left through my cat door. I thought I would experiment with detecting these flashes to trigger refreshes of the pet information as an alternative to the camera motion.

    I already use a Raspberry PI with a LDR module, running a small python program I wrote, to monitor the light pulses on my electricity meter. This updates various devices in HS4 to show my electricity current power, peaks and daily consumption. The Hub is relatively close to the electricity meter so it seemed a good idea to use the same Raspberry Pi to monitor both the meter and the Hub, particularly as I had a spare LDR module.

    I taped the LDR to one of the Hub ears and wrote a small python program to monitor the Hub lights. Each time there is a series of flashes this updates a virtual device in HS4 with the number of flashes. The number of flashes seems to be mainly 3, although it is sometimes 2, I haven't figured any significance in the number. The flashes mainly only happen as a cat enters or exits but occasionally at other times, perhaps when the battery level or something else updates. I trigger a 'Update Everything' in HS4 as the action of an event triggered by the virtual device being set.

    I was expecting to need to introduce a slight delay before Updating to ensure that the SurePet Server had time to receive the information from the Hub, but so far that hasn't been necessary. The lights flash as the pet passes through the door, usually before their tail is completely through.

    One concern I had was that if something got in a loop it might trigger a never ending series of rapid calls to the SurePet server. To avoid this I put a 'Don't rerun for 30 seconds' on the event. However, quite often both our cats will enter or leave close behind each other which might result in the event not triggering on the following cat. I therefore decided it was better to limit the maximum number of full download calls that can be made in a period of time rather than a specific minimum time between each call. This would be difficult to implement in events so I have added this to the plug-in, version 4.0.1.15. I decided on a limit of 12 calls in any 10 minute period and implemented this in such a way that, if the frequency is exceeded, one call is queued and actioned 10 minutes after the 1st of the 12 calls. So, a refresh isn't missed, it just might be delayed a few minutes. There is therefore now no need for a 'Don't rerun for' on events triggering an 'Update Everything'.

    So far this is working very reliably and I have dispensed with triggering from the camera motion.

    akatar I would be interested to know if the lights flash on your hub after your cats eat or drink from your Feeder and FelAqua.

    Steve

    Comment


      #3
      Steve
      Yes, the ears are flasing
      Strange thing is that the "ears" are dimmed but when they are flashing they are flashing bright

      Comment


        #4
        Originally posted by akatar View Post
        Steve The hub is in the loft, so no-one is there,
        Let me think about it if i can find a way to check/test this
        Ok

        Comment


          #5
          SteveMSJ

          Yes, the ears are flasing
          Strange thing is that the "ears" are dimmed but when they are flashing they are flashing bright

          Comment


            #6
            Originally posted by akatar View Post
            SteveMSJ

            Yes, the ears are flasing
            Strange thing is that the "ears" are dimmed but when they are flashing they are flashing bright
            Hi Jan, thanks for the info.
            I’m pretty sure that the ears flash when the hub uploads info to the SurePet server. It is certainly the case for my Cat Doors and from what you report it applies with the Feeder and FelAqua, which I presumed it would. The ears flash brightly even when set dimmed or off. By monitoring the ear flashes I now have near instant updates without unnecessarily polling of the server.

            I am currently combining functionality so I have one Raspberry Pi that is:
            • Acting as a Z-Wave interface (Z-Net)
            • Monitoring my Weather Station using CumulusMX and uploading the info to HS4
            • Monitoring my Electricity Meter and uploading the info to HS4
            • Monitoring my SurePet Hub and triggering updates in HS4
            Steve

            Comment


              #7
              With a petdoor you want to know exactly if the cats are inside or outside, with my petfeeder and felaqua it's not that important.

              Comment


                #8
                Originally posted by akatar View Post
                With a petdoor you want to know exactly if the cats are inside or outside, with my petfeeder and felaqua it's not that important.
                Very true!

                Comment


                  #9
                  akatar By the way, when I had access to your account I did notice that the signal strength was quite low for your devices and the Hub went offline from time to time. You might want to position it closer to the Feeder and FelAqua if you notice any issues.

                  Steve

                  Comment


                    #10
                    SteveMSJ The distance is about 6 meter (including a wooden ceiling) i did not noticed problems

                    Comment


                      #11
                      Originally posted by akatar View Post
                      SteveMSJ The distance is about 6 meter (including a wooden ceiling) i did not noticed problems
                      If it doesn't cause any problems then don't worry about it, unless repositioning the Hub is easy.

                      Steve

                      Comment

                      Working...
                      X