Hey, I created it exactly there. The other one is under: settings, home assistant cloud, scroll down and there is a webhook section. When I create the long lived token, this is created automatically. I used the long lived access token. But again, it will not work.
Hi Allessandro,
I had a look to Peters HA with teamviewer, just to rule out he configured it wrong.
As far I could see everything is okay, but to be sure we generated a new LL and also pasted the code again to nuki_card_callback.yaml
After a restart he gets this:
Logger: homeassistant.components.rest.sensor
Source: components/rest/sensor.py:177
Integration: RESTful (documentation, issues)
First occurred: 11:28:06 (1 occurrences)
Last logged: 11:28:06
REST result could not be parsed as JSON
Logger: homeassistant.helpers.template
Source: helpers/template.py:1417
First occurred: 11:28:06 (1 occurrences)
Last logged: 11:28:06
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 }}'
I am getting mad/stupid
Worked before now not.
I have successfull cals on nuki’s side (web ui log)
OnHa side however several sensors are not defined (door status etc)
2021-08-08 12:00:18 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-08 12:00:18 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-08 12:00:18 WARNING (MainThread) [homeassistant.components.sensor] Platform rest not ready yet: The request to ':///' is missing either an 'http://'
furthermore the sensors from where the data is populated seem to be populated:
This means the REST call got strange result back from the bridge, it was not a valid JSON structure.
It can happen, but if it ALWAYS happens, there’s a problem.
Did you check on the bridge if the callback was configured? because even if the callback sensor doesn’t work, you can make the integration work by adding the callback manually on the bridge, Nuki Card will receive it and update the sensor.
I made the callback sensor just to autoconfigure and check the bridge config, but you can always configure it manually. The important thing is that the callbacks are sent by the bridge and that Nuki Card receives them.
Just trigger a callback, locking/unlocking or opening/closing the door manually, and the sensors should refresh.
Does it do it every time you restart HA?
2021-08-08 12:00:18 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-08 12:00:18 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-08 12:00:18 WARNING (MainThread) [homeassistant.components.sensor] Platform rest not ready yet: The request to ':///' is missing either an 'http://'
This is normal when you restart HA, it depends on how fast the hw platform is, sometimes the REST sensor is called before its configuration, but it’s not a problem, it’s a warning. I have it too…but only one line, not three. But I’m running on a powerful intel NUC. Do you use it on a RPi?
Nope, I didn’t. Maybe you can post the command for checking and adding a callback manually, so Peter can try.
Another question: does Nuki Web have to be enabled?
Good catch, I notice the web logs are far more detailed, never used those, I will in the future.
When http calls from Nuki Card fail, it’s because there’s some other http call from another app/sw, either the official integration, or the Nuki App on the mobile, or whatever. Try to minimize this, because the bridge is limited, it can process only one call at a time and doesn’t have a queue. So if it’s processing an http request, the other will fail.
Keep in mind that I had him enable debug for webhook. And he told me that HA wrote that the webhook was not registered. That means the LL token configured on the bridge is not the one configured in HA.
ok, so it’s fast, and it tries to initialize all 3 REST sensors before they’re configured. Unfortunately I can’t do anything for that: the startup of HA can lead to warnings like that.
The only solution I thought of is not use REST sensors anymore and just use command_line with curl, so I have total control and don’t have to worry of the startup phase of HA.
I am struggling .
Is there a simple way to “reset” everything to initial state ?
Delete the WebHook in ha
reset auth in nuki.
In short start from scratch
Remove the webhook on the bridge: http://nuki-bridge.axel.dom:8080/callback/remove?id=0&token=xxxxx
Restart HA, the Nuki Card should then check that the bridge has no callback configured and add it back, that’s it.
Don’t know why you refer to nuki auth…that is only needed to activate the API, once it’s activated, and you have a token, you’re ok. In any case, you can disable and re-enable from the Nuki mobile app.