Skip to content

Smartlock

Get a list of smartlocks.

GET /smartlock

Parameters:

Name Type Description Default
auth_id int

Filter by authorization ID.

None
type_ int

Filter by smartlock type.

None

Returns:

Name Type Description
dict dict[str, Any]

List of smartlocks.

Source code in nukiwebapi/smartlock.py
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
def list_smartlocks(self, auth_id: int | None = None, type_: int | None = None) -> dict[str, Any]:
    """Get a list of smartlocks.

    GET /smartlock

    Args:
        auth_id (int, optional): Filter by authorization ID.
        type_ (int, optional): Filter by smartlock type.

    Returns:
        dict: List of smartlocks.
    """
    params = {}
    if auth_id is not None:
        params["authId"] = auth_id
    if type_ is not None:
        params["type"] = type_

    return self.client._request("GET", "/smartlock", params=params or None).json()

Retrieve a smartlock by ID and return a SmartlockInstance wrapper.

Parameters:

Name Type Description Default
smartlock_id int

The ID of the smartlock.

required

Returns:

Name Type Description
SmartlockInstance SmartlockInstance

An instance with full data and convenience methods.

Source code in nukiwebapi/smartlock.py
33
34
35
36
37
38
39
40
41
42
43
44
45
46
def get_smartlock(self, smartlock_id: int) -> SmartlockInstance:
    """
    Retrieve a smartlock by ID and return a SmartlockInstance wrapper.

    Args:
        smartlock_id (int): The ID of the smartlock.

    Returns:
        SmartlockInstance: An instance with full data and convenience methods.
    """
    # Fetch the full smartlock data
    data = self.client._request("GET", f"/smartlock/{smartlock_id}")
    # Wrap in SmartlockInstance, preserving all API fields
    return SmartlockInstance(self, smartlock_id, data=data)

Update a smartlock.

POST /smartlock/{smartlockId}

Parameters:

Name Type Description Default
smartlock_id int

Smartlock ID.

required
data dict

Update payload.

None

Returns:

Name Type Description
None None

Empty response on success.

Source code in nukiwebapi/smartlock.py
48
49
50
51
52
53
54
55
56
57
58
59
60
def update_smartlock(self, smartlock_id: int, data: dict[str, Any] | None = None) -> None:
    """Update a smartlock.

    POST /smartlock/{smartlockId}

    Args:
        smartlock_id (int): Smartlock ID.
        data (dict, optional): Update payload.

    Returns:
        None: Empty response on success.
    """
    return self.client._request("POST", f"/smartlock/{smartlock_id}", json=data or {})

Delete a smartlock.

DELETE /smartlock/{smartlockId}

Parameters:

Name Type Description Default
smartlock_id int

Smartlock ID.

required

Returns:

Name Type Description
None None

Empty response on success.

Source code in nukiwebapi/smartlock.py
62
63
64
65
66
67
68
69
70
71
72
73
def delete_smartlock(self, smartlock_id: int) -> None:
    """Delete a smartlock.

    DELETE /smartlock/{smartlockId}

    Args:
        smartlock_id (int): Smartlock ID.

    Returns:
        None: Empty response on success.
    """
    return self.client._request("DELETE", f"/smartlock/{smartlock_id}")

Perform an action on a smartlock.

POST /smartlock/{smartlockId}/action

Parameters:

Name Type Description Default
smartlock_id int

Smartlock ID.

required
data dict

Action payload.

None

Returns:

Name Type Description
None None

Empty response on success.

Source code in nukiwebapi/smartlock.py
75
76
77
78
79
80
81
82
83
84
85
86
87
def action(self, smartlock_id: int, data: dict[str, Any] | None = None) -> None:
    """Perform an action on a smartlock.

    POST /smartlock/{smartlockId}/action

    Args:
        smartlock_id (int): Smartlock ID.
        data (dict, optional): Action payload.

    Returns:
        None: Empty response on success.
    """
    return self.client._request("POST", f"/smartlock/{smartlock_id}/action", json=data or {})

Lock a smartlock.

POST /smartlock/{smartlockId}/action/lock

Parameters:

Name Type Description Default
smartlock_id int

Smartlock ID.

required

Returns:

Name Type Description
None None

Empty response on success.

Source code in nukiwebapi/smartlock.py
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
def lock_smartlock(self, smartlock_id: int) -> None:
    """Lock a smartlock.

    POST /smartlock/{smartlockId}/action/lock

    Args:
        smartlock_id (int): Smartlock ID.

    Returns:
        None: Empty response on success.
    """
    return self.client._request("POST", f"/smartlock/{smartlock_id}/action/lock")

Unlock a smartlock.

POST /smartlock/{smartlockId}/action/unlock

Parameters:

Name Type Description Default
smartlock_id int

Smartlock ID.

required

Returns:

Name Type Description
None None

Empty response on success.

Source code in nukiwebapi/smartlock.py
102
103
104
105
106
107
108
109
110
111
112
113
def unlock_smartlock(self, smartlock_id: int) -> None:
    """Unlock a smartlock.

    POST /smartlock/{smartlockId}/action/unlock

    Args:
        smartlock_id (int): Smartlock ID.

    Returns:
        None: Empty response on success.
    """
    return self.client._request("POST", f"/smartlock/{smartlock_id}/action/unlock")

Update the admin PIN.

POST /smartlock/{smartlockId}/admin/pin

Parameters:

Name Type Description Default
smartlock_id int

Smartlock ID.

required
data dict

PIN payload.

None

Returns:

Name Type Description
None None

Empty response on success.

Source code in nukiwebapi/smartlock.py
115
116
117
118
119
120
121
122
123
124
125
126
127
def update_admin_pin(self, smartlock_id: int, data: dict[str, Any] | None = None) -> None:
    """Update the admin PIN.

    POST /smartlock/{smartlockId}/admin/pin

    Args:
        smartlock_id (int): Smartlock ID.
        data (dict, optional): PIN payload.

    Returns:
        None: Empty response on success.
    """
    return self.client._request("POST", f"/smartlock/{smartlock_id}/admin/pin", json=data or {})

Update advanced smartlock configuration.

POST /smartlock/{smartlockId}/advanced/config

Parameters:

Name Type Description Default
smartlock_id int

Smartlock ID.

required
data dict

Advanced config.

None

Returns:

Name Type Description
None None

Empty response on success.

Source code in nukiwebapi/smartlock.py
129
130
131
132
133
134
135
136
137
138
139
140
141
def update_advanced_config(self, smartlock_id: int, data: dict[str, Any] | None = None) -> None:
    """Update advanced smartlock configuration.

    POST /smartlock/{smartlockId}/advanced/config

    Args:
        smartlock_id (int): Smartlock ID.
        data (dict, optional): Advanced config.

    Returns:
        None: Empty response on success.
    """
    return self.client._request("POST", f"/smartlock/{smartlock_id}/advanced/config", json=data or {})

Update opener-specific advanced config.

POST /smartlock/{smartlockId}/advanced/openerconfig

Parameters:

Name Type Description Default
smartlock_id int

Smartlock (opener) ID.

required
data dict

Opener config.

None

Returns:

Name Type Description
None None

Empty response on success.

Source code in nukiwebapi/smartlock.py
143
144
145
146
147
148
149
150
151
152
153
154
155
def update_opener_advanced_config(self, smartlock_id: int, data: dict[str, Any] | None = None) -> None:
    """Update opener-specific advanced config.

    POST /smartlock/{smartlockId}/advanced/openerconfig

    Args:
        smartlock_id (int): Smartlock (opener) ID.
        data (dict, optional): Opener config.

    Returns:
        None: Empty response on success.
    """
    return self.client._request("POST", f"/smartlock/{smartlock_id}/advanced/openerconfig", json=data or {})

