Scripting...

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
Mike Yeager
Posts: 160
Joined: 03 May 2014 07:02

Scripting...

Post by Mike Yeager »

I believe PoltoS sent me a code snippet (possibly in email) that would detect a door sensor closing and lock a door lock. Unfortunately, I can't find it. Could anyone post a code snippet to detect the door sensor closing and activate either a door lock or just an on/off switch? I'm going to try to tackle this Javascript method and I seem to learn better if I have running code I can look at and play with. I'm still looking for the original message but I'm having no luck...
Mike Yeager
Posts: 160
Joined: 03 May 2014 07:02

Re: Scripting...

Post by Mike Yeager »

By the way, the script was intended for the automation engine...
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Scripting...

Post by pz1 »

Mike Yeager wrote:By the way, the script was intended for the automation engine...
Why not use the logical rule from the automation engine then?
Since 29-12-2016 I am no longer a moderator for this forum
User avatar
PoltoS
Posts: 7649
Joined: 26 Jan 2011 19:36

Re: Scripting...

Post by PoltoS »

It was this

Code: Select all

zway.devices[2].SensorBinary.data.level.bind(function() {
    if (this.value == false) {
        zway.devices[3].DoorLock.Set(255);
    }
});
But indeed, now you can use Logical Rules.
Last edited by PoltoS on 29 Jun 2014 00:59, edited 1 time in total.
Mike Yeager
Posts: 160
Joined: 03 May 2014 07:02

Re: Scripting...

Post by Mike Yeager »

Guess I'll have to try to figure out the logical rules then.... I can't keep up!!!
dylancaponi
Posts: 19
Joined: 25 Jun 2014 12:47

Re: Scripting...

Post by dylancaponi »

Is this the logical rules module you're talking about?
https://github.com/Z-Wave-Me/home-autom ... gicalRules

If I just copy that folder into /opt/z-way-server/automation/modules will I be fine or are there dependencies?
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: Scripting...

Post by pz1 »

dylancaponi wrote:Is this the logical rules module you're talking about?
https://github.com/Z-Wave-Me/home-autom ... gicalRules

If I just copy that folder into /opt/z-way-server/automation/modules will I be fine or are there dependencies?
Upgrade to 1.7.1, and you have them installed with the installation.
Since 29-12-2016 I am no longer a moderator for this forum
Mike Yeager
Posts: 160
Joined: 03 May 2014 07:02

Re: Scripting...

Post by Mike Yeager »

I'm trying to get the logical rules module to come up. The first time I got it to load, it looked like it was mostly for lighting scenes. I select the module and most of the time it just sits there like it's looking for something and the submenus never show up. Will keep trying...

EDIT - It came back up but I can't see any way to set a rule up to do what I want to do. I'd like to monitor a door lock, a scene controller and a binary switch. If the door is unlocked and the scene controller is not set a certain way, I'd like the door to relock after a minute or so as long as it's still closed. Is this currently possible using the logical rules??? Would be perfect if it is... Also, being able to lock the doors at a certain time???
islipfd19
Posts: 126
Joined: 07 Jul 2014 03:35

Re: Scripting...

Post by islipfd19 »

This does seem possible, unfortunately I can't test this out. My door locks are associated with my alarm panel. My razberry acts as a second controller to the alarm panel and is unable to establish the security connection. I believe it's something to do with the alarm panel as I see others successfully using their door locks with z-way.
Post Reply