mirror of
https://github.com/Anonym-tsk/smart-domofon.git
synced 2025-12-06 11:36:57 +03:00
111 lines
2.7 KiB
YAML
111 lines
2.7 KiB
YAML
switch:
|
|
# Automatically open door switch
|
|
- platform: template
|
|
name: "${board_name} automatically open"
|
|
id: auto_open
|
|
icon: "mdi:door-open"
|
|
lambda: |-
|
|
return id(mode_auto_open);
|
|
turn_on_action:
|
|
- globals.set:
|
|
id: mode_auto_open
|
|
value: 'true'
|
|
turn_off_action:
|
|
- globals.set:
|
|
id: mode_auto_open
|
|
value: 'false'
|
|
on_turn_on:
|
|
- lambda: |-
|
|
id(mode_auto_open_once) = false;
|
|
id(mode_auto_reject) = false;
|
|
|
|
# Automatically open door once switch
|
|
- platform: template
|
|
name: "${board_name} automatically open once"
|
|
id: auto_open_once
|
|
icon: "mdi:door-open"
|
|
lambda: |-
|
|
return id(mode_auto_open_once);
|
|
turn_on_action:
|
|
- globals.set:
|
|
id: mode_auto_open_once
|
|
value: 'true'
|
|
turn_off_action:
|
|
- globals.set:
|
|
id: mode_auto_open_once
|
|
value: 'false'
|
|
on_turn_on:
|
|
- lambda: |-
|
|
id(mode_auto_open) = false;
|
|
id(mode_auto_reject) = false;
|
|
|
|
# Automatically reject call switch
|
|
- platform: template
|
|
name: "${board_name} automatically reject"
|
|
id: auto_reject
|
|
icon: "mdi:door-closed-lock"
|
|
lambda: |-
|
|
return id(mode_auto_reject);
|
|
turn_on_action:
|
|
- globals.set:
|
|
id: mode_auto_reject
|
|
value: 'true'
|
|
turn_off_action:
|
|
- globals.set:
|
|
id: mode_auto_reject
|
|
value: 'false'
|
|
on_turn_on:
|
|
- lambda: |-
|
|
id(mode_auto_open) = false;
|
|
id(mode_auto_open_once) = false;
|
|
|
|
# Mute sound switch
|
|
- platform: template
|
|
name: "${board_name} mute sound"
|
|
id: mute
|
|
icon: "mdi:volume-off"
|
|
lambda: |-
|
|
return id(mode_mute);
|
|
turn_on_action:
|
|
- globals.set:
|
|
id: mode_mute
|
|
value: 'true'
|
|
turn_off_action:
|
|
- globals.set:
|
|
id: mode_mute
|
|
value: 'false'
|
|
on_turn_on:
|
|
- lambda: |-
|
|
id(mode_mute_once) = false;
|
|
id(relay_mute).turn_on();
|
|
id(relay_phone).turn_off();
|
|
on_turn_off:
|
|
- lambda: |-
|
|
id(relay_phone).turn_on();
|
|
id(relay_mute).turn_off();
|
|
|
|
# Mute sound once switch
|
|
- platform: template
|
|
name: "${board_name} mute sound once"
|
|
id: mute_once
|
|
icon: "mdi:volume-off"
|
|
lambda: |-
|
|
return id(mode_mute_once);
|
|
turn_on_action:
|
|
- globals.set:
|
|
id: mode_mute_once
|
|
value: 'true'
|
|
turn_off_action:
|
|
- globals.set:
|
|
id: mode_mute_once
|
|
value: 'false'
|
|
on_turn_on:
|
|
- lambda: |-
|
|
id(mode_mute) = false;
|
|
id(relay_mute).turn_on();
|
|
id(relay_phone).turn_off();
|
|
on_turn_off:
|
|
- lambda: |-
|
|
id(relay_phone).turn_on();
|
|
id(relay_mute).turn_off();
|