Geofence for Domoticz

Moderator: leecollings

Deluka
Posts: 19
Joined: Thursday 03 March 2016 18:38
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Closed by peer

Post by Deluka »

When i set things up using http the app works but when i try to use https i get a error connect closed by peer.
Checking the cert using chrome on a win machine it tells me its secure.
The dz log is not reporting faild logins.
Anyone any idea what is going wrong
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

I have just put a version in beta that should work correctly on Android 8+. As I don't have an Android 8+ phone, please let me know if it works, thank you!
mic71
Posts: 5
Joined: Sunday 25 March 2018 21:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by mic71 »

Thanks appesteijn the app work like a sharm on my and my wife's galaxy s8 wit android 8 thanks again for your work

Verstuurd vanaf mijn SM-G955F met Tapatalk

marcpos
Posts: 7
Joined: Friday 08 January 2016 8:35
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by marcpos »

mic71 wrote: Tuesday 10 July 2018 18:39 Thanks appesteijn the app work like a sharm on my and my wife's galaxy s8 wit android 8 thanks again for your work ImageImage

Verstuurd vanaf mijn SM-G955F met Tapatalk
On my S8 with Oreo it's also working great since the last update. Thanks!!! :)
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

Good to hear!
HJvD
Posts: 6
Joined: Wednesday 24 October 2018 14:27
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Contact:

Re: Geofence for Domoticz

Post by HJvD »

Hi,

Installed Domofence (on a Nokia 7 plus with Android 9). The virtual switch can be toggled bij Domofence by using the testing button in Domofence. So far so good. But when testing (walk in and out the geofence with my phone) nothing is happening. In my case the lamp outside my house has to switch on. After unlocking my phone the lamp is switched on immediately. So I set Domofence not te be controlled by the battery saving from Android and also that it can always use the data. So far no improvement. What can I do to make it work? Any ideas?

Edit: found that something is happening. When I switch notifications on, i find that entering or leaving the fence is noticed by the app, so I think a command is send to Domoticz. Next thing I noticed is that the virtual switch is toggled after ten minutes or something.
rednas
Posts: 132
Joined: Tuesday 20 October 2015 12:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Geofence for Domoticz

Post by rednas »

Is it possible to add multiple geofences?
Or is the only possibility the Domoticz app itself which costs 7.50?
DutchHans
Posts: 230
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany (near dutch border)
Contact:

Re: Geofence for Domoticz

Post by DutchHans »

Try egigeofence from the appstore.. its free and works.
Alternatively you can use locative.. also free and works too.

Cheers, Hans
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

rednas wrote: Tuesday 04 December 2018 12:03 Is it possible to add multiple geofences?
Or is the only possibility the Domoticz app itself which costs 7.50?
DomoFence only supports 1 geofence, at this moment I don't have time to add functionalities.
User avatar
Siewert308SW
Posts: 290
Joined: Monday 29 December 2014 15:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

Re: Geofence for Domoticz

Post by Siewert308SW »

Since a couple of days i installed DomoFence beta on three phones (mine, wife and daughter)
What i have noticed:
Samsung S7 Android 8: Is working but not always
Samsung j5 Android 8.1: Only ON trigger works
HTC m9 Android 7 not fully tested yet

But leaving the fence my phone DomoFence detects and sends the http request
But leaving the fence with my wife here phone doesn't detect or doesn't/can't send the http request
When we came home my phone sended a On request instant while my wife here phone after a couple of hours still didn't
Don't know if it's the Android Background running policy or something else.
But apps are setup the same.

Running my own VPN with PiVPN and running openvpn on all phones.
And DomoFence there for connects to the local network IP no matter where we are in the world. ;-)

Second thing i noticed the DomoFence app doesn't check the current dummy device status, right.
If i test the connection the ON request is send and the dummy is changed to ON while it was ON same counts for leaving and entering the Fence fiscally.
Wouldn't it be better to check status before sending a request?
Same as for a missed request to let the app wake up phone with a by user or fixed wakelock to check the fence and switch the dummy?
Setup:
- RPi4 - Domo Stable / Aeotec Z-stick7 / PiHole Unbound Gemini
- RPi4 - PiHole / PiVPN Unbound Gemini
- Synology DS923+ / DS218j
- P1 Gas/Power, SmartGateway watermeter
- Fibaro switches, contacts, plugs, smoke/Co2 ect
- rootfs @ USB HDD
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

Could you try without the vpn? Just to rule out the possibility that the VPN messes up the call. The http request is scheduled to also have a data connection available, maybe in combination with the VPN this doesn't work always?

Is it possible to check power-saving options or location options for the app specifically?

How large is you radius? I have 1500 meters and that is usually enough to get it triggered before I'm home.

It is correct that the app doesn't check the current status, but just fires a ON or a OFF when entering/leaving.
User avatar
Siewert308SW
Posts: 290
Joined: Monday 29 December 2014 15:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

Re: Geofence for Domoticz

Post by Siewert308SW »

Yesterday I tried with and without a VPN connection and all phone set to 800m as further away isn't possible.
Then my phone will be home while I'm at work.
No phone in my house reacts like it should do.
Could be a android issue due to its background policy.
But not sure but it's for sure my VPN ain't the culprit.

At the moment testing with Tasker for which I wrote a profile.
Although I hate tasker due to its battery consumption it does the job well at a radius of 200mtr.
And set net check at 5min which is normally 60seconds.
Setup:
- RPi4 - Domo Stable / Aeotec Z-stick7 / PiHole Unbound Gemini
- RPi4 - PiHole / PiVPN Unbound Gemini
- Synology DS923+ / DS218j
- P1 Gas/Power, SmartGateway watermeter
- Fibaro switches, contacts, plugs, smoke/Co2 ect
- rootfs @ USB HDD
manutremo
Posts: 69
Joined: Saturday 19 November 2016 17:02
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by manutremo »

In case it may help... I had a similar issue, my phone worked correctly, my wife's worked when at home but not when out of home. After a lot of investigation, it turned out to be a "%" character in the domoticz password, in conjunction with authentication set to be only required when connected from an external ip. Once I removed that character, everything started to work properly.

Why was this character illegal in one phone and not in the other? No idea. But turned me crazy for months.
manutremo
Posts: 69
Joined: Saturday 19 November 2016 17:02
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by manutremo »

By the way - personally I would leave the present setup that on and off fence notifications are always sent whichever the current status of the switch is. This allows Domoticz to record the time of each change in case it's needed. At most, I would recommend leaving this as an option.
User avatar
Siewert308SW
Posts: 290
Joined: Monday 29 December 2014 15:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

Re: Geofence for Domoticz

Post by Siewert308SW »

manutremo wrote: Tuesday 08 January 2019 14:52 In case it may help... I had a similar issue, my phone worked correctly, my wife's worked when at home but not when out of home. After a lot of investigation, it turned out to be a "%" character in the domoticz password, in conjunction with authentication set to be only required when connected from an external ip. Once I removed that character, everything started to work properly.

Why was this character illegal in one phone and not in the other? No idea. But turned me crazy for months.
Thx for the tip but my password doesn't contain any upper characters.
Just plain characters met some in tab.
Setup:
- RPi4 - Domo Stable / Aeotec Z-stick7 / PiHole Unbound Gemini
- RPi4 - PiHole / PiVPN Unbound Gemini
- Synology DS923+ / DS218j
- P1 Gas/Power, SmartGateway watermeter
- Fibaro switches, contacts, plugs, smoke/Co2 ect
- rootfs @ USB HDD
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

Siewert308SW wrote: Tuesday 08 January 2019 19:04 Thx for the tip but my password doesn't contain any upper characters.
Just plain characters met some in tab.
Some investigation steps I thought of:

- You could check the domoticz logs to see if the requests reaches the domoticz server?

- If your wife is outside of the geofence, does the test button send a OFF command? If not Domofence still thinks your inside of the geofence. The status of the test button should also change when in- or outside of the geofence.
User avatar
Siewert308SW
Posts: 290
Joined: Monday 29 December 2014 15:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

Re: Geofence for Domoticz

Post by Siewert308SW »

Appesteijn wrote: Wednesday 09 January 2019 7:33
Siewert308SW wrote: Tuesday 08 January 2019 19:04 Thx for the tip but my password doesn't contain any upper characters.
Just plain characters met some in tab.
Some investigation steps I thought of:

- You could check the domoticz logs to see if the requests reaches the domoticz server?

- If your wife is outside of the geofence, does the test button send a OFF command? If not Domofence still thinks your inside of the geofence. The status of the test button should also change when in- or outside of the geofence.
Test button outside the geofence with connection via a VPN or not via VPN does work...
Setup:
- RPi4 - Domo Stable / Aeotec Z-stick7 / PiHole Unbound Gemini
- RPi4 - PiHole / PiVPN Unbound Gemini
- Synology DS923+ / DS218j
- P1 Gas/Power, SmartGateway watermeter
- Fibaro switches, contacts, plugs, smoke/Co2 ect
- rootfs @ USB HDD
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

Siewert308SW wrote: Wednesday 09 January 2019 7:37 Test button outside the geofence with connection via a VPN or not via VPN does work...
What is the response you get in domofence? Do you use https?
User avatar
Siewert308SW
Posts: 290
Joined: Monday 29 December 2014 15:47
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: The Netherlands
Contact:

Re: Geofence for Domoticz

Post by Siewert308SW »

Appesteijn wrote: Wednesday 09 January 2019 9:13
Siewert308SW wrote: Wednesday 09 January 2019 7:37 Test button outside the geofence with connection via a VPN or not via VPN does work...
What is the response you get in domofence? Do you use https?
Don't use https and response is as expected when pressing the test button.
On when inside the fence and Off when outside the fence.
But would this point to the culprit as the screen/device is awake with the app running in the foreground
Setup:
- RPi4 - Domo Stable / Aeotec Z-stick7 / PiHole Unbound Gemini
- RPi4 - PiHole / PiVPN Unbound Gemini
- Synology DS923+ / DS218j
- P1 Gas/Power, SmartGateway watermeter
- Fibaro switches, contacts, plugs, smoke/Co2 ect
- rootfs @ USB HDD
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

Siewert308SW wrote: Wednesday 09 January 2019 19:49
Appesteijn wrote: Wednesday 09 January 2019 9:13
Siewert308SW wrote: Wednesday 09 January 2019 7:37 Test button outside the geofence with connection via a VPN or not via VPN does work...
What is the response you get in domofence? Do you use https?
Don't use https and response is as expected when pressing the test button.
On when inside the fence and Off when outside the fence.
But would this point to the culprit as the screen/device is awake with the app running in the foreground
Hmm at least domofence than correctly thinks you are in/outside of the geofence. If you had domofence in the background while crossing the geofence that looks like it works correctly, maybe android terminates it when it is in the background for a longer time. To see that you should check the app if you cross the geofence but the switch is not switched. If the test button is ON/OFF correctly the app has gotten the correct status from Android, but sending the http request has failed somewhere.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests