Project

General

Profile

PSS #30

Tuya Locks - Web Control - Phase I

Added by Michael Milliron almost 4 years ago. Updated over 3 years ago.

Status:
Update
Priority:
High
Category:
Hotel - Operations - Misc
Start date:
01/31/2022
Due date:
% Done:

0%

Estimated time:

Description

From Sieu - 01/31/2022

PSS.101, MH.1, KP.1 will be our naming convention for the locks itself. Eventually, would want logic to confirm it is a valid room. We might also have room such as PSS.PIP where PIP is the room number, so needs to be alpha numeric.

Web page fields:

Guest Phone: .. be nice to eventually scrape data and guest name will pull.
Property: (Default to PSS - pull down menu)
Room:
Start date: default to current.
Days: (Default to 1 - this is the length of stay)
Check Out Time: Default to 11am
Pin: Start 22 - this will be our only security for now.

Phone number will generate a passcode with the appropriate expiration date/time. It will update the passcode for "Active Guest" profile.. there will only be one Guest Code at any one time - so u are simply doing an update.

Each Staff Member will have their own code - doing 4 digits. And all codes will be populated to all locks per property. So need an employee table with their specific code. It will obviously NOT be their phone number since they know each other's phone. There should be no sharing of this code as we will be auditing who goes in/out of each room. The profile name will be the first and last name of the staff member.

-------------------------------------
Also doing some searching earlier - https://hotel.tuya.com/ .. there might be some collab here .. pls research once time allows.

So many other things want to ask for, but for now, just be nice to have a simple page which can update a guest code and input the checkout time.

Also, I'm wondering if i should ask lydon to suggest a programmer or if we can get someone on fiverr again - image there has to be plenty of people familiar w/ Tuya... It would be good if the code could be written to where anyone could do basic edits and perhaps something directly on our webserver?

Eventually, i see us reaching out to the guest and provide them the room/lock info - but the problem with that is that most don't prepay. We would need to give them both a CashApp and Credit Card option before continuing. And we would no longer get DL scanned either, which would kinda suck.

This is not required for deployment - but we will need a database of all RFID cards - which we can then assign to a particular room.. so perhaps a 3rd optional field with a 3 digit RFID card number.


Files

Locks-Phase1 specs.docx (19.9 KB) Locks-Phase1 specs.docx Michael Milliron, 02/08/2022 02:45 PM

History

#1

Updated by Michael Milliron almost 4 years ago

  • Status changed from New to Update

My Notes -
Tuya API - https://us.iot.tuya.com/
TTLock has it's own API - https://open.ttlock.com/ - approval pending (??)
Development accounts for both under
pw PsSl0cKs4eVer!

#2

Updated by Michael Milliron almost 4 years ago

I need the Tuya Smart App PW for PSS - update the Master-PSS please when you have a moment - yellow highlighted cell -

#3

Updated by Sieu Ngo almost 4 years ago

  • Description updated (diff)
#4

Updated by Sieu Ngo almost 4 years ago

  • Subject changed from Tuya Locks to Tuya Locks - Web Control
#5

Updated by Sieu Ngo almost 4 years ago

  • Subject changed from Tuya Locks - Web Control to Tuya Locks - Web Control - Phase I

Wishful thinking I am sure, but if this can be written in a script, without the need for a compiler, that would be the preference.... being about to "Vi" directly on the web server itself would be ideal... single source of failure. pls do under PinetopStudios.com/locks.

#6

Updated by Michael Milliron almost 4 years ago

FYI - Dev environment set up - locks are showing up - calls successful within TUYA API testing environment.

Testing API calls in Postman outside of TUYA Dev environment are getting error - 1114 - IP not allowed - whitelist is NOT enabled on project. Opened a ticket with Tuya dev support as I've found others with the same issue and have had to get it fixed through them.

#7

Updated by Michael Milliron almost 4 years ago

Locks will communicate outside of TUYA dev environment. FYI - a passcode sent to my MM.01 was available in a few seconds - but with the required back end scripting to do the encryption for the key for each call it's just not something I can provide with my current skillset in a timely manner - and you know it pains me to admit that. Searching on FIVERR and contacting Lyndon to see if he has any suggestions. I'm seeing TTLOCK in conjunction with TUYA in developer skillsets so we might be able to get both. Hoppefully.

#8

Updated by Sieu Ngo almost 4 years ago

Michael Milliron wrote:

required back end scripting to do the encryption for the key for each call

So which skill set is required outside? That will need to b

Searching on FIVERR and contacting Lyndon to see if he has any suggestions.

Appears Lyndon misunderstood need - just glancing, he might have gotten impression we wanted to change the firmware itself... not sure if u read it the same way i did - so might be a good idea to clarify. And as angelie found out, although PH appears to have embraced Tuya hardware, they are not on the software side of things. Perhaps the software just isn't pervasive enough and we need a more generic coder.

I'm seeing TTLOCK in conjunction with TUYA in developer skillsets so we might be able to get both.

As many Tuya locks as we have, not concerned about TTLOCK. Plus, their off the shelf software is already superior w/out integration.

#9

Updated by Michael Milliron almost 4 years ago

FIVERR - found an experienced TUYA IOT developer - "iot_guy" https://www.fiverr.com/iot_guy
Provided attached documentation - settled on $225 in 7 days
Will provide Web-01 and credentials - Employee DB info below for the PIN validation

Mysql
Db: pinetopstudios
u: pssmhi
Pw: pss@1202
Table: employees
Pin field: pincode
Only validate against employees where status = 'active' (any case)

If a current list of employees is given I can populate and then provide a tool that Angelie can use to keep updated.

#10

Updated by Sieu Ngo almost 4 years ago

Any logging specified? Even if it is a simple text file we "rotate" manually on the backend? Obviously, it is the employee PIN/Name that is key.

since the redmine server is "newer", he might have an easier time with using that box instead. The OS for the web server dates back to when we first started with DO.

#11

Updated by Michael Milliron almost 4 years ago

Sieu Ngo wrote:

Any logging specified? Even if it is a simple text file we "rotate" manually on the backend? Obviously, it is the employee PIN/Name that is key.

since the redmine server is "newer", he might have an easier time with using that box instead. The OS for the web server dates back to when we first started with DO.

1. Tuya already logs any command sent through the API - you can look at the logs for each lock in the app now - pull up my lock labled pss.001 in the app and you'll see each command I was able to send through the API.

2. The redmine server isn't newer - it's a duplicate of pbx1 - but I'm sure a newer Debian with node.js built in would have been preferred. We can put it on hold to spin that up. Your call. I tried to install node.js on web-01 and was unable.

#12

Updated by Michael Milliron almost 4 years ago

Edited the code/app for the following:

1. Singo Solution spelled correctly
2. Removed the door code from the grid (still in the table if needed)
3. Active Guest can be made read only but not doing right now per Sieu - email 3/3
4. Phone and Door code no longer numeric fields with the spinner
5. Autofill for the phone should be off now
6. Door code now just fills with the last 7 digits of the phone. There is still the nagging issue if you change the phone number it will be longer than 7 digits.
7. Removed the popup interface and put the form for adding the codes to the main Asset page for the hotel with the grid of the rooms below it.
8. Added/fixed the ability to delete a door code.

To do -
1. Order of the room/lock list dropdown.
2. Autofill the date upon page entry - not when clicking into it.

Waiting on Sieu to indicate I can update the app - i.e. when it's not being used.

Pages to replace -
server/routes/app.js
server/views/dashboard.ejs
server/views/home.ejs
server/config/config.js

#13

Updated by Michael Milliron over 3 years ago

Still in progress - working on the updates - none of these changes are live - just recording for my info:
Completed -
1. Phone number now does not screw up the door code. If you delete and change phone it will update but not ADD to the door code.
2. Found an issue where if an Active Guest ID expired you could not add a new one and you could not delete the existing one from the list.
- Now if you get the response "No Password Record Exists" Delete the existing record in the grid then add it again. Plan is to make that automatic - that is a short term fix.

