Page 1 of 18

Beacon: a Geohopper/Beecon plugin

PostPosted: Thu May 01, 2014 1:29 pm
by flic
Good evening.

I've written a plugin to interface Geohopper and/or Beecon to Indigo. I built it primarily because I wanted to play around with iBeacons, but it should work just as well with Geohopper's geofences.

It's my first plugin and I've written it over the course of the last two days so don't expect something 100% bug-free, but I feel it works fairly well.

I wouldn't mind some feedback. Try it, and enjoy.

https://github.com/flic/Beacon/

Re: Beacon: a Geohopper/Beecon plugin

PostPosted: Thu May 01, 2014 4:20 pm
by jay (support)
Cool! I'll give it a spin when I get a chance (which probably won't be very soon unfortunately).

Thanks for the contribution. I'll add it to the plugin list.

Re: Beacon: a Geohopper/Beecon plugin

PostPosted: Tue May 13, 2014 12:08 pm
by flic
I just posted a new version that supports Geofancy as well as Geohopper and Beecon. (http://geofancy.com) Tried it out with SticknFind stickers in iBeacon mode (https://www.sticknfind.com), works pretty well!

Re: Beacon: a Geohopper/Beecon plugin

PostPosted: Thu May 15, 2014 1:13 pm
by jltnol
Just curious... can this plugin trigger geo-location in Indigo? Say.... things happen as I arrive home?

Re: Beacon: a Geohopper/Beecon plugin

PostPosted: Fri May 16, 2014 12:02 am
by flic
Yes, absolutely. You get an Indigo device that corresponds to a person (or device) at a location, and you can trigger absent or present actions based on that device. I use this in a few different ways.

A few examples:

I have an Indigo device called "Fredrik at home". I get absent and present actions based on this device, triggered when Geohopper detects me entering or exiting the geofence.

I have another device called "Fredrik on bike". This is a short range SticknFind iBeacon I glued to the underside of my motorcycle saddle. Geohopper detects the beacon and triggers Indigo actions.

Finally I have a busted up iPhone 4s mounted in the garage. This detects the same iBeacon on my bike and another one in the car and triggers bike@garage and car@garage devices in Indigo.

I've only been running this for a short while but it works fairly well! You need to tweak the beacon range a bit to avoid false positives but on the whole I've been pleasantly surprised as to the reliability.

Re: Beacon: a Geohopper/Beecon plugin

PostPosted: Fri May 16, 2014 5:37 am
by loafbread
Have these apps impacted the battery life on your iOS devices? I experimented with Beecon and noticed significant battery impact. I also noticed that when Beecon runs in the background, it keeps the WiFi/IP running on the iPhone. The iPhone remains pingable always. I suspect this is what impacts the battery.

Otherwise, the Beecon app is pretty cool. I put the Indigo RESTful URLs directly into Beecon for my tests, that worked perfectly.

Re: Beacon: a Geohopper/Beecon plugin

PostPosted: Fri May 16, 2014 6:07 am
by flic
loafbread wrote:
Have these apps impacted the battery life on your iOS devices?


Well, yes and no. There's something funny going on with Geohopper. It absolutely killed the battery on my phone at first, but after a reinstallation I can see it using up a bit of battery but not too much. Geofancy seems to work a bit better, but I've only tried that a short while. Geofences seems to use up more battery than iBeacons. In conclusion: your mileage may vary! ;)

Re: Beacon: a Geohopper/Beecon plugin

PostPosted: Fri May 16, 2014 9:29 am
by jltnol
Ok Great...

So I've installed the plug-in....
and set up a device called "Home Beacon", Sender Name = the name I used to setup Geohopper, Location Name = Same location name for my house in the iPhone app for Geohopper...

and set up a trigger..
Type: Device State Change
Device: Home Beacon/State Change to Present/Becomes True

I've registered the computer with Geohopper that Indigo is running on.

On my phone, I've set up a "Home" geo fence to match my home address... and when I arrive home, my phone and the computer both notify me that I've crossed the geo fence for home.

BUT... nothing happens in Indigo....

Do I need to do something else to tie Indigo to my Geohopper account? Or does it just monitor the port for incoming data?

Re: Beacon: a Geohopper/Beecon plugin

PostPosted: Fri May 16, 2014 9:57 am
by flic
You don't need to install Geohopper on the Indigo server.

Install the plugin, select the TCP port (or keep the default, 6192) and open a connection in your firewall from the Internet to your Indigo server on that port.

In Geohopper on your phone, configure a web service and add the URL to your Indigo server. This is either a fully qualified domain name or just the public IP address and looks like this: http://1.2.3.4:6192 or http://your-server.your-domain.com:6192

That's it. I would recommend that you let the plugin auto-create the devices for you, but that's your choice.

Re: Beacon: a Geohopper/Beecon plugin

PostPosted: Fri May 16, 2014 12:19 pm
by jltnol
Ok so I'm getting there little by little.

Got the Web Service correctly setup on the iPhone app. And now am getting incoming Events in Indigo's Event Log, but can't get it to trigger anything.

Generally speaking, do I need a different "device" for each location? One for home, one for work?

Since the event log is as follows,

Beacon Test location notification received from sender/location register@iaudiowor.com//Work

...should the "Senders name" in the device be the corresponding email address? And should the device name correspond to the location name in the app on my iPhone? Or should I do all of this by having the plugin write info to some variables?

I'm still missing a few key pieces of the puzzle I'm afraid..... :(

Re: Beacon: a Geohopper/Beecon plugin

PostPosted: Fri May 16, 2014 1:10 pm
by flic
You're pretty close.

I built it so that one device is a combination of a sender and a location. For instance, you have a device called register@iaudiowor.com//Work. That device have two states, absent and present, corresponding to if Sender register@iaudiowor.com is absent or present at Location Work. When you're at location Work, the device is in state present, when you're not it's in state absent.

If you want to trigger actions based on that you can create a new trigger of type Device State Changed, select the device register@iaudiowor.com//Work (it's perfectly fine to rename it to something else), and select State Changed (any change), State Changed to Present (you arrive at location Work) or State Changed to Absent (you leave location Work).

Re: Beacon: a Geohopper/Beecon plugin

PostPosted: Fri May 16, 2014 3:23 pm
by jltnol
Got it!

This is where I went so horribly wrong.... letting the plug-in Auto Create Devices.

Yes, I had it checked, but didn't notice that the devices were being created in Indigo. So the devices that I DID create weren't setup correctly, and triggered nothing.

Now that I'm past this mistake, the rest is crystal clear.

Thanks so much for this plug! I don't mean to suppose anything, but I'm actually more than happy to write out some instructions in a way that other morons like me may understand just a bit better, and save you from answering a bunch of noobie questions over and over... While I can't program computer stuff, I can write! Let me know if this is something you'd be interested in......

Cheers!

Re: Beacon: a Geohopper/Beecon plugin

PostPosted: Sat May 17, 2014 1:45 am
by flic
jltnol wrote:
Thanks so much for this plug! I don't mean to suppose anything, but I'm actually more than happy to write out some instructions in a way that other morons like me may understand just a bit better, and save you from answering a bunch of noobie questions over and over... While I can't program computer stuff, I can write! Let me know if this is something you'd be interested in......


Sounds like a great idea, please do!

Thanks.

Re: Beacon: a Geohopper/Beecon plugin

PostPosted: Sun May 18, 2014 2:59 pm
by manoncloud9
I am having troubles as well with how to set this up. I have the app on my iOS device and configured the web services. I am confused on how to set up the device settings what should sender be and what should location be. I turned on set up automatically but not getting anything. I do see when I do a test from the app that I get the beacon to return the following in the log
May 18, 2014, 3:52:59 PM
Beacon Debug Received HTTP GET
Beacon Debug User-agent: None
What am I missing here?

thanks

Re: Beacon: a Geohopper/Beecon plugin

PostPosted: Sun May 18, 2014 9:57 pm
by flic
Which app are you trying to use, Geohopper, Beecon or Geofancy?