Beacon: a Geohopper/Beecon plugin

Plugins that users have built. NOTE: plugins that were developed for Indigo versions older than 2022.1 will have to be updated to work with Indigo 2022.1 (Python 3 - see this blog post for details). If the plugin listed here is not in the Plugin Store (which will show updated plugins) then you will need to ask on the appropriate thread below if it has been updated and where you get get the update.
stuartcolman
Posts: 81
Joined: Sun Nov 01, 2015 2:56 pm
Location: Essex, United Kingdom

Re: Beacon: a Geohopper/Beecon plugin

Post by stuartcolman »

What are the value needed by Beacon to change the device state? Does it just take a JSON input?
flic
Posts: 128
Joined: Thu Nov 30, 2006 1:35 pm
Location: Lidingö, Sweden

Re: Beacon: a Geohopper/Beecon plugin

Post by flic »

I support a few different applications and so a few different ways of doing it:

Geofancy:
User agent must include "Geofancy". ctype "application/x-www-form-urlencoded", POST device, id and trigger.

Geofency:
User agent must include "Geofency". ctype "application/json". POST JSON-formatted device, name, entry.

Beecon:
User agent must include "Beecon". POST region and action.

Geohopper:
ctype "application/json". POST JSON-formatted sender, location and event.

Trigger/event/entry/action can be one of the following: LocationEnter/enter/1, LocationExit/exit/ 0, LocationTest/test
flic
Posts: 128
Joined: Thu Nov 30, 2006 1:35 pm
Location: Lidingö, Sweden

Re: Beacon: a Geohopper/Beecon plugin

Post by flic »

Simple example on how to trigger Beacon from the command line:

Code: Select all

curl -H "Content-Type: application/json" -X POST -d '{"sender":"fredrik","location":"home","event":"LocationEnter"}' http://localhost:6192
stuartcolman
Posts: 81
Joined: Sun Nov 01, 2015 2:56 pm
Location: Essex, United Kingdom

Re: Beacon: a Geohopper/Beecon plugin

Post by stuartcolman »

what would the relevant device in Indigo look like to use that code? would it be fredrik@@home as the address?
flic
Posts: 128
Joined: Thu Nov 30, 2006 1:35 pm
Location: Lidingö, Sweden

Re: Beacon: a Geohopper/Beecon plugin

Post by flic »

Yes, exactly


Skickat från min iPhone med Tapatalk
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Beacon: a Geohopper/Beecon plugin

Post by howartp »

Interesting to see:

http://www.engadget.com/2015/11/11/blue ... ents-2016/

Will be great for a whole-house home/away zone.


Sent from my iPhone using Tapatalk
User avatar
pocster
Posts: 276
Joined: Sat Nov 15, 2014 9:26 am

Re: Beacon: a Geohopper/Beecon plugin

Post by pocster »

Hey all,

This has been working great for me but recently I seem to get multiple triggers for exit and entrance of a zone.
Can see no obvious reason for this; any suggestions?

Cheers
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Beacon: a Geohopper/Beecon plugin

Post by howartp »

Hi flic,

Running Beacon 1.4.3

I've just bought three new RadBeacons and added them to GeoFency.

Before adding them, I "duplicated" an existing Beacon device in Indigo, then edited the Address to what I was about to create in GeoFency.

But when I activate the Webhook in GeoFency, your plugin insists on creating a new device instead of using the one I duplicated.

Is this intentional?

Peter
flic
Posts: 128
Joined: Thu Nov 30, 2006 1:35 pm
Location: Lidingö, Sweden

Re: Beacon: a Geohopper/Beecon plugin

Post by flic »

Are you sure you didn't just edit the name? I wasn't aware that it was possible to edit the address. Either way, no it's not intentional. If the address match an existing device no new device is created.


Skickat från min iPhone med Tapatalk
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Beacon: a Geohopper/Beecon plugin

Post by howartp »

Definitely the address.


Sent from my iPhone using Tapatalk
flic
Posts: 128
Joined: Thu Nov 30, 2006 1:35 pm
Location: Lidingö, Sweden

Re: Beacon: a Geohopper/Beecon plugin

Post by flic »

I'll take a look at it, see if you found a bug


Skickat från min iPhone med Tapatalk
flic
Posts: 128
Joined: Thu Nov 30, 2006 1:35 pm
Location: Lidingö, Sweden

Re: Beacon: a Geohopper/Beecon plugin

Post by flic »

Yep, definitely a bug! Fixed in 1.4.4.
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Beacon: a Geohopper/Beecon plugin

Post by howartp »

Can you fix it a bit quicker next time? ;-)


Sent from my iPhone using Tapatalk
flic
Posts: 128
Joined: Thu Nov 30, 2006 1:35 pm
Location: Lidingö, Sweden

Re: Beacon: a Geohopper/Beecon plugin

Post by flic »

Yeah I know, I'm slipping... :wink:

I'm on the sofa with my laptop, recuperating from knee surgery and bored out of my mind, that helps some! :D
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Beacon: a Geohopper/Beecon plugin

Post by howartp »

Ah! :-)

I'll test it as soon as I can grab my dads phone to add the new ones - about half an hour.

A new idea if you want something to think about: I've got a RadBeacon USB in my PC at work, which activates when I arrive.

It deactivates whenever I leave the office (it's a school campus so pretty big).

I'd like to turn off the 'Exit' webhook in GeoFency, but that means the Beacon device will be permanently on.

It would be good to be able to turn off a Beacon device using regular Indigo commands such as after 30 minutes of not-being-in-the-office, or when I get in the car (there's a USB in there as well)?


Sent from my iPhone using Tapatalk
Post Reply

Return to “User Plugins”