Geofence for Domoticz

deennoo
Posts: 937
Joined: Wednesday 10 December 2014 14:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: Geofence for Domoticz

Post by deennoo » Monday 13 November 2017 16:55

Appesteijn wrote:
CreatoX wrote:
Saturday 11 November 2017 16:39
Mobile: Samsung Galaxy A5
Android version: 7.0
Domofence version: 2.9.0
Geofence radius: 500

Anyone who can help me with the following issue:

When entering the geofence, nothing happens. Using a fake gps program, it switches on or off instantly.
But, when using the build in gps, nothing happens. Even started Google Maps, showing my phone is at home, it does not trigger Domofence to update the switch.
What if you set the radius to 1500 ?
Problème is that app doesn't run gps, as can do waze or maps...i'm using geofence to open garage door when i'm on a gps point near home. I need à small radius (50m)

Envoyé de mon MI 6 en utilisant Tapatalk

Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / ESP8266 / MQTT / BLE
http://domo-attitude.fr

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

Re: Geofence for Domoticz

Post by Appesteijn » Tuesday 14 November 2017 8:41

deennoo wrote:
Monday 13 November 2017 16:55
Appesteijn wrote:
CreatoX wrote:
Saturday 11 November 2017 16:39
Mobile: Samsung Galaxy A5
Android version: 7.0
Domofence version: 2.9.0
Geofence radius: 500

Anyone who can help me with the following issue:

When entering the geofence, nothing happens. Using a fake gps program, it switches on or off instantly.
But, when using the build in gps, nothing happens. Even started Google Maps, showing my phone is at home, it does not trigger Domofence to update the switch.
What if you set the radius to 1500 ?
Problème is that app doesn't run gps, as can do waze or maps...i'm using geofence to open garage door when i'm on a gps point near home. I need à small radius (50m)

Envoyé de mon MI 6 en utilisant Tapatalk
But with the large radius, you could see if the geofence functionality works or not. Maybe your phone can't get a accurate fix where you live (without using a lot of power/gps)

CreatoX
Posts: 11
Joined: Wednesday 22 March 2017 16:41
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by CreatoX » Tuesday 14 November 2017 8:44

Setting the radius to 1500 does not matter.

I must say domofence is working when leaving the geofence location. So the (virtual) switch is turned off. But when entering the geofence it never turns on.

Did not test it when running waze ore maps when entering the geofence. Maybe this is working, I will test it, but when this works, this is not how I want to use it.
Thereby, when I'm at home (center of the geofence) and the switch is off, opening Google Maps showing my location based on GPS, then the switch still stays off. Also Google location history is working fine.

Can it be Domofence is going in some sort of stanby/sleep modus when the phone is not used for some time? If so, how should this be set? How can I keep domofence 'awake' all the time?

deennoo
Posts: 937
Joined: Wednesday 10 December 2014 14:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: Geofence for Domoticz

Post by deennoo » Tuesday 14 November 2017 9:50

CreatoX wrote:
Tuesday 14 November 2017 8:44
Setting the radius to 1500 does not matter.

I must say domofence is working when leaving the geofence location. So the (virtual) switch is turned off. But when entering the geofence it never turns on.
Same for me, can be good if we can have some app log to check what happen

There is my virtual switch log :
geofence.PNG
geofence.PNG (38.68 KiB) Viewed 2552 times
probleme is the same for domoticz android app and domofence, using api can be good when user is walking or riding a bike, but when driving a car or a mortorcycle, it doesn't look to be quicker as it have to
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / ESP8266 / MQTT / BLE
http://domo-attitude.fr

CreatoX
Posts: 11
Joined: Wednesday 22 March 2017 16:41
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by CreatoX » Wednesday 15 November 2017 14:35

deennoo wrote:
Tuesday 14 November 2017 9:50
CreatoX wrote:
Tuesday 14 November 2017 8:44
Setting the radius to 1500 does not matter.

I must say domofence is working when leaving the geofence location. So the (virtual) switch is turned off. But when entering the geofence it never turns on.
Same for me, can be good if we can have some app log to check what happen

There is my virtual switch log :
geofence.PNG

probleme is the same for domoticz android app and domofence, using api can be good when user is walking or riding a bike, but when driving a car or a mortorcycle, it doesn't look to be quicker as it have to
Because of all testing my log does not represent a good overview. I cleared the log and shall put te results in a couple of days.
I also got an old mobile with android 5.0.2. I shall install Domofence on this device also. Maybe we can figure out if it has something to do with the Android version.

deennoo
Posts: 937
Joined: Wednesday 10 December 2014 14:06
Target OS: Linux
Domoticz version: beta
Location: Bordeaux France
Contact:

Re: Geofence for Domoticz

Post by deennoo » Wednesday 15 November 2017 14:45

CreatoX wrote:
deennoo wrote:
Tuesday 14 November 2017 9:50
CreatoX wrote:
Tuesday 14 November 2017 8:44
Setting the radius to 1500 does not matter.

I must say domofence is working when leaving the geofence location. So the (virtual) switch is turned off. But when entering the geofence it never turns on.
Same for me, can be good if we can have some app log to check what happen

There is my virtual switch log :
geofence.PNG

probleme is the same for domoticz android app and domofence, using api can be good when user is walking or riding a bike, but when driving a car or a mortorcycle, it doesn't look to be quicker as it have to
Because of all testing my log does not represent a good overview. I cleared the log and shall put te results in a couple of days.
I also got an old mobile with android 5.0.2. I shall install Domofence on this device also. Maybe we can figure out if it has something to do with the Android version.
I'm running Android 7, à good option can be to set multiple geofence, and allow to choose between API or gps
Domoticz stable 3.5877 for real & Domoticz beta for test
Rfxtrxe / RFLink / Milight / Yeelight / ESP8266 / MQTT / BLE
http://domo-attitude.fr

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

Re: Geofence for Domoticz

Post by Appesteijn » Wednesday 15 November 2017 23:29

I did just released a new beta version that uses new libraries. Maybe you could add yourself to this beta (in the Play store)?

CreatoX
Posts: 11
Joined: Wednesday 22 March 2017 16:41
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by CreatoX » Saturday 18 November 2017 20:49

After a couple of days, and not opening the Domofence App, nothing has been logged. Om my other phone (Android 5) it works like a charm.
There must be something in the new Android versions and I found this:

https://android.gadgethacks.com/how-to/ ... s-0168960/

It has something to do with Doze and App Standby. I just configured this and hope this is given me the expected results. Keep you updated.

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

Re: Geofence for Domoticz

Post by Appesteijn » Sunday 19 November 2017 9:01

Thanks! There were some changes in Android 7.0 that were fixed with the 2.9.0 version of DomoFence. But if I read your link Dozing is for more 'agressive'.

Please keep us posted on your results!

dizzyweb
Posts: 20
Joined: Tuesday 20 June 2017 13:46
Target OS: Linux
Domoticz version: 4.10007
Contact:

Re: Geofence for Domoticz

Post by dizzyweb » Wednesday 29 November 2017 20:12

Updated my OnePlus 3 to Android Oreo a few days... and Domofence stopped working.

I do get an error every reboot:
"Unknown Error: the Geofence service is not available now. 0"

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

Re: Geofence for Domoticz

Post by Appesteijn » Thursday 30 November 2017 8:50

And what happens when you manually add the geofence after a few minutes?

dizzyweb
Posts: 20
Joined: Tuesday 20 June 2017 13:46
Target OS: Linux
Domoticz version: 4.10007
Contact:

Re: Geofence for Domoticz

Post by dizzyweb » Wednesday 06 December 2017 10:39

Doesn't work. But, the connection test option doesn't work either, it is always set to OFF. It does toggle the dummy off when it's on though, but it never switches to "Test connection (ON)".

However, the geofence bit simply doesn't work. I'm using the domoticz app now, but that simply less reliable. It keeps on switching on when I'm already in the fence (could be worse though, could be toggling it off and on like it used to).

User avatar
jannl
Posts: 955
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Geleen
Contact:

Re: Geofence for Domoticz

Post by jannl » Friday 08 December 2017 10:42

Because results with the domoticz app regarding geofence are not so good, I am now trying domofence. However with the same settings as the app (ports, password etc) it does not work. Testing gives an error. I more than triple checked the settings.

I am using an s7 and android 7.0.

Jan


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

Re: Geofence for Domoticz

Post by Appesteijn » Saturday 09 December 2017 11:40

dizzyweb wrote:
Wednesday 06 December 2017 10:39
Doesn't work. But, the connection test option doesn't work either, it is always set to OFF. It does toggle the dummy off when it's on though, but it never switches to "Test connection (ON)".

However, the geofence bit simply doesn't work. I'm using the domoticz app now, but that simply less reliable. It keeps on switching on when I'm already in the fence (could be worse though, could be toggling it off and on like it used to).
The test button reflects if you are inside or outside the geofence (at least where your phone thinks it is). So if you can only press 'OFF', your phone thinks it is outside of the geofence.
jannl wrote:
Friday 08 December 2017 10:42
Because results with the domoticz app regarding geofence are not so good, I am now trying domofence. However with the same settings as the app (ports, password etc) it does not work. Testing gives an error. I more than triple checked the settings.

I am using an s7 and android 7.0.

Jan
Are you using 'Basic auth' ? What happens if you go to

Code: Select all

http://_your_server_ip:_port/json.htm?type=command&param=switchlight&idx=_your_idx&switchcmd=On
in the browser on your phone?
Last edited by Appesteijn on Sunday 10 December 2017 0:13, edited 1 time in total.

User avatar
jannl
Posts: 955
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Geleen
Contact:

Re: Geofence for Domoticz

Post by jannl » Saturday 09 December 2017 15:51

When I issue that command locally I get an error. Status ERR

Edit: according to the manual a command should be added. When I add for instance switchcmd=Toggle it works. So it seems to me something is wrong in the command

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

Re: Geofence for Domoticz

Post by Appesteijn » Sunday 10 December 2017 0:14

jannl wrote:
Saturday 09 December 2017 15:51
When I issue that command locally I get an error. Status ERR

Edit: according to the manual a command should be added. When I add for instance switchcmd=Toggle it works. So it seems to me something is wrong in the command
Forgot to add the last part:

Code: Select all

http(s)://_your_server_ip_:_port_/json.htm?type=command&param=switchlight&idx=_your_idx_&switchcmd=_On_
This is what the app sends to you server. If you can use it in your browser from your phone, your phone can connect to domoticz and the app should also be able to send it.

User avatar
jannl
Posts: 955
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Geleen
Contact:

Re: Geofence for Domoticz

Post by jannl » Friday 15 December 2017 8:18

I changed to basic auth and now it works.

Problem is, when I am in my car which has a wifi access point without internet access and I forget to turn of my phone's wifi, domofence sends the correct string but it never arrives at my Domoticz.

Isn't it possible to add some sort of check? For instance check in predefined intervals if the configured switch in the state according to the fence settings until it is verified the state of the switch is correct?

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

Re: Geofence for Domoticz

Post by Appesteijn » Friday 15 December 2017 23:01

jannl wrote:
Friday 15 December 2017 8:18
I changed to basic auth and now it works.

Problem is, when I am in my car which has a wifi access point without internet access and I forget to turn of my phone's wifi, domofence sends the correct string but it never arrives at my Domoticz.

Isn't it possible to add some sort of check? For instance check in predefined intervals if the configured switch in the state according to the fence settings until it is verified the state of the switch is correct?
The app already caches a geofence transition if there is no data connection available, I'll have a look if it is easy to check the response of a request. Data connections also cost battery so I want to avoid those.

User avatar
jannl
Posts: 955
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Geleen
Contact:

Re: Geofence for Domoticz

Post by jannl » Sunday 17 December 2017 11:40

I understand. The in this is that the phone has a networkconnection, but accesspoint has no internetconnection.

So for me a optional setting to check regularly if the switch is in the correct state would be nice. Either on regular intervals or on increasing intervals, until the switch reaches the state it is supposed to have. Also a limit on the time could be wise.

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

Re: Geofence for Domoticz

Post by blauwebuis » Sunday 17 December 2017 12:08

Here's how I created privacy friendy geo-fencing:

- Installed an app on my phone that turns the wifi on or off depending on nearby cell towers.
- Check for phone presence on the network.

This works without any cloud service, and stops wifi tracking when out and about at the same time.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests