Closed kevincw01 closed 1 year ago
Doing some additional investigation, if in developer tools I look at the state of code slot 1-9, I see all the correct codes that were previously set by smart things. This tells me that the lock was able to send the current codes to keymaster successfully. Additionally, I can use the add code to lock keymaster service in developer tools to change one of the code slots to a new unique code and that works on the lock. This tells me that keymaster can new codes to the lock successfully. So it appears my issue is with the lovelace UI. The lovelace ui came from the yaml file that was created upon install and i did a simple copy/paste so I'm not sure where to troubleshoot.
I am having a similar issue: forever adding and deleting....For some of my unused slots, the code does seem to eventually get added as I tested it from the lock itself but the UI doesn't seem to reflect that. Additionally, my existing codes never pulled over.
Even more odd, when I tried to add a subordinate lock (second keymaster instance) I get one of these for each slot:
I gave up on key master and switched to "zwave js UI" add on in place of standard zwave js. 2 key things it provides, 1) you at least have access to a clunky UI to dorectly see/maintain codes if all else fails. 2) you can turn on mqtt in the addon and get access to what codes are actually in the lock after setting them so you know if it worked. Then I built my own basic Lovelace card and some loght automations to manage the codes in a user friendly way. It's working great and is reliablr but ofcourse is not as advanced as keymaster.
On Fri, Oct 7, 2022, 5:10 PM Tony Marzullo @.***> wrote:
I am having a similar issue: forever adding and deleting....For some of my unused slots, the code does seem to eventually get added as I tested it from the lock itself but the UI doesn't seem to reflect that. Additionally, my existing codes never pulled over.
Even more odd, when I tried to add a subordinate lock (second keymaster instance) I get one of these for each slot: [image: image] https://user-images.githubusercontent.com/8526092/194677201-164eae9a-f4c9-4818-b5c6-fded446a1298.png
— Reply to this email directly, view it on GitHub https://github.com/FutureTense/keymaster/issues/300#issuecomment-1272171757, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADPEIY5B4JJKYZQ2TLAGBLWCC3Y3ANCNFSM6AAAAAAQO2EYQE . You are receiving this because you authored the thread.Message ID: @.***>
@FutureTense maybe I've found the issue. I'm using danalock V3 Seems like there was a breaking change somewhere in the HA / ZWaveJS.
Your current implementation of add_code
:
servicedata[ATTR_ENTITY_ID] = entity_id
await call_service(
hass, ZWAVE_JS_DOMAIN, SERVICE_SET_LOCK_USERCODE, servicedata
)
Seems like SERVICE_SET_LOCK_USERCODE
just adds / registers the code.
You have to call something like zwave_js.set_value
afterwards with attributes below to enable it
service: zwave_js.set_value
data:
command_class: 99
endpoint: 0
property: userIdStatus
property_key: <code slot number>
value: 1 // this sets the status from available to enabled
target:
device_id: <my device id>
This works:
async def add_code(
hass: HomeAssistant, entity_id: str, code_slot: int, usercode: str
) -> None:
"""Set a user code."""
_LOGGER.debug("Attempting to call set_usercode...")
servicedata = {
ATTR_CODE_SLOT: code_slot,
ATTR_USER_CODE: usercode,
}
if async_using_zwave_js(
entity_id=entity_id, ent_reg=async_get_entity_registry(hass)
):
servicedata[ATTR_ENTITY_ID] = entity_id
await call_service(
hass, ZWAVE_JS_DOMAIN, SERVICE_SET_LOCK_USERCODE, servicedata
)
enable_code_service_data = {
ATTR_ENTITY_ID: entity_id,
"command_class": 99,
"endpoint": 0,
"property": "userIdStatus",
"property_key": code_slot,
"value": 1,
}
await call_service(
hass, ZWAVE_JS_DOMAIN, "set_value", enable_code_service_data
)
else:
raise ZWaveIntegrationNotConfiguredError
That would be a bug in the zwave_js
integration then as setting and clearing codes should also enable/disable the slot.
When I can call the zwave_js service it sets the enable for both of my 910 kwikset locks.
On Sat, Oct 22, 2022, 11:53 AM Chris @.***> wrote:
That would be a bug in the zwave_js integration then as setting and clearing codes should also enable/disable the slot.
— Reply to this email directly, view it on GitHub https://github.com/FutureTense/keymaster/issues/300#issuecomment-1287883059, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADPEI4P2R7KNDIXJPGXKSDWEQZZFANCNFSM6AAAAAAQO2EYQE . You are receiving this because you authored the thread.Message ID: @.***>
@firstof9 will you create a ticket in the integration github pages? Or should I do it?
@firstof9 will you create a ticket in the integration github pages? Or should I do it?
You're going to need driver logs to prove this is what's occurring, my 910 clears and sets codes fine.
Mine clears and sets them fine too. Though I've noticed that occasionally it will get stuck with adding / deleting. Normally, when this happens I have to call the keymaster.set_code or keymaster.clear_code functions manually. What's more, is that sometimes it doesn't seem to actually take until I go change the log level of the zwave-js integration to debug level in the UI!
It's sorta weird.
What's more, is that sometimes it doesn't seem to actually take until I go change the log level of the zwave-js integration to debug level in the UI!
When you do this you're restarting the driver, same thing as restarting the container/addon.
I don't think it's actually restarting the driver because I don't see anything in the logs on it rebuilding the mesh network like I do when the addon is restarted. I think it's much more like calling the logger.set_level service call to dynamically change the logging level.
Changing the log level in zwavejs-ui reloads the driver. Tail your logs then change the logging level, you'll see the driver reload.
Describe the bug When I add a code to any code slot and enable it, the pin status says "adding" forever. I can lock and unlock the lock manually without issue.
Environment (please complete the following information):
Logs Core:
zwave_jz:
Screenshots
Additional context This lock was previously paired with a smartthings hub and the codes that were set by that integration still work. I did properly exclude the device and include it on HA and I can lock and unlock it. The codes I have not tried to set with keymaster say "deleting".