Announcement

Collapse
No announcement yet.

Easy Geo Fence with "Geofency" and Big5

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Easy Geo Fence with "Geofency" and Big5

    Geofency is a free app for smart phones. I'm using it on iPhone. It provides an easy setup of a Geo Fence. It reports by HTTP protocol when you enter and when you leave the geo fence that you have setup. You can setup multiple geo fences with various custom sizes.
    The report is JSON and looks like this

    {

    "device" : "8E901528-2A79-4D15-B61D-93A70F3836C6",

    "radius" : "100",

    "longitude" : "-109.125223",

    "id" : "A935C11C-D4D2-4740-B537-6B50CC380B95",

    "wifiSSID" : "LITMATH",

    "address" : "123 Green Street, Sometown, 32456\nUnited States",

    "date" : "2019-09-30T09:05:51Z",

    "latitude" : "31.321499",

    "entry" : "0",

    "wifiBSSID" : "fc:ec:da:e6:ee:52",

    "name" : "Home Office"

    }


    Big5 can easily receive and process any JSON including this one. All you need to do is to setup "Listening" Big5 HTTP profile. Make sure that the settings of your Big5 profile match the settings in the tab "Web hook" of the Geofency app.

    I'm using only two pieces of information from the JSON The name will be used as a name for the HS3 device and the "entry" will be used as a value to the same device. 0 meaning exit (leaving) the geofence and 1 meaning entry into the geofence.

    In the field "Name" in the Big5 profile I'm using

    JSON(input, "name")

    In the field "Value" of the Big5 profile I'm using

    JSON_Num(input, "entry")

    As a result a HS3 device is created/updated by Big5 as follows

    Floor- Big5
    Room - HTTP
    Name - Home Office

    If the value of "Home office" changes to 0 than it means that I just left the home office
    If the value of "Home office" changes to 1 than it means that I just entered the home office.

    This information can be used to trigger all kinds of HS3 events like turning on HVAC, lights, unlock doors etc.







    #2
    This is the Webhook HTTP POST URL I use to send geofence changes from Geofency to PHLocation2 in Homeseer:
    http://<homeseer_ip_address>:<port>/phl2api?dtype=GF
    What change would I need to make to the URL to use Big5 instead of PHLocation2, and how do I configure the HTTP Profile in Big5?

    Thanks,
    Robert

    Comment


      #3
      Not familiar with PHlocation2.
      It is more simple with Big5 just IP and port#
      Just create listening HTTP profile as described above. Select available port#. Use the same port# in Geofency settings

      Comment


        #4
        Thanks. I think I have it working now. Had port forwarding in the router but forgot to open the port in Windows firewall.

        Comment


          #5
          would be nice to be able to do this through MyHomeseer. I don't like opening ports in my home network.

          Comment


            #6
            Originally posted by risquare View Post
            Geofency is a free app for smart phones. I'm using it on iPhone. It provides an easy setup of a Geo Fence. It reports by HTTP protocol when you enter and when you leave the geo fence that you have setup. You can setup multiple geo fences with various custom sizes.
            The report is JSON and looks like this

            Big5 can easily receive and process any JSON including this one. All you need to do is to setup "Listening" Big5 HTTP profile. Make sure that the settings of your Big5 profile match the settings in the tab "Web hook" of the Geofency app.

            I'm using only two pieces of information from the JSON The name will be used as a name for the HS3 device and the "entry" will be used as a value to the same device. 0 meaning exit (leaving) the geofence and 1 meaning entry into the geofence.

            In the field "Name" in the Big5 profile I'm using

            JSON(input, "name")

            In the field "Value" of the Big5 profile I'm using

            JSON_Num(input, "entry")

            As a result a HS3 device is created/updated by Big5 as follows

            Floor- Big5
            Room - HTTP
            Name - Home Office

            If the value of "Home office" changes to 0 than it means that I just left the home office
            If the value of "Home office" changes to 1 than it means that I just entered the home office.

            This information can be used to trigger all kinds of HS3 events like turning on HVAC, lights, unlock doors etc.
            I'm a total noob with Big 5 and I can seem to get the entry's right. Can you possibly provide a pic of your profile? I can post the Geofency stuff just fine (I know how all of that works) and can successfully send a post but to what? Big 5 isn't creating a device, do I create One? What's the string look like? Thanks in advance!!

            Comment


              #7
              Not sure why someone hasn't created a direct plug-in for Geofency to HS communication.. would be awesome.

              Comment


                #8
                Click image for larger version  Name:	 Views:	0 Size:	440.8 KB ID:	1420099


                Bigstevep

                1. At HomeSeer pls create Big5 Profile as shown at the screenshot. Please make sure you pick a port that is not used ( :85 in the example)

                Expressions are:

                for name - JSON(input, "name")

                for value - JSON_Num(input, "entry")

                2. At Geofency app find the setting called "Webhook"

                a) at URL settings enter URL (example, use your own data) 192.168.1.242:85 (just an example where 85 is the port you put in your Big5 profile and the rest is the IP address of your HS computer)
                b) at HTTP method use POST (JSON)
                c) Test connection - click on the button and see result "Successful "status: OK". If you do not see this than troubleshoot your Big5 profile and/or your network for firewalls etc.

                3. Look in your HS devices at floor: Big5 room: HTTP Device should be created automatically by Big5 with name: Geofency... Value would be 0 if you "exit" the geofence or 1 if you entered.

                4. You can rename your device and change floor and room Big5 will always find it and update it. Use the value change to trigger HS events.

                5. You are not restricted to one Geo fence only. Create as many as you want and Big5 will take care of them all by the flexible system to retrieve the name from the incoming messsge.

                Enjoy,

                RIsquare

                Comment


                  #9
                  Perfect RIsquare! Works like a charm. I've been looking for something like this in HS and FINALLY you have the answer.! I appreciate the extra effort on this walking me through how to set up Big5.

                  Comment


                    #10
                    Originally posted by mjolsen View Post
                    Not sure why someone hasn't created a direct plug-in for Geofency to HS communication.. would be awesome.
                    Me either. A plugin that works for Geofency, Tasker, etc. I'm sure would go over well and sell quite a few plugins.

                    Comment


                      #11
                      Is it correct that you have to have location services ON and the Geofency app running on your phone? If so, do you notice any difference in how long a charge lasts?

                      Comment


                        #12
                        Yes to both of your questions. I picked Geofence after testing few others for the excellent handling of iPhone’s resources. No noticeable degradation of battery life in my experience. Of course there is no free lunch. You pay by less granularity of the reporting but it is fine for me. For example if you leave house at 10AM it may be reported at 10:00:30 30 seconds late.

                        Comment


                          #13
                          (you'll get very easy step by step tuto on the net )

                          If you go to the route to open a port on the router , I would suggest pivpn (install it on a raspberry pi) Then choose wireguard.
                          Then setup a port fowarding rule to acess your your wireguard install ip: port
                          Install wireguard on your phone and use the really easy pivpn -a , then pivpn -qr command on the pi terminal to scan a code from your cell phone.


                          Big5 setup will stay the same

                          Comment


                            #14
                            Originally posted by Bigstevep View Post

                            Me either. A plugin that works for Geofency, Tasker, etc. I'm sure would go over well and sell quite a few plugins.
                            I agree. PHLocation2 works very well with Geofency but it looks like support for PHLocation2 is dead. Big5 looks like a great alternative but having to open a port in the firewall was a turn off for me. Decided to add a Virtual Device for each of my geofence locations and used Geofency’s webhook GET (not POST) to set the device to Inside/Outside.

                            http://<ip address>:<port>/JSON?request=controldevicebyvalue&ref=268&value=0

                            http://<ip address>:<port>/JSON?request=controldevicebyvalue&ref=268&value=100

                            Click image for larger version

Name:	Screen Shot 2020-09-20 at 9.27.35 AM.png
Views:	85
Size:	103.1 KB
ID:	1420630

                            Comment


                              #15
                              By the way, you may be able to do this through MyHS but I haven't tested that. In the above example I chose to have Geofency communicate directly with my HS Server instead of going through MyHS.

                              Comment

                              Working...
                              X