# User Activated Alarm

**URL:** <https://discourse.nodered.org/t/user-activated-alarm/72782>\
**Category:** General\
**Created:** [27 December 2022 19:24 UTC](https://discourse.nodered.org/t/user-activated-alarm/72782 "2022-12-27T19:24:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rabrish](https://avatars.discourse-cdn.com/v4/letter/r/ebca7d/32.png) [@rabrish](https://discourse.nodered.org/u/rabrish)\
**Post date:** [27 December 2022 19:24 UTC](https://discourse.nodered.org/t/user-activated-alarm/72782/1 "2022-12-27T19:24:32Z")

</div>

Hello everyone!

I have a LoRaWAN Door/Window sensor which I could successfully integrated into NR (on RPi) through TTN and MQTT. I have an LED and text on my dashboard which shows whether the door is open or close.  
Now I want to add an alarm to it that when the door is open get an alarm on a buzzer connected to RPi. All good up to here, BUT I don't want this alarm be activated all time. I want to add a switch that when I go out, I click on that switch and activate the alarm.  
Looks like there is no AND operation for doing this. I can't find a way to get these two inputs (switch and sensor value) and act accordingly. Any help would be appreciated.

TIA.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [28 December 2022 13:24 UTC](https://discourse.nodered.org/t/user-activated-alarm/72782/2 "2022-12-28T13:24:08Z")

</div>

> [@rabrish](#):
>
> Looks like there is no AND operation for doing this.

Simplest way would be to use one of the "gate" nodes. Such as node-red-contrib-simplegate. This allows you to have a variable that opens/closes the gate and allows/prevents messages from getting through.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [11 January 2023 13:24 UTC](https://discourse.nodered.org/t/user-activated-alarm/72782/3 "2023-01-11T13:24:09Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
