59 lines
1.5 KiB
YAML
59 lines
1.5 KiB
YAML
blueprint:
|
|
name: Nimly lås - Enable/Disable användare
|
|
description: Aktivera/inaktivera användare via MQTT till Nimly-lås i Zigbee2MQTT.
|
|
domain: automation
|
|
input:
|
|
trigger_time:
|
|
name: Tidpunkt
|
|
description: När automationen ska köras
|
|
selector:
|
|
time: {}
|
|
lock_device:
|
|
name: Välj låsenhet
|
|
description: Låset som ska styras
|
|
selector:
|
|
entity:
|
|
domain: lock
|
|
user_id:
|
|
name: Användar-ID
|
|
description: ID för användaren på låset
|
|
selector:
|
|
number:
|
|
min: 1
|
|
max: 250
|
|
pin_code:
|
|
name: PIN-kod
|
|
description: PIN-kod för användaren. Sätt till null för att ta bort den.
|
|
default: null
|
|
selector:
|
|
text:
|
|
enabled:
|
|
name: Aktivera användare
|
|
description: true för att aktivera, false för att inaktivera
|
|
selector:
|
|
boolean: {}
|
|
|
|
mode: single
|
|
|
|
triggers:
|
|
- trigger: time
|
|
at: !input trigger_time
|
|
|
|
variables:
|
|
topic: "zigbee_home_2/h014s/set/pin_code"
|
|
user_id: !input user_id
|
|
pin_code: !input pin_code
|
|
enabled: !input enabled
|
|
|
|
actions:
|
|
- service: mqtt.publish
|
|
data:
|
|
topic: "{{ topic }}"
|
|
payload: >
|
|
{
|
|
"user": {{ user_id }},
|
|
"user_type": "unrestricted",
|
|
"user_enabled": {{ enabled | lower }},
|
|
"pin_code": {{ 'null' if pin_code == 'null' else '"' ~ pin_code ~ '"' }}
|
|
}
|