It’s certainly possible to get the log using the web API, but there’s still the issue of having no callbacks from the web, which means you get notification of changed door status with delay.
I’m not sure how exactly would that work. Poll the door state API and when lock status changes, fetch latest log event and somehow send it from binding? Or poll the events endpoint as well and whenever new events appear send it? Due to the polling nature you would often get them in batches, sometimes maybe for multiple door opening if the polling interval is long enough.
Also how would that integration look like on a nuki thing? I captured a log when I came home today using auto-unlock and it looks like this:
{
"id": "aaaaaaaa",
"smartlockId": 123456789,
"deviceType": 0,
"name": "",
"action": 241, // door close
"trigger": 0,
"state": 0,
"autoUnlock": false,
"date": "2022-12-20T00:00:42.000Z",
"source": 0
},
{
"id": "bbbbbbb",
"smartlockId": 123456789,
"deviceType": 0,
"name": "",
"action": 240, // door open
"trigger": 0,
"state": 0,
"autoUnlock": false,
"date": "2022-12-20T00:00:21.000Z",
"source": 0
},
{
"id": "ccccccc",
"smartlockId": 123456789,
"deviceType": 0,
"authId": "xxxxxxxxx",
"name": "Firstname Lastname",
"action": 3, // unlatch
"trigger": 0,
"state": 0,
"autoUnlock": true,
"date": "2022-12-20T00:00:20.000Z",
"source": 0
},
What channels would be useful on a nuki thing with log history, separate channel for each attribute, or just send it in a for example trigger channel as a json string and let user deal with it using jsonpath transforms?