Mqtt+on-off status of a siren

Hello everyone. I am looking for some help with a little quest.

I have an old fashioned alarm system with wireless sensors around the house connected to a central unit.
The unit is gsm and sends sms or gives phone calls to set numbers (but drains money from the sim card) and obviously triggers a buzzer/siren when it detects intrusion.

My goal is to connect a wifi device (an rfm69 module attached to what? with MQTT language) physically to the siren wires (protecting the device with an optoisolator or a relay) and detect when it goes on and off.
When the signal is triggered I would like the wifi device (rfm69+MQTT) to send the status (on or off) to my openhab or nodered or even better emoncms gateway (a raspberrypi acting as emonhub) so to receive an email or a push notify even better.

I just need some simple instructions to start with. What components to use to connect the siren wires to the rfm69 and from there how to make it send status to the raspberry pi through MQTT.

Any answer will be very appreciated.
Thanks to everyone.

Nice project!

I think an ESP8266 low cost wifi enabled chip would be the best tool for the job. A nodeMCU dev board is probably the easiest way to get going

http://nodemcu.com/index_en.html

They have examples for how to connect to Wifi, MQTT and read a digital input. Once you have the unit posting a MQTT message it will be easy set setup node RED (which is built into the latest emonPi emonSD build) to trigger notifications etc:

Wonderful. For what I understand this system goes through the WiFi network.

Wouldn’t it be easier to post directly to the emonhub like the emontx does?

Is there anything that acts like a node for emonhub?

Thanks

Yes, that’s another option. Possibly a better option if you are already familiar with Arduino IDE.

You could use the emontx V2 RF guide as an example, just strip our the energy monitoring part, set #define RF69_COMPAT 1 if your using RFM69CW and upload to and Arduino the a RFM69CW connected. An emonTx V2 would actually make a good dev platform since it’s got plenty of free I/O broken out. Alternatilvy you could use a JeeNode which is hardware identical to the emonTx V2 just without the energy monitoring parts.

https://github.com/openenergymonitor/emonTxFirmware/blob/master/emonTxV2/Guide/g_TransmittingData/g_TransmittingData.ino

On the Pi running emonHub you will need to add a corresponding node decoder entry to match the nodeID of your node:

That's better! So basically I have to:

1 -wires from siren go to what?an optocoupler to protect the board?or a 2 way relay?

2- optocoupler connected to the jeenode which sends data to emonhub

3- jeenode needs any particular firmware to gather data or the one you sent is the only software part I have to program?(I can upload firmware but I cannot write any software in any language)

3- emonhub receives data in the input tab, and emoncms is capable of sending me emails when 0 or 1 are triggered?

Sorry disturbing.

Thanks

Depends on voltage level. Optocoupler if high voltage but it may well be low voltage. You might need a voltage divider circuit to get voltage level to 3.3V max (JeeNode / emonTx are 3.3V devices).

You will need to customise the code to read from a digital input, interrupt
routine would be best
.

No, Emoncms can’t send emails,. EmonHub can post to an MQTT topic e.g. emon/alarm nodeRED can then subscribe to the MQTT topic then trigger an email. See example flow.

Amazing start!thanks

1 Like