Skip to content

Commit

Permalink
Rename Sensors
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Aug 13, 2024
1 parent 9d1ed2d commit ea36849
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions docs/firmware/nuki-bridge-firmware.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ You can connect your Doorman via USB-C and click the button below to install the

### Switches
- Ring To Open `doorman_ring_to_open`
- Ring To Open Confirmation `doorman_ring_to_open_confirmation` <Badge type="info" text="Disabled by default" />
- Ring To Open: Confirmation `doorman_ring_to_open_confirmation` <Badge type="info" text="Disabled by default" />
- Relay `doorman_relay` <Badge type="info" text="Disabled by default" />
- Nuki Pairing Mode `nuki_pairing_mode` <Badge type="info" text="Disabled by default" />

Expand All @@ -78,8 +78,8 @@ You can connect your Doorman via USB-C and click the button below to install the
- Command: Pick up phone `pick_up_phone_command_input` <Badge type="info" text="Disabled by default" />
- Command: Hang up phone `hang_up_phone_command_input` <Badge type="info" text="Disabled by default" />
- Command: Ring To Open Toggle `ring_to_open_toggle_command` <Badge type="info" text="Disabled by default" />
- Ring To Open Delay `ring_to_open_delay` <Badge type="info" text="Disabled by default" />
- Ring To Open Timeout `ring_to_open_timeout_mode` <Badge type="info" text="Disabled by default" />
- Ring To Open: Delay `doorman_ring_to_open_delay` <Badge type="info" text="Disabled by default" />
- Ring To Open: Timeout `doorman_ring_to_open_timeout_mode` <Badge type="info" text="Disabled by default" />

## Pairing your Nuki Lock
Depending on the PCB revision, press the `FLASH` or `PRG` button on the Doorman PCB for 5 seconds until the Status LED starts flashing purple or turn on the `Nuki Pairing Mode` switch in Home Assistant. Press the Button on your Nuki Lock for 5 seconds until the light-ring turns on.
Expand Down
6 changes: 3 additions & 3 deletions docs/firmware/stock-firmware.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ You can connect your Doorman via USB-C and click the button below to install the

### Switches
- Ring To Open `doorman_ring_to_open`
- Ring To Open Confirmation `doorman_ring_to_open_confirmation` <Badge type="info" text="Disabled by default" />
- Ring To Open: Confirmation `doorman_ring_to_open_confirmation` <Badge type="info" text="Disabled by default" />
- Relay `doorman_relay` <Badge type="info" text="Disabled by default" />

### Buttons
Expand All @@ -66,8 +66,8 @@ You can connect your Doorman via USB-C and click the button below to install the
- Command: Pick up phone `pick_up_phone_command_input` <Badge type="info" text="Disabled by default" />
- Command: Hang up phone `hang_up_phone_command_input` <Badge type="info" text="Disabled by default" />
- Command: Ring To Open Toggle `ring_to_open_toggle_command` <Badge type="info" text="Disabled by default" />
- Ring To Open Delay `ring_to_open_delay` <Badge type="info" text="Disabled by default" />
- Ring To Open Timeout `ring_to_open_timeout_mode` <Badge type="info" text="Disabled by default" />
- Ring To Open: Delay `doorman_ring_to_open_delay` <Badge type="info" text="Disabled by default" />
- Ring To Open: Timeout `doorman_ring_to_open_timeout_mode` <Badge type="info" text="Disabled by default" />



Expand Down
22 changes: 11 additions & 11 deletions firmware/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ tcs_intercom:

select:
- platform: template
id: ring_to_open_timeout_mode
id: doorman_ring_to_open_timeout_mode
name: Ring To Open Timeout
icon: mdi:clock-fast
optimistic: true
Expand Down Expand Up @@ -200,7 +200,7 @@ switch:
- script.stop: ring_to_open_timer

- platform: template
name: Ring To Open Confirmation
name: "Ring To Open: Confirmation"
icon: mdi:bell-check
id: doorman_ring_to_open_confirmation
restore_mode: RESTORE_DEFAULT_OFF
Expand Down Expand Up @@ -316,20 +316,20 @@ binary_sensor:
# Deactivate Ring To Open when Ring once is selected
- if:
condition:
- lambda: !lambda 'return id(ring_to_open_timeout_mode).state == "Ring once";'
- lambda: !lambda 'return id(doorman_ring_to_open_timeout_mode).state == "Ring once";'
then:
- switch.turn_off: doorman_ring_to_open

# If delay is 60 seconds, use random delay from 5 to 20 seconds
- if:
condition:
number.in_range:
id: ring_to_open_delay
id: doorman_ring_to_open_delay
above: 59
then:
- delay: !lambda "return 5000 + (rand() % 10000);"
else:
- delay: !lambda "return id(ring_to_open_delay).state*1000;"
- delay: !lambda "return id(doorman_ring_to_open_delay).state*1000;"

- tcs_intercom.send:
command: !lambda "return id(first_door_opener_command);"
Expand Down Expand Up @@ -486,8 +486,9 @@ binary_sensor:

number:
- platform: template
name: Ring To Open Delay
id: ring_to_open_delay
name: "Ring To Open: Delay"
id: doorman_ring_to_open_delay
icon: "mdi:clock-end"
mode: slider
min_value: 0
max_value: 60
Expand All @@ -496,9 +497,8 @@ number:
restore_value: true
initial_value: 0
unit_of_measurement: seconds
disabled_by_default: true
entity_category: CONFIG
icon: "mdi:clock-end"
disabled_by_default: true

text:
- platform: template
Expand Down Expand Up @@ -637,10 +637,10 @@ script:
# Turn off Ring To Open Mode after selected time
- if:
condition:
- lambda: !lambda 'return id(ring_to_open_timeout_mode).state != "Never" && id(ring_to_open_timeout_mode).state != "Ring once";'
- lambda: !lambda 'return id(doorman_ring_to_open_timeout_mode).state != "Never" && id(doorman_ring_to_open_timeout_mode).state != "Ring once";'
then:
- delay: !lambda |-
std::string str = id(ring_to_open_timeout_mode).state;
std::string str = id(doorman_ring_to_open_timeout_mode).state;
std::vector<std::string> v;
char * token;
char seps[] = " ";
Expand Down

0 comments on commit ea36849

Please sign in to comment.