Feature Request: ZWave Watcher Triggers/Actions

Posted on
Wed Dec 16, 2020 4:24 pm
whmoorejr offline
User avatar
Posts: 762
Joined: Jan 15, 2013
Location: Houston, TX

Re: Feature Request: ZWave Watcher Triggers/Actions

howartp wrote:

Code: Select all
  Z-Wave Lock and Code Manager Debug Code entered: 1234 [Enter]
:D
Since my programming skills pretty much peak out at my ability to hit buttons randomly.... Helping with this seems to be my calling. Do you need anymore log data or are you looking for anything specific?

howartp wrote:
- just edit live, or copy-over, the files on your Mac instead of re-installing new incremented versions every time and reload your plugin. I see in another thread your on version .150 or something!
That would have been nice to know about 148 versions ago, Cool tip which I will be sure to use.

Bill
My Plugin: My People

Posted on
Wed Dec 16, 2020 5:01 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Feature Request: ZWave Watcher Triggers/Actions

Sorry, that version should work with triggers.

Give it a go.


Sent from my iPhone using Tapatalk Pro

Posted on
Wed Dec 16, 2020 5:47 pm
whmoorejr offline
User avatar
Posts: 762
Joined: Jan 15, 2013
Location: Houston, TX

Re: Feature Request: ZWave Watcher Triggers/Actions

The only errors I could find....
If you create a keypad as a doorlock, it will throw code errors when you put in numbers

Code + Timeout works with trigger. (More of a feature than an error, but something you could add to the Configure Keypad - Code entered line..... "Rink Keypad v1 supports Enter, Home, Away, Disarm and Cancel <-- & Timeout.

Maybe add a comment.... leave code field blank to trigger of just the enter, home away disarm or cancel button without a preceding number.

But I tested every trigger combination I could think of and didn't hit any snags. Awesome work!

Will you be adding actions to the device?

Bill
My Plugin: My People

Posted on
Thu Dec 17, 2020 12:45 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Feature Request: ZWave Watcher Triggers/Actions

Can you show me error when using doorlock and entering codes?

Peter


Sent from my iPhone using Tapatalk Pro

Posted on
Thu Dec 17, 2020 10:16 am
whmoorejr offline
User avatar
Posts: 762
Joined: Jan 15, 2013
Location: Houston, TX

Re: Feature Request: ZWave Watcher Triggers/Actions

Good news? Maybe? I tried to re-create the error by making a new lock with the ring keypad and then hit some buttons.... no error.

I had to look through the log folder to find the log from last night....
Code: Select all
2020-12-16 17:31:07.103   Z-Wave Lock and Code Manager Debug   Node ID 49 (Hex 49) found in lockIDs
2020-12-16 17:31:08.425   Z-Wave Lock and Code Manager Debug   Node ID 49 (Hex 49) found in lockIDs
2020-12-16 17:31:08.427   Z-Wave Lock and Code Manager Debug   Node ID 49 (Hex 49) found in lockIDs
2020-12-16 17:31:08.427   Z-Wave Lock and Code Manager Debug   -----
2020-12-16 17:31:08.429   Z-Wave Lock and Code Manager Debug   Keypad entry code received:
2020-12-16 17:31:08.429   Z-Wave Lock and Code Manager Debug   Raw command: 01 10 00 04 00 31 0A 6F 01 21 02 02 04 31 32 33 34 FF
2020-12-16 17:31:08.429   Z-Wave Lock and Code Manager Debug   Node:  49
2020-12-16 17:31:08.429   Z-Wave Lock and Code Manager Debug   Code entered: 1234 [Enter]
2020-12-16 17:31:08.429   Z-Wave Lock and Code Manager Debug   triggerKeyCode called
2020-12-16 17:31:08.430   Z-Wave Lock and Code Manager Error   Error in plugin execution ReceivedBroadcast:

Traceback (most recent call last):
  File "plugin.py", line 660, in zwaveCommandReceived
  File "plugin.py", line 777, in triggerKeyCode
KeyError: (1951323348,)
That was pretty much the same error I kept getting until I deleted the Ring Keypad as a door lock device. The "Key Error" changed in the error, but the plugin.py lines were always 660 and 777
Code: Select all
Traceback (most recent call last):
  File "plugin.py", line 660, in zwaveCommandReceived
  File "plugin.py", line 777, in triggerKeyCode
KeyError: (1256326887,)

Bill
My Plugin: My People

Posted on
Thu Dec 17, 2020 2:08 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Feature Request: ZWave Watcher Triggers/Actions

https://github.com/howartp84/ZWaveLockM ... tag/1.0.61

Adds commands provided in viewtopic.php?f=136&t=24673&p=198029#p197980

whmoorejr wrote:
Will you be adding actions to the device?

Bill, were there other actions you were referring to?

I'm going to post this version live.

Posted on
Thu Dec 17, 2020 4:35 pm
whmoorejr offline
User avatar
Posts: 762
Joined: Jan 15, 2013
Location: Houston, TX

Re: Feature Request: ZWave Watcher Triggers/Actions

Only a couple things I could think of to consider:

Triggers:
1) Trigger on any code. Since users or codes aren't stored in the plugin (or in the device), there isn't an "invalid code" option (like I have with my Yale lock and your plugin). If codes are managed outside of the plugin, it may be nice to trigger off any integer. Example Code options:
    " " (Blank) no numbers pressed, trigger on Event Type only. <-- That one works now
    * Any integer will trigger with event.
    ?-????????? Any 1 - 9 digit integer will trigger with event.
I'm not sure what character is a wildcard in pythonese.

1b) Maybe provide a sample condition python script where a user could fill in all their valid codes so the trigger would only fire if it's NOT one of the valid codes in the condition.
Code: Select all
if device.lastCodeEntered = 1234 or = 5678 or = 9012 #<-- probably wrong, my first 149 attempts usually are.
2) Trigger on code regardless of enter, timeout or disarm <-- should all = disarm. So Event Type / Key Pressed could be (for example):
    Enter
    Cancel
    Home
    Away
    Disarm
    Timeout
    Any Disarm (Enter, Timeout or Disarm)
    Any Event Type (Just triggers off the code, regardless of how it was transmitted)

3) Maybe a trigger off the battery power setting thing. When the Ring device is on battery power, if the proximity sensor detects someone, it changes it's power setting which broadcasts in z-wave. When it's plugged in, this never happens because it stays in normal power mode. So if your ring keypad is mounted without a USB cord, you could trigger on the presence of someone.

Actions: FYI, after running the commands from that post, the beeps and color flashes and stuff all run on a single cycle (that's why there isn't a corresponding OFF command).....

The only action I would like to see is a way to capture the input (Code Entered). Can it be written into a device state? state = lastCodeEntered. <-- Helpful if there is a way to trigger off any integer.

For myself, I'm looking at one of two methods.... One is a variable that is populated when a keypad code is entered. A change in the variable runs a script that will compare that code against a list of users in a CSV file. If the user is on the list, another variable is populate with the user's name. If not, that variable is populated with "Fail".

