# Connect Sonoff Mini R4 to an alarm output

**URL:** <https://forum.ewelink.cc/t/connect-sonoff-mini-r4-to-an-alarm-output/30103>\
**Category:** Free discussion\
**Created:** [March 31, 2024, 7:36am UTC](https://forum.ewelink.cc/t/connect-sonoff-mini-r4-to-an-alarm-output/30103 "2024-03-31T07:36:38Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![devishian](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@devishian](https://forum.ewelink.cc/u/devishian)\
**Post date:** [March 31, 2024, 7:36am UTC](https://forum.ewelink.cc/t/connect-sonoff-mini-r4-to-an-alarm-output/30103/1 "2024-03-31T07:36:38Z")

</div>

In our house we have a traditional gas alarm that is not smart. The controller keeps open a normally closed AC valve and, if it smells gas, it emits an alarm and it interrupts the alimentation of the valve.

I would like to make it smart through a Mini R4 so that I can monitor everything with iHost, node red and home assistant. I have found out that my controller has also an AC output to add an external siren. I would like to monitor this output with a Mini R4. How should I wire the Mini R4 to the controller?

---

<div class="post-metadata">

**Author:** ![andy.wolf](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@andy.wolf](https://forum.ewelink.cc/u/andy.wolf)\
**Post date:** [March 31, 2024, 7:45am UTC](https://forum.ewelink.cc/t/connect-sonoff-mini-r4-to-an-alarm-output/30103/2 "2024-03-31T07:45:29Z")

</div>

> [@devishian](#):
>
> How should I wire the Mini R4 to the controller?

You should wire the output of your controller to the S1/S2 on your MiniR4.

If your controller then triggers, it should change the state of your MiniR4.

---

<div class="post-metadata">

**Author:** ![devishian](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@devishian](https://forum.ewelink.cc/u/devishian)\
**Post date:** [March 31, 2024, 8:24am UTC](https://forum.ewelink.cc/t/connect-sonoff-mini-r4-to-an-alarm-output/30103/3 "2024-03-31T08:24:14Z")

</div>

Just this two wires to Mini R4?

---

<div class="post-metadata">

**Author:** ![andy.wolf](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@andy.wolf](https://forum.ewelink.cc/u/andy.wolf)\
**Post date:** [March 31, 2024, 9:04am UTC](https://forum.ewelink.cc/t/connect-sonoff-mini-r4-to-an-alarm-output/30103/4 "2024-03-31T09:04:23Z")

</div>

> [@devishian](#):
>
> Just this two wires to Mini R4?

The Mini R4 also needs permanent power on N and ‘L In’

If you want, you can also connect something on ‘L Out’ and N, which will then get switched on when the controller triggers (lights, siren, etc).

This setup uses your controller as an external trigger to change the state of the Mini R4, which you can then use to trigger a scene in the Ewelink app, Node Red, Home Assistant.

---

<div class="post-metadata">

**Author:** ![devishian](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@devishian](https://forum.ewelink.cc/u/devishian)\
**Post date:** [March 31, 2024, 9:22am UTC](https://forum.ewelink.cc/t/connect-sonoff-mini-r4-to-an-alarm-output/30103/5 "2024-03-31T09:22:13Z")

</div>

Something like this? Is it correct to connect S2? As far as I understand it is the return line that is monitored by R4…

 ![IMG_20240331_112032~2](https://europe1.discourse-cdn.com/flex005/uploads/ewelinkforum/original/2X/e/e50f913dc038aa94044dae67d3076b28c72292bb.jpeg)

---

<div class="post-metadata">

**Author:** ![andy.wolf](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@andy.wolf](https://forum.ewelink.cc/u/andy.wolf)\
**Post date:** [March 31, 2024, 10:05am UTC](https://forum.ewelink.cc/t/connect-sonoff-mini-r4-to-an-alarm-output/30103/6 "2024-03-31T10:05:00Z")

</div>

> [@devishian](#):
>
> Is it correct to connect S2?

If I am not mistaken, S1/S2 simply detects if the circuit is open or closed.

Does your controller only have a single ‘L Out’ for the alarm? Or also a ‘N’ to go with it?

If yes, then you should connect both ‘L Out’ and ‘N’ to S1/S2 respectively (I don’t think it matters which one you connect to which).

---

<div class="post-metadata">

**Author:** ![devishian](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@devishian](https://forum.ewelink.cc/u/devishian)\
**Post date:** [March 31, 2024, 10:12am UTC](https://forum.ewelink.cc/t/connect-sonoff-mini-r4-to-an-alarm-output/30103/7 "2024-03-31T10:12:40Z")

</div>

It has only L(out) for the alarm. The controller’s scheme tells to connect the other pole of the siren to the general N wire. Since R4’s S1 is short-circuited to L(in) I think that S2 should act as N as in the scheme:

 ![sonoff-mini-r4-extreme-schema-di-collegamento-con-interruttore.png](https://europe1.discourse-cdn.com/flex005/uploads/ewelinkforum/original/2X/7/700273ef5c65526081e0d6055165dec63cff9848.jpeg)

---

<div class="post-metadata">

**Author:** ![andy.wolf](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@andy.wolf](https://forum.ewelink.cc/u/andy.wolf)\
**Post date:** [March 31, 2024, 10:31am UTC](https://forum.ewelink.cc/t/connect-sonoff-mini-r4-to-an-alarm-output/30103/8 "2024-03-31T10:31:12Z")

</div>

Yes, then I would try the common N also connected to your controller.

I don’t think it matters which one you connect to S1 or S2 as it only checks whether the circuit is open or closed.

---

<div class="post-metadata">

**Author:** ![devishian](https://avatars.discourse-cdn.com/v4/letter/d/ec9cab/32.png) [@devishian](https://forum.ewelink.cc/u/devishian)\
**Post date:** [April 3, 2024, 7:11am UTC](https://forum.ewelink.cc/t/connect-sonoff-mini-r4-to-an-alarm-output/30103/9 "2024-04-03T07:11:08Z")

</div>

Just for the ones that will read this thread in the future for their own use… The S1 contact is nothing other than the replica of the L(in) phase with which it is bridged. In my opinion this can generate a bit of confusion in the wiring because it almost seems like a switch input as S2 actually is. It would have been more correct, in my opinion, to simply call him L. Therefore the terminal that accepts an input switch or button is terminal S2.
