Jump to content

Integration of Locks in HA - No REST


Mecheng70

Recommended Posts

Posted (edited)

Update 4.0.10 now has the ability to set and delete user codes from HA!!!!!

THANK YOU @shbatm

 

 

No REST - kinda

I have the need to be able to change lock codes and control when lock codes are used or not used.  Typically I use HA for user interaction programs and ISY for more system control (almost scene control - lock unlocks then turn on patio light).  However there is no functionality that suits my need to be able to update ISY when not having direct access to my network.  That and having something that my SO is comfortable using.

Here is the basic set up:

ISY

  1. Create two integer variables.
    1. iDoorUser - make note of the variable ID.  In my case the ID was 28 
    2. iDoorCode - ID was 27
  2. Create two Network Resources for each lock.
    1. Add User - Named mine Program Doors.NAMEOFDOOR
      1. Create a New Resource 
      2. HTTP GET
      3. host: user:pass@172.16.5.251
        1. user - your username
        2. pass - your password
      4. port: 8080
      5. Path: /rest/zmatter/zwave/node/ZY022_1/security/user/${var.1.28}/set/code/${var.1.27}
        1. ZY002_1 - substitute your device number here.
        2. ${var.1.27} - iDoorCode ID
        3. ${var.1.1.28} - iDoorUser ID
      6. Click UPDATE and SAVE
    2. Delete Code - Named mine Delete Code Doors.NAMEOFDOOR
      1. Create a New Resource 
      2. HTTP GET
      3. host: user:pass@172.16.5.251
        1. user - your username
        2. pass - your password
      4. port: 8080
      5. Path: /rest/zmatter/zwave/node/ZY022_1/security/user/${var.1.28}/delete
        1. ZY002_1 - substitute your device number here.
        2. ${var.1.1.28} - iDoorUser ID
      6. Click UPDATE and SAVE
  3. Create one program for each ZWAVE lock - Take note of the Program Number
    1. IF - nothing needs to be here
    2. THEN - add the RESOURCE for the Add User
    3. ELSE - add the RESOURCE for the Delete User

HOMEASSISTANT

In home assistant, in an automation:

  1. Set the iDoorUser and iDoorCode - each require a call service for the Number: Set service
  2. Call the ISY/IoX Send Program Code- service using the Program Number.

That's pretty much it.  On the ISY I have created a repeat function that will wipe out all the codes and reprogram User 1.  So have fun with that.

Edited by Mecheng70
Update with HA info
  • Thanks 1
Posted

To summarize:

New services have been added in the hacs-isy994 (alpha testing) version and will also be added in an upcoming HA Core release (https://github.com/home-assistant/core/pull/88754).

Add custom services to ISY994 to set and delete Z-Wave Lock User Codes, which use a different end-point then other ISY Z-Wave Parameters. Services to be added are:

  • isy994.set_zwave_lock_user_code
  • isy994.delete_zwave_lock_user_code
  • Like 1
  • Thanks 1
Posted (edited)

Thanks again @shbatm

I will leave this here if someone is looking to create a way to update or delete user codes.  My situation is that I need to update a lock based on who is renting the unit (airbnb).  

Here is the card layout:

image.png.56a70387947e7cf69ba056b707abda2a.png

  • Row 1 - Left - uses a dropdown helper called "user_number_idooruser"
  • Row 1 - Right - users a text helper called "door_code_idoorcode"
  • Row 2 -  uses a dropdown helper called "locks", here the drop down options are lock.front, lock.casita, etc
  • Row 3 - Left - Uses a button that calls a service when activated.  The service for the left button is the one that sets the lock.front, users 3 to 8675309.
  • Row 3 - Right - Users the same button but calls a different service when clicked. The service for the right button deletes the user number 3 on the lock.front entity.  

Example of the lock selector:

image.png.3254664f01b0b00c17c133c8184af8b6.png

 


Script to set the lock code

service: isy994.set_zwave_lock_user_code
data:
  user_num: "{{ states('input_select.user_number_idooruser') | int }}"
  code: "{{ states('input_text.door_code_idoorcode') | int }}"
target:
  entity_id: "{{ states('input_select.locks') | string }}"

Script to delete the lock code.

service: isy994.delete_zwave_lock_user_code
data:
  user_num: "{{ states('input_select.user_number_idooruser') | int }}"
target:
  entity_id: "{{ states('input_select.locks') | string }}"

 

Have tested this and the ISY does report the status of user added or user deleted.  Thanks again @shbatm
 

Edited by Mecheng70
Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      37k
    • Total Posts
      371.4k
×
×
  • Create New...