Are we able to set PINs from a variable?

eric
Posts: 81
Joined: Mon Dec 22, 2014 12:23 pm

Are we able to set PINs from a variable?

Post by eric »

I can't see to find a way to set PINs from a variable. Am I missing something?

If not, I think this feature would be a great addition - it would allow a series of variables, one per user, containing PINs to be changed from Indigo Touch and automatically updated in the locks, using triggers.
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Are we able to set PINs from a variable?

Post by howartp »

Oooooh!

How long have you been able to modify variables in Touch?!?!?!

Sorry, back on topic.

I can’t remember whether I implemented this or not.

If I did, then you set the pin value in the action to be something like %v:123456% where 12346 is the variable ID in Indigo.

Lookup variable substitution in the Indigo docs if you’re at a pc; I’m on phone and not back till later.

Peter


Sent from my iPhone using Tapatalk Pro
User avatar
durosity
Posts: 4810
Joined: Thu May 10, 2012 3:21 pm
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Are we able to set PINs from a variable?

Post by durosity »

howartp wrote:Oooooh!

How long have you been able to modify variables in Touch?!?!?!
At least a couple of years. Quite possibly longer than that!


Sent from my iPhone using Tapatalk
Computer says no.
User avatar
FlyingDiver
Posts: 7830
Joined: Sat Jun 07, 2014 10:36 am
Location: Southwest Florida, USA

Re: Are we able to set PINs from a variable?

Post by FlyingDiver »

I just looked at the code. String substitution has not been implemented.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Are we able to set PINs from a variable?

Post by howartp »

howartp wrote:If I did, then you set the pin value in the action to be something like %v:123456% where 12346 is the variable ID in Indigo.
Right, grab 1.0.50 then enter the following in the Set Pin action:

%%v:123456%%

Where 123456 is the variable ID from Indigo.

The v is case-sensitive.

Peter
eric
Posts: 81
Joined: Mon Dec 22, 2014 12:23 pm

Re: Are we able to set PINs from a variable?

Post by eric »

That was an amazingly quick response. Trying it now.

Thanks!
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Are we able to set PINs from a variable?

Post by howartp »

It only took 17 characters of coding! :-)


Sent from my iPhone using Tapatalk Pro
mat
Posts: 776
Joined: Thu Nov 25, 2010 10:48 am
Location: Cambridgeshire - UK

Re: Are we able to set PINs from a variable?

Post by mat »

I only count 12 :twisted: :mrgreen:
Late 2018 mini 10.14
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Are we able to set PINs from a variable?

Post by howartp »

mat wrote:I only count 12 :twisted: :mrgreen:
Self.Substitute()

ImageImage



Sent from my iPhone using Tapatalk Pro
eric
Posts: 81
Joined: Mon Dec 22, 2014 12:23 pm

Re: Are we able to set PINs from a variable?

Post by eric »

This all works very well - I have ten variables and each contains a PIN. If I change any one of them (either on the desktop or Touch) then the lock is instantly updated with the new PIN.

There's one thing that's stumping me: I would like to be able to make a variable blank (empty) and have indigo delete that PIN. Currently when you make a variable blank it simply leaves the same PIN functioning.

Any thought on how to program this in Indigo?

Thanks
eric
Posts: 81
Joined: Mon Dec 22, 2014 12:23 pm

Re: Are we able to set PINs from a variable?

Post by eric »

Any thought on how to program this in Indigo?
Figured it out - never mind.

When writing the new PIN using the trigger, I first delete the pin, then write it. So a blank variable will result in a deleted PIN.
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Are we able to set PINs from a variable?

Post by howartp »

Hehe, yep that will work.

I was also going to say yes it can be done easily - I’ll intercept a blank pin in the setPin() routine in code, and redirect to clearPin() instead when it sees blank.


Sent from my iPhone using Tapatalk Pro
chrisfromthelc
Posts: 38
Joined: Wed Oct 08, 2014 1:30 pm

Re: Are we able to set PINs from a variable?

Post by chrisfromthelc »

I'm unable to set a PIN from a variable.

I can read the PIN just fine.

Code: Select all

Action Group                    Get Pin
   Z-Wave Lock Manager             Requesting PIN for user 1
   Z-Wave                          sent "Front Door Deadbolt" raw command [63 02 01]
   Z-Wave Lock Manager             Status:  User code 1 is 9 5 9 9 [Node: 13]
I can also set the PIN by manually assigning it in the action.

Code: Select all

Action Group                    Set Pin
   Z-Wave Lock Manager             Setting PIN for user 1 to: 7135
   Z-Wave                          sent "Front Door Deadbolt" raw command [63 01 01 01 37 31 33 35]
   Z-Wave Lock Manager             Status: User 1 updated [Node: 13]
   Action Group                    Get Pin
   Z-Wave Lock Manager             Requesting PIN for user 1
   Z-Wave                          sent "Front Door Deadbolt" raw command [63 02 01]
   Z-Wave Lock Manager             Status:  User code 1 is 7 1 3 5 [Node: 13]
However, using the %%v:123456%% format (which I've doublechecked that I've used my own variable ID) doesn't seem to work.

Variable with ID
Screen Shot 2018-07-05 at 5.27.40 PM.png
Screen Shot 2018-07-05 at 5.27.40 PM.png (7.05 KiB) Viewed 5396 times
Action setup
Screen Shot 2018-07-05 at 5.29.53 PM.png
Screen Shot 2018-07-05 at 5.29.53 PM.png (76.4 KiB) Viewed 5396 times
The PIN is unchanged.

Code: Select all

  Action Group                    Set Pin
   Z-Wave Lock Manager             Setting PIN for user 1 to: %%v:710549162%%
   Z-Wave                          sent "Front Door Deadbolt" raw command [63 01 01 01]
   Action Group                    Get Pin
   Z-Wave Lock Manager             Requesting PIN for user 1
   Z-Wave                          sent "Front Door Deadbolt" raw command [63 02 01]
   Z-Wave Lock Manager             Status:  User code 1 is 7 1 3 5 [Node: 13]
(yes, the PIN in the variable is different; I made sure of that)

Any ideas? I have a Kwikset 910TRL. It seems to otherwise work fine...it's just the variable issue that's got me stumped.
chrisfromthelc
Posts: 38
Joined: Wed Oct 08, 2014 1:30 pm

Re: Are we able to set PINs from a variable?

Post by chrisfromthelc »

...and I feel like a dummy. I downloaded what I thought was the latest version from the pinned post in this subforum. I got the real latest version from the plugin store, and it works fine now.

Image
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Are we able to set PINs from a variable?

Post by howartp »

Hehe, I love it when you solve things for me. :-)

I do need to check/remember to update the pinned post.


Sent from my iPhone using Tapatalk Pro
Post Reply

Return to “ZWave Lock Manager”