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

I think you have communication problems HA<->Bridge, that’s the only explanation that makes sense. Is the bridge on the same LAN/WLAN of HA? Do you have VLANS in place? Do you have something between them?

HA is on LAN, Bridge on WLAN. Connection via Repeater, MESH network. should I put the bridge near to the router for a test? I’m not sure whether the bridge then will have connection to the lock, but i can try.

No, let’s first try this: in config.yaml put this code and restart HA. It activates debug logging for the webhook component of HA, so we can check HA’s logs for the details of the callback. If we see nothing, the callback is never arriving.

logger:
  default: warning
  logs:
    homeassistant.components.webhook: debug

ok done; what do you need now?

Log?:

</ {% set hook = states(‘input_text.nuki_bridge_callback_url’) %}

{% for callback in value_json.callbacks %}

{% if hook == (callback.url|urlencode) %}

{% set ns.callback_list = ns.callback_list + [ callback.id ] %}

{% endif %}

{% endfor %}

{% endif %} {{ ns.callback_list }}’

2021-08-07 20:31:25 WARNING (MainThread) [homeassistant.components.websocket_api.http.connection] [547781642032] Disconnected: Did not receive auth message within 10 seconds

formatted right now?

Open the door manually, wait 5 secs, close it. Then open it again, wait, and close it. This should trigger 2 callbacks, you should see them in HA logs with details: if you don’t see them, the bridge can’t call HA url, or the url configured is wrong.

Nope, you need to select the log (only the log lines) and click </>. :slight_smile:

2.9.3 like him

1 Like

Nothing in the logs. but now there is a message that my web
hook is unregistered??? !!!

ta-daaaaaaaaaaaaaaaaaaaaaaaaaa!! :slight_smile:

it means that the callback arrived, but the URL is not registered: it means the LL-token is WRONG! :slight_smile:

you are copy&pasting the token in a wrong way, you got to be sure it is copied exactly as it’s in HA, in the secret.

ok I try …copy and paste is oviously not my strength;-)

I noticed…it never took so long to solve a problem here…you beat every record! Gold Medalist. :slight_smile:

Can you show me that message of webhook unregistered from the log please? Why didn’t you paste it here? :slight_smile:

The message of the web hook is no longer there. I didn’t paste it because I didn’t see it before. Sorry. What I did now: I deleted the web hook and the long live token (I didn’t now that they are two different things until now. I put in the long live token up to this point. Now I put in the Webhook of Nuki Card Callback (automation). But this didn’t work either. I send you the whole

2021-08-07 21:01:05 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration gardena_smart_system which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-08-07 21:01:05 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration sonoff which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-08-07 21:01:05 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration musiccast_yamaha which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-08-07 21:01:05 ERROR (SyncWorker_2) [homeassistant.loader] The custom integration 'musiccast_yamaha' does not have a valid version key (None) in the manifest file and was blocked from loading. See https://developers.home-assistant.io/blog/2021/01/29/custom-integration-changes#versions for more details
2021-08-07 21:01:05 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration mbapi2020 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-08-07 21:01:05 WARNING (SyncWorker_5) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-08-07 21:01:07 WARNING (MainThread) [homeassistant.components.lovelace] Resources need to be specified in your configuration.yaml. Please see the docs
2021-08-07 21:01:09 WARNING (MainThread) [homeassistant.components.modbus.validators] Modbus Pool timeout(15) is adjusted(14) due to scan_interval
2021-08-07 21:01:09 WARNING (MainThread) [homeassistant.components.sensor] Platform rest not ready yet: The request to ':///' is missing either an 'http://'                         or 'https://' protocol.; Retrying in background in 30 seconds
2021-08-07 21:01:09 WARNING (MainThread) [homeassistant.components.sensor] Platform rest not ready yet: The request to ':///' is missing either an 'http://'                         or 'https://' protocol.; Retrying in background in 30 seconds
2021-08-07 21:01:09 WARNING (MainThread) [homeassistant.components.sensor] Platform rest not ready yet: The request to ':///' is missing either an 'http://'                         or 'https://' protocol.; Retrying in background in 30 seconds
2021-08-07 21:01:15 ERROR (MainThread) [snitun.client.client_peer] Challenge/Response error with SniTun server
2021-08-07 21:01:15 ERROR (MainThread) [hass_nabucasa.remote] Connection problem to snitun server
2021-08-07 21:01:16 INFO (Thread-4) [gardena.smart_system] Connected to Gardena API
2021-08-07 21:01:21 WARNING (MainThread) [homeassistant.config_entries] Config entry 'FRITZ!Box 7590' for upnp integration not ready yet: None; Retrying in background
2021-08-07 21:01:21 WARNING (MainThread) [homeassistant.config_entries] Config entry 'InternetGatewayDeviceV2 - FRITZ!Box 7590' for upnp integration not ready yet: None; Retrying in background
2021-08-07 21:01:24 WARNING (MainThread) [homeassistant.config_entries] Config entry '192.168.178.55' for daikin integration not ready yet: Server disconnected; Retrying in background
2021-08-07 21:01:29 ERROR (MainThread) [homeassistant.components.switch] Platform fritz does not generate unique IDs. ID 444E6D625F10-wi_fi_wlan_driouch already exists - ignoring switch.fritz_box_7590_wi_fi_wlan_driouch
2021-08-07 21:01:31 WARNING (MainThread) [homeassistant.components.frontend] Theme Dark - Blue not found
2021-08-07 21:01:33 WARNING (MainThread) [homeassistant.components.rest.sensor] REST result could not be parsed as JSON
2021-08-07 21:01:33 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{% set ns = namespace() %} {% set ns.callback_list = [] %} {% if (value_json.callbacks | count) > 0 %}
  {% set hook = states('input_text.nuki_bridge_callback_url') %}
  {% for callback in value_json.callbacks %}
    {% if hook == (callback.url|urlencode) %}
      {% set ns.callback_list = ns.callback_list + [ callback.id ] %}
    {% endif %}
  {% endfor %}
{% endif %} {{ ns.callback_list }}'
2021-08-07 21:05:53 WARNING (MainThread) [homeassistant.components.modbus.validators] Modbus Pool timeout(15) is adjusted(14) due to scan_interval

formatted right now?

The LL token is the token you generate in the HA profile. That token is part of the webhook URL. It’s not 2 separate things.

In order to create a webhook for an app/integration for HA, you create a token, and you add the token to this URL: http://hass_ip:8123/api/webhook/

So the webhook url becomes http://hass_ip:8123/api/webhook/ + LL-Token.

http://hass_ip:8123/api/webhook/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiI3OGQxMDJkNTdhMjY0M

Then you put that webhook URL in the app/device that triggers the callback. In our case the bridge. So when you open the door, or action the lock, the bridge notifies HA by calling the webhook URL, and HA looks at the token, it knows that there’s an integration/automation/something that registered that token, so it can read the data that has been sent with the webhook via HTTP POST.

If HA receives a callback saying unregistered webhook it means that someone called HA webhoo URL but with an unregistered LL token.

All clear now? Ok. Now tell me, what do you mean when you say “I put in the webhook of Nuki Card Callback”? What did you do exactly?

Yes!! You made it. :slight_smile:

image

I put this token in the secret.yaml at the point Nuki bridge web hook (don’t worry I created a new one later on). But I don’t have to do anything with this?:
image

</> doesn’t work. I have to press Bildschirmfoto 2021-08-07 um 21.54.48