Page 1 of 2

[userModule] Presence Switch (Updated 2016/04/20)

Posted: 26 Oct 2015 16:45
by maros
This module creates three virtual devices that display/store the current presence state. The module handles
  • Home vs. Gone
  • Vacation
  • Day vs. Night
This information can then be used by other modules to create smart automation rules (eg. thermostat operation modes based on presence status) Whenever presence modes are switched an event will be emitted. Day/Night can be switched either manually, or by adding a time by which the switch should happen automatically.

Based on this information a presence mode is calculated.
  • Home (Home during daytime)
  • Night (Home during nighttime)
  • Away (Away - both day and night)
  • Vacation (Prolonged absence - both day and night)
The events produced by this module can be caught and processed by the EventWatcher module. Furthermore the Thermostat Control module uses the presence modes to calculate the current heating setpoints. The Condition Switch module can be used to switch devices based on presence.

Tested with Z-Way version v2.2.2
Bug/Issue tracker at https://github.com/maros/Zway-Presence/issues
Documentation at https://github.com/maros/Zway-Presence/ ... /README.md
Download at https://github.com/maros/Zway-Presence/releases

Installation can be done directly via git or via the the Zway App-Store. Install the BaseModule first.

Re: [userModule] Presence switch (Updated 2015/11/03)

Posted: 23 Nov 2015 16:53
by TritonT
I was thinking of a way to do Presence reliably. Previously before moving to Z-Way I had used Tasker to switch presence to 'In' when one of the RFID tags that I have stuck to each door was tapped. This didn't work well as people forget to tap 'in' and 'out'. Next I tried Tasker message based on GPS location, this worked better, but normally lags by a few minutes and some phones just don't do it reliably.

The best seems to be presence based on whether the phone is on the local wifi. I have done a quick test using arpscan and it seems to work well against all the phones I have tried. I have just been running arpscan as a cron job and checking the result. Best of all it requires no interaction from the user and nothing to run on the phone.

So if you were thinking of expanding Presence module would you consider adding arp. The module would need to accept name / MAC address pairs and then check if any of the MAC addresses are present via arpscan, with another entry for frequency of scan.

It has been incorporated by a few other automation systems eg DomotiGa https://www.domotiga.nl/issues/527

I used this method for testing. http://superuser.com/questions/493003/h ... on-the-lan

Thanks for all the modules by the way. They have really helped me move to Z-Way.

Re: [userModule] Presence switch (Updated 2015/11/03)

Posted: 23 Nov 2015 17:40
by maros
Yes, that's a good idea. However I'd rather create a separate module than include it in the current presence module. I want to keep the installation process of core components (such as the presence switch) very simple and avoid any third party dependencies (for arp support you'd need to mangle .syscommands , install arping, arp-scan ...)

Re: [userModule] Presence switch (Updated 2015/11/03)

Posted: 04 Dec 2015 12:33
by Gorilla
Hi Maroš,
I like your modules, do you have a blog entry or Manual of your configured System that describes how you connect all your modules to e.g. a security System?

Re: [userModule] Presence switch (Updated 2015/11/03)

Posted: 04 Dec 2015 20:51
by maros
not yet, since most of the modules are sill in heavy development and since vital parts are still missing (not yet released). I'll come up with a guide once things start settling

Re: [userModule] Presence switch (Updated 2015/12/27)

Posted: 29 Jan 2016 17:02
by cbnidk
Hi

I am on 2.2.0 and I can't Presence to Work, the install goes wrong an error and the module will not start
any one that can help
:01 | Failed to load module because dependency was not instanciated: [DEP]::[MODUL] = BaseModule :: Presence

cbni

Re: [userModule] Presence switch (Updated 2015/12/27)

Posted: 29 Jan 2016 20:13
by maros
Please follow the installation instructions and install and instantiate BaseModule first

Re: [userModule] Presence switch (Updated 2015/12/27)

Posted: 29 Jan 2016 21:57
by cbnidk
hi
I have now downgrade to 2.1.1, but I have an issu with instal the basemodule
{
"moduleName": "MyModule",
"dependencies" : ["BaseModule"],
can someone tell me where I set this in module.jons in the end or

cbni

Re: [userModule] Presence switch (Updated 2015/12/27)

Posted: 17 Feb 2016 17:09
by bralez
Hi everybody,
I had the same error in 2.2.0, but after a debug session I have solved with a small patch in the module.json of BaseModule:

change these lines

Code: Select all

"options" : {},

"schema" : {},
in

Code: Select all

"options" : {
    "fields" : {}
},

"schema" : {
   "properties" : {}
},
then it's fundamental to "Add App" BaseModule first and after the PresenceModule.

The 404 error that I receive was in postModule of AppModuleAlpacaController:

Code: Select all

          if (!$filter('hasNode')(formData, 'options.fields') || !$filter('hasNode')(formData, 'schema.properties')) {
               $location.path('/error/404');
                $scope.alpacaData = false;
                $scope.loading = false;
                return;
            }
I hope it's useful.

Ciao
Alex

Re: [userModule] Presence switch (Updated 2015/12/27)

Posted: 17 Feb 2016 17:12
by bralez
... and thanks to maros for these modules (Presence, SecurityZone, EventWatcher and ConditionSwitch) :D