Nuki Card with Callback support (supports both Lock & Opener, it replaces the official integration)

Yes, if you refer to None without quotes it’s because it’s a binary_sensor, I first enclosed it with quotes and it didn’t work, I found out had to put it without quotes. probably there’s a better style to code that state, but I’m not at the stylistic level yet. :smiley:

Doesn’t work without single quotes?

Checked/modified all states() is_state() is_statte_attr() in templates.yaml. v4.4 released. :slight_smile:

@Friedrieck IT WOOOOOOOOOOOOOOOOOOOOOOORKS!!!

I did template reload and I got this:

image

NO ERRORS IN THE LOG ANYMORE AFTER RELOAD!!

So freakiiiiiiiiiiiiiiiiiing happy!!! :rofl:

I’ll do more testing, restarting HA too…if it works, we’re done! :smiley:

Thank you my friend!!!

1 Like

And check this: notice the event? it means it was initialized/refreshed by platform event. :smiley:

I added these Trigger Variables to debug better…

        trigger_platform: "{{ trigger.platform }}"
        trigger_event: "{{ trigger.event }}"
        trigger_event_type: "{{ trigger.event.event_type }}"
        trigger_event_data: "{{ trigger.event.data }}"
1 Like

Excellent! You can now remove your reservations:

[…]

image

Now we can monitor things better. :slight_smile:

Are you sure we’re done? As an italian, I’m a little bit superstitious…:smiley: (joking)

Now tell me the truth: when you said there’s light at the end of the tunnel, you had already tested it and noticed it worked ok, right? :smiley:

@mahikeulbody @Joerg my friends, can you please test v4.4? It should finally solve the restart/reload issue where the sensors were not initialized. Now they are. :slight_smile:

Please let me know it works ok also for you so we’re basically done. Thank you so much.

Honestly, no. I have my own nuki integration and am too lazy to do all the copy/paste/reload. I don’t mind debugging by reading the code (certainly less efficient, as proven above!)
But I think I’ll integrate some of the outcome of your work, as my door sensor is only based on the callback at the moment (I don’t think I need all of the other sensors, I’m happy with these info in the door sensor’s attributes).

I’m sure you know how to do it! :smiley:

Thanks for the debugging. It’s incredible it was the quotes around those states…many night hours spent for these stupid things…

Tested: it works ! :clap: :clap: :clap:

I will do more intensive tests, including to check if this “door sensor jammed” continues to happen. Nice work anyway !

And may be, to raise the perfection:

Talked too soon…:frowning:

After a restart:


image

Weird…looks like at HA restart, the sensors states retrieved through the REST call are not ready yet.

Furthermore, since the sensors are available but in a weird state, I tried pressing LOCK, and I expected the callback to refresh the status, instead they went to unavailable. :frowning:

HA restart creates big issues…it means the code is still not working as we expected…

Did you try an HA restart? It didn’t work for me…looking into it now.

Yes I told too fast too when I saw the Nuki Lock Action icon refreseh at restart. But if I use it, I have the message

Nuki Lock Action: Error executing script. Service not found for call_service at pos 1: Unable to find service rest_command.nuki_lock_action

nope, that’s not the problem. you are having a different issue…check the configuration…HA is telling you it doesn’t find the rest_command.

Yep, too many manipulations to try things and I forgot to re-insert the !include rest_commands.yaml after restoring a config snapshot. Sorry.

No, I’m sorry for all these modifications in a short time…and thanks for your help.

Now we have to solve this HA restart issue…looks like sensors through the REST command are not ready yet when the triggered sensor comes up.

Hoping it is not again a config problem on my side:
I open my door (so it is unlocked also)
I restart HA
I get that
Screenshot_20210530_135638

Nuki Door State : Fermée (closed in french)
Nuki Door Sensor State : open

(I checked: no sensor door jammed)

(now I can lock/unlock)

Exactly, that’s the problem. And if you press lock/unlock, it executes the action, but the sensor become unavailable. :frowning:

I’m investigating…it’s weird…