diff --git a/docs/automation/ring-to-open.md b/docs/automation/ring-to-open.md index aecd5603..df9299e5 100644 --- a/docs/automation/ring-to-open.md +++ b/docs/automation/ring-to-open.md @@ -1,6 +1,6 @@ -# Ring to open +# Ring to open -The [Stock Doorman Firmware](../firmware/stock-firmware.md) includes a `Ring to open` automation also known as `Party Mode`. +The [Stock Doorman Firmware](../firmware/stock-firmware.md) includes a `Ring to open` automation. ### What does it do? As the name already says, the entrance door will be opened as soon as someone rings the entrance doorbell. diff --git a/firmware/base.yaml b/firmware/base.yaml index 0e28fe39..1ba491ab 100644 --- a/firmware/base.yaml +++ b/firmware/base.yaml @@ -41,6 +41,11 @@ globals: restore_value: true initial_value: '0x3000' + - id: ring_to_open_command + type: int + restore_value: true + initial_value: '0x00000000' + # Board Setup esp32: board: esp32-s3-devkitc-1 @@ -346,6 +351,14 @@ binary_sensor: input: true inverted: true + # Ring to open - toggle switch automation + - platform: tcs_intercom + id: ring_to_open_toggle_command + internal: true + lambda: !lambda "return id(ring_to_open_command);" + on_press: + - switch.toggle: doorman_ring_to_open + number: - platform: template name: Ring to open delay @@ -437,6 +450,19 @@ text: entity_category: CONFIG icon: "mdi:console-network" + - platform: template + name: Toggle Ring to open Command + optimistic: true + mode: text + initial_value: '00000000' + on_value: + then: + - lambda: |- + id(ring_to_open_command) = std::stoi(x.c_str(), nullptr, 16); + disabled_by_default: true + entity_category: CONFIG + icon: "mdi:console-network" + event: - platform: template id: doorbell_pattern