Is anyone actively using the SetPin and SetPinValidityDate actions to do a bulk
upload of PINs to a DoorLock using the Luup_UPNP? I’d be very interested to
share ideas with others doing similar configuration tasks.
My goal is to upload a bunch of PINs to a lock on a vacation rental property.
The PINs will be a mix of general access PINs (e.g. always valid for property
manager), weekly restricted (e.g. daily between 8am and 6pm for cleaning/service
personell) and start/stop date restricted (e.g. 3pm saturday to 10am on following
saturday for guests). To further elaborate on that last one, a guest staying
3 weeks would be given 3 PINs that are valid for their corresponding weeks.
I’d also like to include PINs valid for each entire month, so someone staying
for a few months (e.g. a snowbird) would need fewer PINs for their stay.
I’ve created a Perl script that uses the Lua UPNP HTTP access to run the
action SetPin and SetPinValidityDate and it actually works, but it takes
about 60 seconds per PIN. With all of the combinations of guest PINs, I’m
looking at about setting 200 PINs in one shot.
I put my code on github [GitHub - mrscotty/perl-mios: Perl API for interacting with MiOS devices from MiCasaVerde]. It’s very
simple “proof of concept” code that could be cleaned up if I continue pursuing
this project.
I am interested in suggestions on speeding up the load process and ideas for
managing the PINs as they expire (e.g. replacing expired guest PIN in slot 75
with new PIN valid for later date).
While I don’t have a use case for this in particular (for instance no rental properties, just my house), I am very interested in what you’re doing.
What kind of a lock do you have that can store 200 codes ?
I believe the Schlage locks handle around 20 codes.
[quote=“RichardTSchaefer, post:3, topic:176424”]What kind of a lock do you have that can store 200 codes ?
I believe the Schlage locks handle around 20 codes.[/quote]
I’ve got a Yale deadbolt (not the touchscreen, just regular keypad) and when you program it without Z-Wave, it has 20 or 25 slots. When you go via Z-wave, it can store 250 codes.
UPDATE:
This just isn’t working the way I’d like it to. The performance and stability sucks.
When I try to upload a block of 50 unique unrestricted codes (i.e. no weekly or daily time restrictions, just the pin codes), it takes about 20 minutes. While monitoring the list of jobs for the lock device, it’s usually at 1 job. Slow, but acceptable.
When I try to upload a block of 50 unique date-restricted codes (i.e. start_date and stop_date), the job crashes after 30-60 minutes. In the job queue for the lock device, I notice lots of PINSET and PINCLEAR actions, often for the same pin slot number. They mostly have the status ‘0 - waiting to start’. Some have ‘6 - job requeued’ or '7 - in progress with pending data. The list of jobs with status ‘0’ keeps growing and I eventually just reboot the vera3.
An important note: I am uploading the unrestricted codes using the JSON input of the SetPin data request. I couldn’t get this to also take the date restricted entry that goes with the pin code, so I add those in a second data request, SetPinValidityDate. The code then waits for all jobs for the device to have the status ‘4 - Done’. Maybe it would help if I could get the SetPin data request to accept the date/time restriction in the JSON – my original attempts failed with an ‘invalid date’ error. Has anyone gotten this working?
Any suggestions on optimizing this?
Mrscotty - I am wanting you do the same thing with bulk pin code creation. Have you worked out the bugs or found a better working option?
When I went to your GirHub, it appears to have been removed.
I look forward to hearing back. Thanks