GeoFence

From Domoticz
Jump to: navigation, search
GeoFence.png

GeoFence is a basic app to create a geofence and communicate your phones presence to a Domoticz server.

When you enter or leave your geofence this app calls a URL on your Domoticz server so you can flip a virtual switch. Entering sends a 'On' and leaving sends a 'Off'

Setup: On your Domoticz server:

Create a virtual switch that GeoFence will trigger

  1. Go to 'Setup -> Hardware' and add a 'Dummy device'
  2. Go to 'Switches' and add a 'Manual light/switch'
  3. Select the right 'Hardware' and 'On/Off' the rest doesn't matter.
  4. Add the device
  5. Now go to 'Setup -> Devices' and note the 'Idx' of the switch you just created.

Secure your Domoticz server with a username and password

  1. Go to 'Setup -> Settings'
  2. At 'Website protection' fill in a username, password and select 'Basic-Auth'
  3. Now Save your settings

Open a port on your router and pass it to your internal domoticz server (usually through NAT)

  1. Test the connection to your Domoticz server by using the button on the bottom right of the app.

GeoFence supports https through nginx (as described on the wiki). User neutreno [1] found out that the current version (2.0.0) of GeoFence doesn't support the build in https of Domoticz as this uses a self-signed certificate for *.domoticz.com (which usually isn't the domain that you're running on).

You can use http://www.latlong.net/ to get the coordinates for the center of your geofence. I use a radius of 100 meters myself, but it is also possible to make the geofence smaller. Because of the errors on gps and location services, setting the radius too small (e.g. 10 meters) might give false 'enter' and 'leaves'. This depends on your environment, so you should experiment a little to find the optimal setting.