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

Tips, Tricks and Scripts to enhance your home automation and workaround known device bugs, limitations and incompatibilities
maros
Posts: 103
Joined: 05 Apr 2014 11:21

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

Post by maros » 20 Feb 2016 20:20

Thank you for the solution. Just released the change to the appstore and github
... and thanks to maros for these modules
You are welcome :-D
Z-Way 2.2.4 on Raspi B | My Zway GitHub repos | Amazon Wishlist to support module development

hwittler
Posts: 5
Joined: 20 Dec 2015 11:18

Re: [userModule] Presence switch (Updated 2016/01/18)

Post by hwittler » 05 Mar 2016 12:18

I used presence switch to turn on/off 'Night' at dawn and at sunset which works fine with the data from the astronomy module.
My problem is that I need to supply times for the night switch in the presence module.

Leaving out the times leads to the state toggling all the times.
Since I want to trigger my shutters from the night switch thats not really good.

Of course I could use the condition switch for the shutter but I would really prefer the presence switch since it is more visible than trapping an event not showing up in the UI.

maros
Posts: 103
Joined: 05 Apr 2014 11:21

Re: [userModule] Presence switch (Updated 2016/01/18)

Post by maros » 06 Mar 2016 12:07

The constant toggling of the night mode if no time is set will be fixed in the next release.

However, I'm not quite sure if you are using the night switch correctly. The "Night Mode" was initially meant to represent the time of day when you are in bed, and not the time when the sun is below the horizon (a simple condition switch with a solar position < -5 rule would be sufficient in this case). Therefore the "Night Start" time should be the latest time when you usually go to bed, and "Night End" when you usually wake up. Of course manual switching (eg. if you get up earlier than usual) is supported.

For your scenario I'd rather recommend to create a condition switch that closes/opens your shutters if "Presence = Night OR Presence = Away" AND "Astronomy < -5". If you want to display the status of this condition you could create a virtual device which is switched by the same condition.
Z-Way 2.2.4 on Raspi B | My Zway GitHub repos | Amazon Wishlist to support module development

Coffeelover
Posts: 34
Joined: 21 Sep 2015 15:47

Re: [userModule] Presence switch (Updated 2016/01/18)

Post by Coffeelover » 31 Mar 2016 18:49

Hi,
I am using Zwave on WD NAS. I could install both the base module and the presence state module, but it seems it does not work.
For presence eg it shows "Cannot instantiate module: Presence: TypeError: undefined is not a function" in the event overview. Furthermore I was assuming it would create a switch for presence / absence, but it does not.
Am I making a mistake or is it just not working on WD-NAS-Stick?
Regards

Edit: It seems the problem is related to BaseModule, since e.g. Thermostat Controll does not work either. When I open the Basis Module, there is an empty dialoge box. Do I have to enter anything there?

Thealon
Posts: 17
Joined: 26 May 2015 15:20

Re: [userModule] Presence switch (Updated 2016/01/18)

Post by Thealon » 06 Apr 2016 10:58

I'm trying to set the time of night mode, but it is in a am/pm format
and my system is in 24h format

maros
Posts: 103
Joined: 05 Apr 2014 11:21

Re: [userModule] Presence switch (Updated 2016/01/18)

Post by maros » 06 Apr 2016 12:11

Thealon wrote:I'm trying to set the time of night mode, but it is in a am/pm format
and my system is in 24h format
Are you running a 2.2.2 (release candidate) UI? I'm asking because 2.2.2 introduced time pickers for the AlpacaJS forms, which - when not configured - defaults to 12h format. I already have a fix for that in master which will be released once 2.2.2 is out.

So either grab my module from github, enter the correct time in 24h notation manually (not using the time picker - this is the format that is expected by the module anyhow), or wait until the new version will be released.
Z-Way 2.2.4 on Raspi B | My Zway GitHub repos | Amazon Wishlist to support module development

Mike Yeager
Posts: 160
Joined: 03 May 2014 07:02

Re: [userModule] Presence switch (Updated 2016/01/18)

Post by Mike Yeager » 29 May 2016 23:13

Maros,

Have you provided for or considered doing a module that monitored PIR sensors or light switches as well as doors (opening and closing) as a way to monitor presence? There's a method referred to as "wasp in a box" that, while not perfect, is a real good start. I'm mainly checking to see what you may have already provided for before I start digging into this on my own.

Thanks for the great modules....

maros
Posts: 103
Joined: 05 Apr 2014 11:21

Re: [userModule] Presence switch (Updated 2016/01/18)

Post by maros » 02 Jun 2016 23:36

No, I haven't implemented an automated presence detector yet. I was thinking about implementing a similar module based on WiFi device (ie mobile phone) arp scan, but this isn't the very reliable, and therefore I abandoned this idea.

I think that you could create a very simple setup using my AutoInactivityOff module + PIR + door sensors.
Z-Way 2.2.4 on Raspi B | My Zway GitHub repos | Amazon Wishlist to support module development

Mike Yeager
Posts: 160
Joined: 03 May 2014 07:02

Re: [userModule] Presence switch (Updated 2016/01/18)

Post by Mike Yeager » 08 Jun 2016 18:28

That's basically what I'm thinking. Anytime a door is opened, the system needs to assume the house is no longer occupied unless it's in "night" mode (to account for someone coming home late or leaving for work early) after a predetermined amount of time with no activity being detected by either PIR sensors or other monitored devices. Even a light switch could be used to monitor presence at certain times of the day. I have Kwikset door locks and they report how they were activated. Obviously, a lock being opened with a code would mean someone was coming in. The door being locked manually could mean someone locked it by hand from the inside or they used a key to lock it from the outside (we don't use the keys at all but it's still a possibility). I'm sure you see where I'm going with this. I think it could get to be a complex set of rules. Still working it out on paper but not sure how long it's going to be before I can test it much as I need a few PIR sensors and a period of time when no one is home....

jet11x
Posts: 34
Joined: 29 Dec 2014 21:15

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

Post by jet11x » 04 Sep 2017 23:10

I've been trying out the Presence module and struggled to get an event emitted for being on Vacation. After looking at the code I discovered you also have to set to Away. I also noted in the Presence code the following:

if (presence === 'on') {
if (night === 'on'){
newMode = 'night';
} else {
newMode = 'home';
}
// TODO check vacation?

I can see some circumstances when only moving presence mode to vacation when you say you're away would make sense, but it's not obvious behaviour. I guess this would be a lot more obvious if you could have a device that supported an enumerated list. In the absence of that would it make sense to make the behaviour clear in the module documentation or changing the code so you don't have set away to be on vacation (if that makes sense!) or that going on vacation forces you to be away.

And thanks for all the great modules maros - I've just started to write my first module and I'm looking to use your Base, Presence and Astronomy modules.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest