FutureTense / keymaster

Home Assistant integration for managing Z-Wave enabled locks
MIT License
219 stars 43 forks source link

ISSUE: Cannot get notifications to work. #317

Closed joeinaustin closed 1 year ago

joeinaustin commented 1 year ago

Describe the bug No form of notification works from keymaster. I followed the wiki instuctions and used the code example for my scripts.yaml. I can manually create different types of notifications from dev tools, but nothing is ever generated from keymaster. I do see lock status updates in the history and noticiation is turned on for all active codes. Nothing showing up in the logs at all. What else can I look at???

Environment (please complete the following information):

Logs Nothing relevant to paste

Screenshots Let me know which would help

I did add a second script (see below) in case my naming conventions were off. I found some docs online that show it with a keymaster prefix. That was no help.

front_lock_manual_notify:
  mode: parallel
  sequence:
    - service: notify.notify
      data:
        title: "{{ title }}"
        message: "{{ message }}"
# created dup of above to to unclear naming conventions
keymaster_front_lock_manual_notify:
  mode: parallel
  sequence:
    - service: notify.notify
      data:
        title: "{{ title }}"
        message: "{{ message }}"
joeinaustin commented 1 year ago

I also tried setting the sensors back to "fake" as in the video. No difference. I can still get my own notifications to fire when the door opens, but I have no idea how to grab user codes into the message when the the lock is unlocked. I thought I was in good shape when the automations showed up. Not so.

Reinstalling everything seems to have helped, but not solved my problem. It would be great to understand how this is supposed to work. It appears that automations are NOT used for user code notify. Right? So then how is this supposed to work? I see something about a "bus" used for something. I see the common code that contains some notify. So what gets called where?? Is there a service or event I should be looking at? What is the first thing I should be looking for in this chain of many pieces????

firstof9 commented 1 year ago

KeyMaster digests the zwavejs events and outputs it's own on top of them:

https://github.com/FutureTense/keymaster/blob/main/custom_components/keymaster/helpers.py#L209-L254

If your zwavejs events are not firing, the automations that are generated will not fire.

joeinaustin commented 1 year ago

According to the zwave log, events and notifications are firing. Here is the latest example when I input a user code...

image

Why isn't km responding to this?

firstof9 commented 1 year ago

Those are the alarm sensors, you have to make sure those are enabled and set KeyMaster to use them. Now that your automations are populating correctly, it should work.

joeinaustin commented 1 year ago

They are enabled. How do I set km to use them?

firstof9 commented 1 year ago

From the configure menu.

joeinaustin commented 1 year ago

I see no way to do that.

joeinaustin commented 1 year ago

It has been set this since you had me change it before, not working......

image
joeinaustin commented 1 year ago

I can see the alerm level changing in the ui, I can see events in the log. Why is km doing nothing about it?

firstof9 commented 1 year ago

You should be able to check the trace on the automation to find out why it's not firing from HA Settings -> Automations and Scenes -> 3 dots next to the automation and select Trace

joeinaustin commented 1 year ago

which one?

joeinaustin commented 1 year ago

This one has never fired and has no trace info.

image
firstof9 commented 1 year ago

I've reviewed the code, looks like one of the revisions moved some of the alarm type/level code out of the proper location, I'll be issuing an update for that shortly.

joeinaustin commented 1 year ago

ok

firstof9 commented 1 year ago

If the issue persists after the update please reopen.

joeinaustin commented 1 year ago

The notifications are still not correct. I do get notifications now (since last update) but they are rarely correct. It says "keypad unlock" when it is actually locked, it says keypad unlock when when locked manually from the inside. It references the last used code when no code is used. It is almost never correct.

joeinaustin commented 1 year ago

Please re-open.