To do:
There is a big issue with the check out time, you cannot adjust it for anything other than 11am especially with the link to the number of days- I'm working on separating out date and time so they can be handled separately and the link to the number of days does not impact the time.

#14

Updated by Michael Milliron over 3 years ago

Updates completed and live - including
1. Door code no longer screws up if phone number mistyped and corrected - if phone is deleted or retyped the door code will update - max 7 digits
2. For better control dates and times are split up into separate fields.
3. Start date, start time, check out date, check out time all pre-fill and are visible
4. Start Time and Checkout Time fields - default are 3pm and 11am - to use current time click the check mark at the top of the control when you click into the field.
5. The app now handles expired Active Guest records - if any are expired, i.e. past the end date and time they will be removed from the list upon ANY new code being updated for any lock. This will help keep the list clean and stop that issue from occurring.
6. The Wait spinner when you click Add will only be visible for 3 seconds now. User must wait for the response or page refresh/grid update from the app if it stops before the update is complete. I can update that to 5 seconds if it's easier - looks like all updates should not take longer than that.
7. I've tested the 4 locks I have continuously as I was developing, both running from my PC and after I updated it on the web server. All four locks updated within seconds - literally. This does not guarantee there won't be issues up in Pinetop the ONLY difference is the Wi-fi communication with the locks.

Minor issues - I don't seem to have any control over what order the locks populate in the drop down. But that is on the radar.

#15

Updated by Michael Milliron over 3 years ago

Note - On the start time - I just verified - you can update the code AFTER 3pm even though it still says 3pm start - you may not need to change the time unless you are after midnight and scheduling for a checkin happening now. I'm pretty positive you cannot use a prior date.

#16

Updated by Michael Milliron over 3 years ago

Also - in testing the locks I didn't even bother looking at the status of the code in the app. I updated the code on the web page and then tested the lock immediately after. In only a few cases did I have to try the new code twice - all were updated within 30 seconds I'd say.

#17

Updated by Michael Milliron over 3 years ago

From email -
Create an overall user with code 3890 - that will be used by emps - same code used to get in office door.
Add Test property and put Michael's test locks under that

Sieu Ngo, 7:53 AM
also, rename 1st item to "Profile Name (Only Chg for Guest Laundry" ... perhaps put the comments underneath, a bit smaller if possible.
can u create a front desk id so it can't get kicked out?

Sieu Ngo, 59 min
and not sure if possible .. but on the guest phone and door code, any chance we can add spaces to make it easier to read?
no biggie if that is a time consuming thing
just hard to read a long string some times..
I would suggest putting a period 928.555.1212 - with a code of 555.1212 - just worried these dumbasses would actually "read" the period

Sieu Ngo, 57 min
guess coudl put in comment: Door code 7 digits of phone number + #
they wouldnt normally read that back unless overwritten
and any luck on room pull down to be in numeric order
as as mentioned last night, rather we test under mH or usnder "test" so that we don't have unnecesssayr entreis

Michael Milliron, 55 min
I'm going to have to write code to rearrange that if I can't find a better JS control than what is being used.

#18

Updated by Michael Milliron over 3 years ago

This Update completed:
Create an overall user with code 3890 - that will be used by emps - same code used to get in office door.

#19

Updated by Michael Milliron over 3 years ago

Overall user code updated to 3850 - per Sieu - 4/5

#20

Updated by Michael Milliron over 3 years ago

The following has been updated and is live now:
1. First field is now "Profile Name"
2. (Only Change for Guest Laundry) was added under the field - a bit smaller AND italizized
3. An issue was found where the profile name would ONLY save "Active Guest" regardless of what was entered. That has been fixed.
4. Door Code number is now spaced out more using font spacing - can be increased more if needed
5. Room numbers are now sorted by room number/name

Also available in: Atom PDF