The other method would be a user plugin. (version 168 or so). All human info would be maintained in there. (I'm still on this step, the next step would be figuring out how to integrate those plugin saved states with other plugins that are people based: Presence detection, iMessage, email, pushover, access control, etc.)

Side note: When trolling the forums last night looking for code help on my plugin, there was discussion on a thread about something similar, but instead of being human-centric, it would be room-centric. If I ever get mine finished, I would only have to change verbiage around... name -> room. Email -> lamp, etc.

Bill
My Plugin: My People

Posted on
Thu Dec 17, 2020 5:14 pm
FlyingDiver offline
User avatar
Posts: 7213
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: Feature Request: ZWave Watcher Triggers/Actions

FYI, the Python code you're looking for is:

Code: Select all
if device.lastCodeEntered in [1234,  5678,  9012]:

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Thu Dec 17, 2020 11:49 pm
whmoorejr offline
User avatar
Posts: 762
Joined: Jan 15, 2013
Location: Houston, TX

Re: Feature Request: ZWave Watcher Triggers/Actions

v1.0.61 testing

now entering a code, I get the following error...
Z-Wave Lock/Code Manager Error Error in plugin execution ReceivedBroadcast:

Traceback (most recent call last):
File "plugin.py", line 687, in zwaveCommandReceived
File "plugin.py", line 804, in triggerKeyCode
KeyError: (1256326887,)
. Which I think was just from updating plugins and it didn't like the existing triggers. Once I re-associated the triggers with the device, the error stopped.

The actions work.... sorta. They don't see / communicate with the keypad device. They work with the Door Lock device.... but they worked.
See line 876 in you devices.xml
Code: Select all
<Action id="sendCmdToRing" deviceFilter="self.doorLock" uiPath="Ring Keypad">


And I couldn't figure out how to capture an invalid code.

Other than that, it's looking really great.

Bill
My Plugin: My People

Posted on
Tue Dec 22, 2020 9:49 am
whmoorejr offline
User avatar
Posts: 762
Joined: Jan 15, 2013
Location: Houston, TX

Re: Feature Request: ZWave Watcher Triggers/Actions

Found an oddity....
Z-Wave Watcher Debug Raw command sent (Node 44): 01 09 00 13 2C 02 84 08 24 AC CF (True)
Z-Wave Watcher Debug Raw command received (Node 44): 01 08 00 04 00 2C 02 84 07 5E
Z-Wave Lock/Code Manager Debug Node ID 44 (Hex 44) found in lockIDs
Z-Wave Lock/Code Manager Debug -----
Z-Wave Lock/Code Manager Debug Keypad entry code received:
Z-Wave Lock/Code Manager Debug Raw command: 01 10 00 04 00 2C 0A 6F 01 11 02 02 04 31 32 33 34 FF
Z-Wave Lock/Code Manager Debug Node: 44
Z-Wave Lock/Code Manager Debug Code entered: 1234 [Enter]
Z-Wave Lock/Code Manager Debug triggerKeyCode called

Node: 44 is a Ring V2 contact sensor which is setup as a doorlock.
Node: 49 is a Ring Keypad V1. I think 1234 is the last code I used on it.

On the Ring Keypad, I just entered 54321 and will try to keep an eye on my log to see if Node44 is echoing Node49. <-- don't know if that is technically possible, that's just what it looks like to me.

Bill
My Plugin: My People

Posted on
Tue Dec 22, 2020 11:44 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Feature Request: ZWave Watcher Triggers/Actions

whmoorejr wrote:
Found an oddity....

Node: 44 is a Ring V2 contact sensor which is setup as a doorlock.
Node: 49 is a Ring Keypad V1. I think 1234 is the last code I used on it.

Are you up to date?

Node 44 is purely a coincidence in that it is the node I test with as it's sat on my desk; it's neither a keypad nor a lock but my code persuades it otherwise.

Live plugin should ignore my testing (it looks for node 444 not node 44).

Peter

Posted on
Tue Dec 22, 2020 1:06 pm
whmoorejr offline
User avatar
Posts: 762
Joined: Jan 15, 2013
Location: Houston, TX

Re: Feature Request: ZWave Watcher Triggers/Actions

howartp wrote:
Are you up to date?


I'm running v1.0.61.

Bill
My Plugin: My People

Posted on
Sun Dec 27, 2020 3:36 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Feature Request: ZWave Watcher Triggers/Actions

I've just pushed 1.0.62 which should get rid of the node 44 issue.

https://github.com/howartp84/ZWaveLockM ... tag/1.0.62

Posted on
Sun Jan 24, 2021 9:57 pm
whmoorejr offline
User avatar
Posts: 762
Joined: Jan 15, 2013
Location: Houston, TX

Re: Feature Request: ZWave Watcher Triggers/Actions

howartp wrote:
I've just pushed 1.0.62 which should get rid of the node 44 issue.


That worked but I found something else that's a little odd but hard to explain.
For your plugin to work properly with my keypad, I need to have 2 devices installed. For my setup, that's Ring Keypad Manager (A keypad device) and Ring Keypad2 DoorLock (a door lock device).

Example, if I disable the communication of the doorlock device, the keypad trigger doesn't fire.

I was tweaking your plugin and I added this to line 689
Code: Select all
            self.updateState(int(bytes[5]16), "keyedPin", codeVal
after adding a custom state "keyedPIN" to devices.xml. The custom state was created, but I was getting an error that the state wasn't defined. Then I started to realize that it was looking at the Ring Keypad2 Door Lock. So, I added a device state to the lock devices in the devices.xml, and now when I enter a PIN, it populates the state of my keypad lock with the entered PIN number.

So I have it working... but I have to use two devices (three if you count the actual z-wave device) to make it happen. From there, I have a trigger that watches that state for changes and runs a script to check the PIN number against the PIN numbers of the people in My People plugin.
Attachments
Screen Shot 2021-01-24 at 9.55.22 PM.png
Screen Shot 2021-01-24 at 9.55.22 PM.png (25.04 KiB) Viewed 4033 times

Bill
My Plugin: My People

Who is online

Users browsing this forum: No registered users and 1 guest