Scripting...
-
- Posts: 160
- Joined: 03 May 2014 07:02
Scripting...
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...
-
- Posts: 160
- Joined: 03 May 2014 07:02
Re: Scripting...
By the way, the script was intended for the automation engine...
Re: Scripting...
Why not use the logical rule from the automation engine then?Mike Yeager wrote:By the way, the script was intended for the automation engine...
Since 29-12-2016 I am no longer a moderator for this forum
Re: Scripting...
It was this
But indeed, now you can use Logical Rules.
Code: Select all
zway.devices[2].SensorBinary.data.level.bind(function() {
if (this.value == false) {
zway.devices[3].DoorLock.Set(255);
}
});
Last edited by PoltoS on 29 Jun 2014 00:59, edited 1 time in total.
-
- Posts: 160
- Joined: 03 May 2014 07:02
Re: Scripting...
Guess I'll have to try to figure out the logical rules then.... I can't keep up!!!
-
- Posts: 19
- Joined: 25 Jun 2014 12:47
Re: Scripting...
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?
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?
Re: Scripting...
Upgrade to 1.7.1, and you have them installed with the installation.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?
Since 29-12-2016 I am no longer a moderator for this forum
-
- Posts: 160
- Joined: 03 May 2014 07:02
Re: Scripting...
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???
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???
Re: Scripting...
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.