Geofence for Domoticz

pvklink
Posts: 61
Joined: Wednesday 12 November 2014 16:01
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by pvklink » Tuesday 10 January 2017 22:41

to use the google play services as you mentioned, do i need to install them on my cell phone?
I dont see aa google play app in the store....

Appesteijn
Posts: 115
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn » Wednesday 11 January 2017 12:35

pvklink wrote:to use the google play services as you mentioned, do i need to install them on my cell phone?
I dont see aa google play app in the store....
You can find them here: https://play.google.com/store/apps/deta ... ndroid.gms

Misterik
Posts: 29
Joined: Sunday 11 December 2016 19:30
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Misterik » Friday 13 January 2017 19:58

Thanks Appesteijn for the great app! I am still trying to figure out the right distance for me. So i was wondering in which time interval Geofence is looking for the phone entering the fence? is this one a minute? Because i arrive home by car and have not find the sweet spot that when i park my car the lamps in my house turn on.
RPI-3 + RFLink + NRF24L01
Milight lamps (Wifi Controler v4 & Iboxv6, GU10, MR16, E27, ledstrip)
Kaku devices (APA3-1500, ACM-2300h, AMST-606, AWST-6000, APIR215)

Appesteijn
Posts: 115
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn » Sunday 15 January 2017 12:23

Misterik wrote:Thanks Appesteijn for the great app! I am still trying to figure out the right distance for me. So i was wondering in which time interval Geofence is looking for the phone entering the fence? is this one a minute? Because i arrive home by car and have not find the sweet spot that when i park my car the lamps in my house turn on.
The time interval is something that is managed by the Google Play Services. If you get close to the boundary of your geofence, it will start to measure more accurately and faster. How fast I have never looked into. Personally I use 1500 meters radius, because we live quite remote (very few telephone masts). With this distance my home is always 'on' when we arrive.

User avatar
heggink
Posts: 336
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi
Domoticz version: V3.7067
Location: NL
Contact:

Re: Geofence for Domoticz

Post by heggink » Sunday 15 January 2017 12:27

I noticed that Android is very inconsistent with its position. When at home, my phone regularly puts me either 500m or sometimes even 50km away from where I am until I open the maps app. This appears to be a known android 6 bug affecting lots of devices.
Pi3, latest beta
RFXCOM, z-wave (AEOTEC, switches, temhum, pir, contacts),
Plugwise2py, P1 'smart'meter & solar panel
Alexa, Wifi Cams motion detection
ESP: relays, PIR & Temp/TempHum
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest

Jewcookie
Posts: 1
Joined: Tuesday 27 December 2016 21:25
Target OS: -
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Jewcookie » Sunday 15 January 2017 12:30

Nice work. Any chance for an iPhone app?


Verzonden vanaf mijn iPhone met Tapatalk

Appesteijn
Posts: 115
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn » Sunday 15 January 2017 21:16

Jewcookie wrote:Nice work. Any chance for an iPhone app?
No sorry, I don't have an IPhone and to (voluntary) develop with Xcode is too much for me. :)

User avatar
DewGew
Posts: 108
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi
Domoticz version: V3.8153
Location: Sweden
Contact:

Re: Geofence for Domoticz

Post by DewGew » Tuesday 24 January 2017 9:35

My domofence look like it works but it doesent turn off when I leave the geofence. It turns on when I enter and the test goes weel also.
Any Ideas?

// Pierre
Raspberry Pi 2B - domoticz - Aeon Labs Z-Stick GEN5 - RFlink gateway
NanoPi NEO-air - domoticz - REGO6XX interface

Appesteijn
Posts: 115
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn » Tuesday 24 January 2017 21:17

DewGew wrote:My domofence look like it works but it doesent turn off when I leave the geofence. It turns on when I enter and the test goes weel also.
Any Ideas?

// Pierre
If the test works (also from outside of your house? With no wifi) a connection can be made, 'on' and 'off' are (almost) the same calls to your server.

Do you see anything happening in the log of your domoticz server?

User avatar
DewGew
Posts: 108
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi
Domoticz version: V3.8153
Location: Sweden
Contact:

Re: Geofence for Domoticz

Post by DewGew » Wednesday 25 January 2017 10:00

Appesteijn wrote:
DewGew wrote:My domofence look like it works but it doesent turn off when I leave the geofence. It turns on when I enter and the test goes weel also.
Any Ideas?

// Pierre
If the test works (also from outside of your house? With no wifi) a connection can be made, 'on' and 'off' are (almost) the same calls to your server.

Do you see anything happening in the log of your domoticz server?
The test works outside the wifi zone. In the logg I can see if its switching, but it seems like domoticz sometimes don't get the signal to switch off. I get the notification in my cellphone when im entering or exiting the zone.
But today it worked fine. I hope it stays like that :)

// Pierre
Raspberry Pi 2B - domoticz - Aeon Labs Z-Stick GEN5 - RFlink gateway
NanoPi NEO-air - domoticz - REGO6XX interface

Appesteijn
Posts: 115
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn » Wednesday 25 January 2017 23:05

DewGew wrote:
The test works outside the wifi zone. In the logg I can see if its switching, but it seems like domoticz sometimes don't get the signal to switch off. I get the notification in my cellphone when im entering or exiting the zone.
But today it worked fine. I hope it stays like that :)

// Pierre
Yeah :) keep me posted!

Misterik
Posts: 29
Joined: Sunday 11 December 2016 19:30
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Misterik » Thursday 02 February 2017 22:44

Does anyone what the following error means ?

Code: Select all

{
"message": "WRONG CODE", 
"status": "ERROR", 
"title": "SwitchLight"
}
Since a couple of days my domofence is not working anymore, and when i use the 'test connection' option it return the above message!
RPI-3 + RFLink + NRF24L01
Milight lamps (Wifi Controler v4 & Iboxv6, GU10, MR16, E27, ledstrip)
Kaku devices (APA3-1500, ACM-2300h, AMST-606, AWST-6000, APIR215)

Appesteijn
Posts: 115
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn » Friday 03 February 2017 8:55

Misterik wrote:Does anyone what the following error means ?

Code: Select all

{
"message": "WRONG CODE", 
"status": "ERROR", 
"title": "SwitchLight"
}
Since a couple of days my domofence is not working anymore, and when i use the 'test connection' option it return the above message!
Has the IDX code of your virtual switch changed?

Misterik
Posts: 29
Joined: Sunday 11 December 2016 19:30
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Misterik » Friday 03 February 2017 9:22

Appesteijn wrote:Has the IDX code of your virtual switch changed?
Nope...but i changed my switch to protected and this is what it was causing.
RPI-3 + RFLink + NRF24L01
Milight lamps (Wifi Controler v4 & Iboxv6, GU10, MR16, E27, ledstrip)
Kaku devices (APA3-1500, ACM-2300h, AMST-606, AWST-6000, APIR215)

Appesteijn
Posts: 115
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn » Friday 03 February 2017 14:21

Misterik wrote:
Appesteijn wrote:Has the IDX code of your virtual switch changed?
Nope...but i changed my switch to protected and this is what it was causing.
Aha, ok thanks for sharing the solution :)

blauwebuis
Posts: 154
Joined: Wednesday 21 December 2016 10:11
Target OS: Raspberry Pi
Domoticz version: current
Contact:

Re: Geofence for Domoticz

Post by blauwebuis » Sunday 05 February 2017 15:30

Interesting. I tried the app again, but it doesn't seem to offer an option that only uses cell-towers? And it still requires location permission when I install it.

Are you planning on making a new app that works with celltowers only by any chance?

I recently started using an Android app called WiFiToggle. It disables WiFi when you're not in the vicinity of celltowers that you have marked as beloning to your 'home' or 'work' location (you can add more). It automatically turns on Wifi when I'm close to home, and automatically disables it when I travel around the city.

https://play.google.com/store/apps/deta ... WifiToggle

If that app could also trigger a call to a URL when the state changes, it would be exactly what I am looking for..

So close!

Appesteijn
Posts: 115
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn » Tuesday 07 February 2017 8:55

blauwebuis wrote:Interesting. I tried the app again, but it doesn't seem to offer an option that only uses cell-towers? And it still requires location permission when I install it.

Are you planning on making a new app that works with celltowers only by any chance?
No not at the moment. Don't have much spare time at the moment. If I add new functionality I will start with 'add multiple geofences' in the app.
Your use case does sound fun and interesting to build, but I think it will also be difficult and the user value low.

Peterb
Posts: 3
Joined: Friday 27 January 2017 13:53
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Peterb » Sunday 19 February 2017 21:43

I'm new to Domoticz but very impressed already with the great work done by so many of you. I'm keen on this geofencing concept and would like to use it as a safety feature to switch everything off when I'm away from home. But I think there may be a flaw. If the mobile device fails to get it's message to the server it does not retry and the boundary transition is missed. ( this will depend on the mobile app, but most seem to show this flaw).

Why not make a simple app to just periodically send the mobile location (tracker) and then domoticz can do all the 'heavy lifting'. A virtual device will 'track' the mobile's location and this data can be used to create multiple geofences within domoticz as required.

Any thoughts? Does any app like this exist which can communicate directly with Domoticz?

Thanks for your input.
Peter.

Appesteijn
Posts: 115
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn » Sunday 19 February 2017 23:48

Peterb wrote:I'm new to Domoticz but very impressed already with the great work done by so many of you. I'm keen on this geofencing concept and would like to use it as a safety feature to switch everything off when I'm away from home. But I think there may be a flaw. If the mobile device fails to get it's message to the server it does not retry and the boundary transition is missed. ( this will depend on the mobile app, but most seem to show this flaw).

Why not make a simple app to just periodically send the mobile location (tracker) and then domoticz can do all the 'heavy lifting'. A virtual device will 'track' the mobile's location and this data can be used to create multiple geofences within domoticz as required.

Any thoughts? Does any app like this exist which can communicate directly with Domoticz?

Thanks for your input.
Peter.
Thanks for your remark! If DomoFence doesn't have a data connection available at the moment you cross your geofence, the request is cached and send when a data connection comes available. If your server is down, well then there isn't much switching to do anyway :)

Peterb
Posts: 3
Joined: Friday 27 January 2017 13:53
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Peterb » Monday 20 February 2017 10:46

That makes a lot of sense. I did have an issue where my own server was not quite down but had a temporary routing problem. Is there any ack message from the server to the app so that if the server is 'off-line' the app will continue to retry? I'm asking but in reality this is not a way forward for me as I own an iPhone :?

To be more specific; I'm using the domoticz app for my iPhone and the geofence feature. I left home the other day and it triggered. At some point while I was away something went awry with my home network and the 'return home' event was never logged. I fixed the routing issue but the app didn't retry so I had to manually go into the app and reconfigure the geofence just to get it to tell the server I was at home. An auto-retry plus ack message would have helped in this case.

I realise that my flakey network is a good place to start looking for solutions ;) but also a more robust comms would help in the event of temporary comms failures (of which there are very many kinds). Hence my question about a 'tracker' app for domoticz....

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest