Geofence for Domoticz

Moderator: leecollings

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

Re: Geofence for Domoticz

Post by Appesteijn »

jcjames13009 wrote:Still investigating on the different posible ways to use GeoFnce. I wonder if there is possibility to set-up several GeoFences or to have different Radius values to manage actions depending on how far we are from home.

Example:
- Switch heating on when I'm at 2km from home
- Open blinds when I'm at 200m from home
- Open garage door when I'm in front of my house
- etc...

Thanks for feedback

JC
It is possible to add multiple geofences, but I'm not sure if they can inside each other. Beside that I'm not sure how to keep the app super simple (UI wise) and support multiple geofences. I'll have a look at it.
User avatar
jcjames13009
Posts: 33
Joined: Monday 09 March 2015 15:24
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: France / Marseille
Contact:

Re: Geofence for Domoticz

Post by jcjames13009 »

Appesteijn wrote: Beside that I'm not sure how to keep the app super simple (UI wise) and support multiple geofences. I'll have a look at it.
Hi

Always the same dilemma :D

Thanks Appesteijn for having alook at it. If you need help to test feel free to ask me.

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

Re: Geofence for Domoticz

Post by Appesteijn »

At the moment I'm working on another app (too much idea's and too little time), so for now I won't be adding multiple geofences. Maybe in my vacation around christmas.
User avatar
jcjames13009
Posts: 33
Joined: Monday 09 March 2015 15:24
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: France / Marseille
Contact:

Re: Geofence for Domoticz

Post by jcjames13009 »

Hi Appesteijn

No pb Christmas is not so far from now :D

I have enough to play with the present feature fro the moment :P

Thanks again

JC
free_nsc
Posts: 36
Joined: Friday 19 December 2014 0:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by free_nsc »

Great work!
I am having problem getting this working. It looks like the switch command is not recognizing the switchlight parameters. Anyone else having this problem as well?

Code: Select all

2015-12-07 15:09:02.731 User: admin initiated a switch command
2015-12-07 15:09:02.732 Error: Switch command not send!, Hardware device disabled or not found!
I tried to issue the following API call and same error:

Code: Select all

/json.htm?type=command&param=switchlight&idx=99&switchcmd=Off
Checked Idx is fine - it just doesn't know this api call from what I can see. I was able to get it on /off with the following command:

Code: Select all

/json.htm?type=command&param=udevice&idx=501&svalue=On
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

Did you create the right type of virtual switch ? It should be a:

' Create a virtual switch that DomoFence will trigger

Go to 'Setup -> Hardware' and add a 'Dummy device'
Go to 'Switches' and add a 'Manual light/switch'
Select the right 'Hardware' and 'On/Off' the rest doesn't matter.
Add the device
Now go to 'Setup -> Devices' and note the 'Idx' of the switch you just created. '
free_nsc
Posts: 36
Joined: Friday 19 December 2014 0:09
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by free_nsc »

Ok, this is weird. I already had dummy hardware so just created new device for the x10 on/off switch and this did not work. I have however just tried to create new hardware and it worked straight in! Ignore the post :) seems ok now
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

free_nsc wrote:Ok, this is weird. I already had dummy hardware so just created new device for the x10 on/off switch and this did not work. I have however just tried to create new hardware and it worked straight in! Ignore the post :) seems ok now
Hmm strange indeed, but good to hear it works!
neutreno
Posts: 1
Joined: Wednesday 11 November 2015 18:13
Target OS: Linux
Domoticz version:
Contact:

Error: SSL handshake timed out

Post by neutreno »

Thanks for making DomoFence.

I got the geofence working with HTTP, but obviously no Domoticz user should be sending the password to control their home by an insecure method, other than to test the system perhaps.

The issue I have is that HTTPS does not work, yet works fine in my mobile web browser. When I touch the test button, I get 'Error: SSL handshake timed out'. I'm using the new inbuilt Domoticz HTTPS setup (no nginx). Any ideas?

EDIT: DomoFence appears to be incompatible with the default inbuilt SSL setup in the latest version of Domoticz. I think there should at least be a note on the Wiki to make users aware of this. Using Nginx SSL reverse proxy works fine with Domofence and the latest Domoticz with its inbuilt SSL service disabled.
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

Thanks for your research, I'll see what I can do to build support for this.

*edit: I just added this to the wiki page. I think you get this timeout because the certificate of https://your-own-domoticz is issued for *.domoticz.com and not for your domain.

Is this also your case?
User avatar
RoadXY
Posts: 278
Joined: Monday 07 April 2014 12:50
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.2331
Location: Near Gorinchem
Contact:

Re: Geofence for Domoticz

Post by RoadXY »

Appesteijn wrote:Thanks for your research, I'll see what I can do to build support for this.

*edit: I just added this to the wiki page. I think you get this timeout because the certificate of https://your-own-domoticz is issued for *.domoticz.com and not for your domain.

Is this also your case?
That's the default certificate when enabling SSL/HTTPS for Domoticz.

We're using https://github.com/ge0rg/MemorizingTrustManager for this since Android doesn't trust 3rd party certificates (and it shouldn't do either).
Memorizing trust manager helped me with this.
Last edited by RoadXY on Monday 28 December 2015 8:43, edited 1 time in total.
User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

Re: Geofence for Domoticz

Post by nayr »

EgiGeoZone working perfectly with my Domoticz behind an x509 nginx.. I have no auth in domo, client certificates required and a signed server cert.. If the device is loaded with a cert I sign then it can access the UI from anywhere without needing a password.

been modifying and setting up scripts for security sensors to notify me of changes only I am away from home, now I just need to remember to bring my phone with me.
ping scripts just were not cutting it, my phone would go to sleep at night for several hours.. im sure this is better for the battery consumption.

now to find something for my wife's iphone that can hang with x509 certs.

Thanks.
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

OK I found a solution, I can automatically accept all certificates that have a hostname *.domoticz.com.

edit: It has been released.
niclasc
Posts: 28
Joined: Wednesday 09 December 2015 17:04
Target OS: Linux
Domoticz version: 4.10854
Location: Sweden
Contact:

Re: Geofence for Domoticz

Post by niclasc »

I cant get Domofence to send a "off" command.

If my virtual switch is "on" and at press the bottom right button then the switch turns on

But once its "on" I cant turn it "off". If I try to send the "off" command like this then it works:
/json.htm?type=command&param=switchlight&idx=99&switchcmd=Off

And yes I use the right switch-idx

Even thou I'm 15 miles from home it still is "on"
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

niclasc wrote:I cant get Domofence to send a "off" command.

If my virtual switch is "on" and at press the bottom right button then the switch turns on

But once its "on" I cant turn it "off". If I try to send the "off" command like this then it works:
/json.htm?type=command&param=switchlight&idx=99&switchcmd=Off

And yes I use the right switch-idx

Even thou I'm 15 miles from home it still is "on"
When you enter the geofence it automatically should send a ON command and when you leave it should turn it OFF.

If you don't press the right button and turn the switch off (through the webpage) and enter your geofence, is the switch set to on? You can simulate entering a geofence by removing the geofence and then adding it. Your should get a notification that you have entered the geofence (of course you should be in the geofence)
niclasc
Posts: 28
Joined: Wednesday 09 December 2015 17:04
Target OS: Linux
Domoticz version: 4.10854
Location: Sweden
Contact:

Re: Geofence for Domoticz

Post by niclasc »

Appesteijn wrote:
niclasc wrote:I cant get Domofence to send a "off" command.

If my virtual switch is "on" and at press the bottom right button then the switch turns on

But once its "on" I cant turn it "off". If I try to send the "off" command like this then it works:
/json.htm?type=command&param=switchlight&idx=99&switchcmd=Off

And yes I use the right switch-idx

Even thou I'm 15 miles from home it still is "on"
When you enter the geofence it automatically should send a ON command and when you leave it should turn it OFF.

If you don't press the right button and turn the switch off (through the webpage) and enter your geofence, is the switch set to on? You can simulate entering a geofence by removing the geofence and then adding it. Your should get a notification that you have entered the geofence (of course you should be in the geofence)
How do I remove the geofence? And what does the right button do?
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

niclasc wrote: How do I remove the geofence? And what does the right button do?
The middle button is to add and remove a geofence. The small button on the right is to test your setup.

If you press the middle button it should say "Geofence added" of " Geofence removed". This is the primary button for the app.

If you press the button on the right, you should get a message that the switch is set (or you get an error message)
niclasc
Posts: 28
Joined: Wednesday 09 December 2015 17:04
Target OS: Linux
Domoticz version: 4.10854
Location: Sweden
Contact:

Re: Geofence for Domoticz

Post by niclasc »

Appesteijn wrote:
niclasc wrote: How do I remove the geofence? And what does the right button do?
The middle button is to add and remove a geofence. The small button on the right is to test your setup.

If you press the middle button it should say "Geofence added" of " Geofence removed". This is the primary button for the app.

If you press the button on the right, you should get a message that the switch is set (or you get an error message)

Does "Geofence added" and " Geofence removed" equals "on" and "off"?

Strange thing is that today it seams to work. But yesterday Geofence was "on" nomatter where I was
Appesteijn
Posts: 134
Joined: Friday 10 April 2015 23:53
Target OS: Linux
Domoticz version:
Contact:

Re: Geofence for Domoticz

Post by Appesteijn »

niclasc wrote: Does "Geofence added" and " Geofence removed" equals "on" and "off"?

Strange thing is that today it seams to work. But yesterday Geofence was "on" nomatter where I was
No, when you add a geofence, your phone will monitor when you enter the geofence (send on command) and when you leave the geofence (send off command). If you remove the geofence, your phone will stop monitoring and will never send on or off.

Good to hear it works now, if you need any help, just ask!
dtech
Posts: 20
Joined: Thursday 26 November 2015 8:31
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Odp: Geofence for Domoticz

Post by dtech »

Appesteijn wrote:I recently created a small app that flips a virtual switch on your domoticz server. It is a little basic, but it creates a geofence and once created, the geofence survives a possible reboot of your phone.

DomoFence
It is free, just let me know what you think of it :)

Just created a wiki-page: http://www.domoticz.com/wiki/DomoFence
Hi,

Any plans that this will be available on Windows phone systems ?

Thx
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests