Geofence for Domoticz

Moderator: leecollings

User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Geofence for Domoticz

Post by EdwinK »

it says that everything is okay. (Don't have access right now), but something like that.

Using version 2.8.9

(Update) It seems now to be setting to 'on', but not to 'off'.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

EdKo66 wrote:it says that everything is okay. (Don't have access right now), but something like that.

Using version 2.8.9

(Update) It seems now to be setting to 'on', but not to 'off'.
If you move outside of your geofence you can try to send an 'off' command with the testbutton. If you get a notification that your outside of your geofence, the app tries to send the off command. If it can't (because there is no data connection available) it is try again after a little while. You might have to wait a little bit (see if you have an internet connection when your outside of your geofence) before the switch is really flipped (but it should flip the switch within a minute).
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Geofence for Domoticz

Post by EdwinK »

Going to try this later. Now I'm unfortunately bound to the house :(
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
ensingg
Posts: 65
Joined: Saturday 22 April 2017 17:35
Target OS: Windows
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by ensingg »

I am new to geofencing and Domoticz.

My Samsung Galaxy S7 runs with Android Nougat 7.0

When I use geofencing from M. Suurmond or the normal Domoticz Android version for geofencing. I have the same problem.

The phone is laying in house and not moving. But Every once and a while the geofencing says it that I left the geofence area. And in the same minute I am back in the area.

Looked at all power save options. But the program is not affected by that.

Maybe that the program is detecting no gps and sees that as my new position?

Please help. The geofence option is not working for me and I need it.
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

ensingg wrote:I am new to geofencing and Domoticz.

My Samsung Galaxy S7 runs with Android Nougat 7.0

When I use geofencing from M. Suurmond or the normal Domoticz Android version for geofencing. I have the same problem.

The phone is laying in house and not moving. But Every once and a while the geofencing says it that I left the geofence area. And in the same minute I am back in the area.

Looked at all power save options. But the program is not affected by that.

Maybe that the program is detecting no gps and sees that as my new position?

Please help. The geofence option is not working for me and I need it.
This is usually because in 'power-save' mode the localisation depends on cell-tower signals. When you phone switches from cell-tower, you phone thinks it's location has changed and moves you out of your geofence. Domofence can't do anything about this.

Best thing to do is to use a large radius (eg 1500 meters) and/or switch only after your phone(s) are away for more then 1 or 2 minutes.
ensingg
Posts: 65
Joined: Saturday 22 April 2017 17:35
Target OS: Windows
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by ensingg »

"This is usually because in 'power-save' mode the localisation depends on cell-tower signals. When you phone switches from cell-tower, you phone thinks it's location has changed and moves you out of your geofence. Domofence can't do anything about this.

Best thing to do is to use a large radius (eg 1500 meters) and/or switch only after your phone(s) are away for more then 1 or 2 minutes."

So the solutions is to not react to sudden changes. Wait if a switch is in a specific state for more time.

I want to use it to open my electronic gate when I am near my home. The gate clothes automatically after 2 minutes of openening.

Isn't it better to let the geofence detecting mechanisme deal with it?

btw. Domoticz app is excluded from battery safe mode. Do I need to excluse more from this mode.
zicht
Posts: 251
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: Geofence for Domoticz

Post by zicht »

I use another approach for the same goal because of all the Samsung Galaxy S7 with Android Nougat 7.0 problems
(wifi and GPS power savings active : even when all powersavings are disabled in settings, causing Wifi and GPS sensor to be polled only periodicaly in sleep mode, what makes geofences and pings unreliable )

With Tasker I detect if wifinear (home SSID) or not, if so i set a uservar with the SSID of the wifi (json) and reset the uservar when not near the Wifi network. This works well for now and pretty accurate and fast. For me this turns out to be the only reliable way at the moment.
The only problem sometime occur if tasker tries to send during wifi negotiation/connect on arrival or depart. To avoid this i use a wait for a couple of seconds. This saves also battery as i do not use the GPS constantly ;)

Maybe the app could use a similar or combination of with methode to detect to be near the home SSID what is allready known in all cases (home network detection)
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

zicht wrote:I use another approach for the same goal because of all the Samsung Galaxy S7 with Android Nougat 7.0 problems
(wifi and GPS power savings active : even when all powersavings are disabled in settings, causing Wifi and GPS sensor to be polled only periodicaly in sleep mode, what makes geofences and pings unreliable )

With Tasker I detect if wifinear (home SSID) or not, if so i set a uservar with the SSID of the wifi (json) and reset the uservar when not near the Wifi network. This works well for now and pretty accurate and fast. For me this turns out to be the only reliable way at the moment.
The only problem sometime occur if tasker tries to send during wifi negotiation/connect on arrival or depart. To avoid this i use a wait for a couple of seconds. This saves also battery as i do not use the GPS constantly ;)

Maybe the app could use a similar or combination of with methode to detect to be near the home SSID what is allready known in all cases (home network detection)
It is true that in Android 7.0 you can no longer send http-requests in the background, but you have to 'ask the phone' to schedule this call. That has been in the latest updates of domofence. So if you cross you geofence, a http-request is scheduled and send when your phone allows it. Domofence should work correctly (or even better) with Android 7.0 as it did before. Even after a reboot a http-request is send (only if it couldn't send it before) and a geofence is re-registered.
zicht
Posts: 251
Joined: Sunday 11 May 2014 11:09
Target OS: Windows
Domoticz version: 2023.1+
Location: NL
Contact:

Re: Geofence for Domoticz

Post by zicht »

That is great, tnx !
Rpi & Win x64. Using : cam's,RFXCom, LaCrosse, RFY, HuE, google, standard Lua, Tasker, Waze traveltime, NLAlert&grip2+,curtains, vacuum, audioreceiver, smart-heating&cooling + many more (= automate all repetitive simple tasks)
User avatar
thecosmicgate
Posts: 188
Joined: Monday 06 April 2015 14:37
Target OS: Linux
Domoticz version: newest
Location: The Netherlands / Hoeven
Contact:

Re: Geofence for Domoticz

Post by thecosmicgate »

Does anybody know a solution : geofence switches okay when connected to the 4g connection this because of the HTTPS (444) port I use. But when the WiFi is in range and connected this HTTPS port isn't available anymore and changed to http (8080) so the change isn't send to domoticz .

As a workaround a can change the radius to 400 m so it's not possible that the phone is connected to the WiFi signal. But it should be better/nicer .
So if it's possible to send the On / off signal to 2 different ports or addresses would be the solution (for me )

Sent from my SM-G935F using Tapatalk
It's nice to be important, but it's more important to be nice
Scooter ;)
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

thecosmicgate wrote:Does anybody know a solution : geofence switches okay when connected to the 4g connection this because of the HTTPS (444) port I use. But when the WiFi is in range and connected this HTTPS port isn't available anymore and changed to http (8080) so the change isn't send to domoticz .

As a workaround a can change the radius to 400 m so it's not possible that the phone is connected to the WiFi signal. But it should be better/nicer .
So if it's possible to send the On / off signal to 2 different ports or addresses would be the solution (for me )

Sent from my SM-G935F using Tapatalk
Why can't you reach port extern_ip:444 from within your LAN?
User avatar
thecosmicgate
Posts: 188
Joined: Monday 06 April 2015 14:37
Target OS: Linux
Domoticz version: newest
Location: The Netherlands / Hoeven
Contact:

Re: Geofence for Domoticz

Post by thecosmicgate »

Appesteijn wrote:
thecosmicgate wrote:Does anybody know a solution : geofence switches okay when connected to the 4g connection this because of the HTTPS (444) port I use. But when the WiFi is in range and connected this HTTPS port isn't available anymore and changed to http (8080) so the change isn't send to domoticz .

As a workaround a can change the radius to 400 m so it's not possible that the phone is connected to the WiFi signal. But it should be better/nicer .
So if it's possible to send the On / off signal to 2 different ports or addresses would be the solution (for me )

Sent from my SM-G935F using Tapatalk
Why can't you reach port extern_ip:444 from within your LAN?
Because port redirection ( on the firewall)

Sent from my SM-G935F using Tapatalk
It's nice to be important, but it's more important to be nice
Scooter ;)
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

thecosmicgate wrote:
Appesteijn wrote:
Why can't you reach port extern_ip:444 from within your LAN?
Because port redirection ( on the firewall)

Sent from my SM-G935F using Tapatalk
But you should be able to reach your external ip also from within your LAN or doesn't your router allow that?
User avatar
thecosmicgate
Posts: 188
Joined: Monday 06 April 2015 14:37
Target OS: Linux
Domoticz version: newest
Location: The Netherlands / Hoeven
Contact:

Re: Geofence for Domoticz

Post by thecosmicgate »

That's indeed supported but the 443 port is already used for some other programme that's why external 444 is needed

Sent from my SM-G935F using Tapatalk
It's nice to be important, but it's more important to be nice
Scooter ;)
sjoerd1953
Posts: 11
Joined: Monday 09 January 2017 9:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Swolgen
Contact:

Re: Geofence for Domoticz

Post by sjoerd1953 »

I have a question about the server address that is required in the DomoFence app. It may have been asked before, it is a long thread. If it has I apologize beforehand.

At first I entered the private IP address of my Raspberry Pi (192.168.xxx.xxx:8080) and that seemed to work fine until I left my home and lost the connection. When I entered the public IP address I of my modem/router and forwarded that to the address of the Raspberry Pi it works as expected. I get my public IP by DHCP so it might change when I reboot the modem. Further on I am not comfortable with exposing my public IP address in an app.

My question is: is that really how it is supposed to be done?
Sjoerd van Staveren

Domoticz running on a Raspberry Pi 3; Milight RGBW and Dual White bulbs; RFXcom XL;HOMEeasy switch; Flamingo switches; Sonoff switches
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

sjoerd1953 wrote:I have a question about the server address that is required in the DomoFence app. It may have been asked before, it is a long thread. If it has I apologize beforehand.

At first I entered the private IP address of my Raspberry Pi (192.168.xxx.xxx:8080) and that seemed to work fine until I left my home and lost the connection. When I entered the public IP address I of my modem/router and forwarded that to the address of the Raspberry Pi it works as expected. I get my public IP by DHCP so it might change when I reboot the modem. Further on I am not comfortable with exposing my public IP address in an app.

My question is: is that really how it is supposed to be done?
You can use https but then the app still needs to know where your server is to contact it, so yes that is how it should be done.
sjoerd1953
Posts: 11
Joined: Monday 09 January 2017 9:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Swolgen
Contact:

Re: Geofence for Domoticz

Post by sjoerd1953 »

OK, thanks.
Sjoerd van Staveren

Domoticz running on a Raspberry Pi 3; Milight RGBW and Dual White bulbs; RFXcom XL;HOMEeasy switch; Flamingo switches; Sonoff switches
titof2375
Posts: 1
Joined: Saturday 05 August 2017 14:00
Target OS: -
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by titof2375 »

Hello i just installed geofence and i just can not get it done. For accede a domoticz I do not pass no ip, I enter the address of no ip in geofence. I have a mistake: conet time out, it means what thanks
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

titof2375 wrote:Hello i just installed geofence and i just can not get it done. For accede a domoticz I do not pass no ip, I enter the address of no ip in geofence. I have a mistake: conet time out, it means what thanks
That the app can't reach your server or your server is not responding on that port. You could try to check by using the no ip and port in your browser and see what happens.
leon33
Posts: 6
Joined: Thursday 31 August 2017 13:24
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.8153
Contact:

Re: Geofence for Domoticz

Post by leon33 »

Hello, i just installed geofence. But i can get it working. when i enter the geozone it give the message that i'm entered but it doesn't switch the switch.

if i test then i get the message Error:http://----------json.htm?type=command&param=switchlight&idx=1187&switchcmd=on

if i test direct in browser i got
{
"message" : "Error sending switch command, check device/hardware !",
"status" : "ERROR",
"title" : "SwitchLight"
}

The port is open because i can reach it, authenticatie is on basic auth. and i created a new dummy on/off light switch.

What am i doing wrong?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest