I have got my Kerui siren working now with HA, NodeRed and Sonoff RF using my Virtual Machine (no RPi) install. Let me show you my setup
To sound and disarm the siren via HA via Sonoff RF you need to bind something with buttons which will transmit the Trigger and Stop codes to the siren which you can then see via the Sonoff RF Tasmosta console. You can only bind 1 transmitting device to the siren the cheapest way is to buy a Kerui 4 button keyfob (see @lolouk44 notes above Feb 12th 2019) .
However if you want practical (family friendly) I recommend the Kerui K16 wall mount keypad with RFiD keytags. This will fire RF codes to the siren once you binded it to the siren that you can capture and then use in NodeRed. It has RFiD tags so when you walk in the door you can turn off your HA alarm at the swipe of a tag (it fires RF code when disarmed which you can capture with Sonoff RF and flow into NodeRed through the MQTT input).
Once you get your hands on the keyfob or K16 you need to bind it the Siren (search youtube).
Then you need to flash your Sonoff RF with tasmota see drzzz youtube video.
Once flashed you can now start reading 433Mhz RF codes. Hopefully you have already got to the point where using your 4 button keypad or K16 you can sound the siren and disarm it too. Coz if you passed that step in the Sonoff RF Tasmota console you need to press those buttons and make a note of the codes which are you going to use in NodeRed in a minute or two.
Now before we can go to NodeRed you need to get your Sonoff RF seen in HA as an entity to they can communicate with each other.
In HA Configurator > Configuation.yaml or whatever yaml file you want to add the mqtt settings for it are I put it in my switch.yaml file for now (maybe I might move it my alarm folder later. Either way enter this:
- platform: mqtt
name: "Outdoor Siren"
command_topic: cmnd/RF_Bridge/RFCODE
availability_topic: "tele/RF_Bridge/LWT"
payload_available: "Online"
payload_not_available: "Offline"
payload_on: "#0414025"
payload_off: "#0414026"
optimistic: true
I don’t think the payload_on, payload_off are really relevant as I copy and pasted the code from someone else and didn’t even update their RF codes to my own and it hasn’t made a difference. It’s mainly the first 4 lines that will make or break your connection. Restart HASS …HA crashed on restart, reinstall from backup i recommend hass.io google drive backup will save your but from time to time
Now if you look in the Developer Tools > States you should be able to see the Outdoor Siren has been added and you are ready to head into NodeRed.
I have a seperate Flow for my Alarm and the foundation of it I used from James Mcarthy’s
Using some code from this thread/post I added in an MQTT out and a CHANGE to my Flow. The CHANGE receives whatever payload is coming in and lets you change the output (usually on or off) to your own payload (the RF code) which you can then pass over to the MQTT output to fire through the MQTT broker, into Sonoff RF which fires the code into the Air for the Kerui Siren to read and act upon.
The CHANGE received an ON message from the TRIGGER and sends the RF code that I captured from the Kerui Keypad for sounding the alarm to the MQTT output.
MQTT output (to MQTT broker this sets the topic and the RF code payload comes from the CHANGE).