Update smartdoor-specific advanced config.

POST /smartlock/{smartlockId}/advanced/smartdoorconfig

Parameters:

Name Type Description Default
smartlock_id int

Smartdoor ID.

required
data dict

Smartdoor config.

None

Returns:

Name Type Description
None None

Empty response on success.

Source code in nukiwebapi/smartlock.py
157
158
159
160
161
162
163
164
165
166
167
168
169
def update_smartdoor_advanced_config(self, smartlock_id: int, data: dict[str, Any] | None = None) -> None:
    """Update smartdoor-specific advanced config.

    POST /smartlock/{smartlockId}/advanced/smartdoorconfig

    Args:
        smartlock_id (int): Smartdoor ID.
        data (dict, optional): Smartdoor config.

    Returns:
        None: Empty response on success.
    """
    return self.client._request("POST", f"/smartlock/{smartlock_id}/advanced/smartdoorconfig", json=data or {})

Update general smartlock config.

POST /smartlock/{smartlockId}/config

Parameters:

Name Type Description Default
smartlock_id int

Smartlock ID.

required
data dict

Config payload.

None

Returns:

Name Type Description
None None

Empty response on success.

Source code in nukiwebapi/smartlock.py
171
172
173
174
175
176
177
178
179
180
181
182
183
def update_config(self, smartlock_id: int, data: dict[str, Any] | None = None) -> None:
    """Update general smartlock config.

    POST /smartlock/{smartlockId}/config

    Args:
        smartlock_id (int): Smartlock ID.
        data (dict, optional): Config payload.

    Returns:
        None: Empty response on success.
    """
    return self.client._request("POST", f"/smartlock/{smartlock_id}/config", json=data or {})

Sync smartlock state.

POST /smartlock/{smartlockId}/sync

Parameters:

Name Type Description Default
smartlock_id int

Smartlock ID.

required
data dict

Sync payload.

required

Returns:

Name Type Description
None None

Empty response on success.

Source code in nukiwebapi/smartlock.py
185
186
187
188
189
190
191
192
193
194
195
196
197
def sync_smartlock(self, smartlock_id: int) -> None:
    """Sync smartlock state.

    POST /smartlock/{smartlockId}/sync

    Args:
        smartlock_id (int): Smartlock ID.
        data (dict, optional): Sync payload.

    Returns:
        None: Empty response on success.
    """
    return self.client._request("POST", f"/smartlock/{smartlock_id}/sync")

Apply bulk web configuration to smartlocks.

POST /bulk-web-config

Parameters:

Name Type Description Default
data dict

Bulk config payload.

None

Returns:

Name Type Description
None None

Empty response on success.

Source code in nukiwebapi/smartlock.py
199
200
201
202
203
204
205
206
207
208
209
210
def bulk_web_config(self, data: dict[str, Any] | None = None) -> None:
    """Apply bulk web configuration to smartlocks.

    POST /bulk-web-config

    Args:
        data (dict, optional): Bulk config payload.

    Returns:
        None: Empty response on success.
    """
    return self.client._request("POST", "/bulk-web-config", json=data or {})

Update web config for a smartlock.

POST /smartlock/{smartlockId}/web/config

Parameters:

Name Type Description Default
smartlock_id int

Smartlock ID.

required
data dict

Web config payload.

None

Returns:

Name Type Description
None None

Empty response on success.

Source code in nukiwebapi/smartlock.py
212
213
214
215
216
217
218
219
220
221
222
223
224
def update_web_config(self, smartlock_id: int, data: dict[str, Any] | None = None) -> None:
    """Update web config for a smartlock.

    POST /smartlock/{smartlockId}/web/config

    Args:
        smartlock_id (int): Smartlock ID.
        data (dict, optional): Web config payload.

    Returns:
        None: Empty response on success.
    """
    return self.client._request("POST", f"/smartlock/{smartlock_id}/web/config", json=data or {})