I added a few 433 Mhz alarms around the house and in front porch connected to the HA Alarm Panel. The Tasmotized Sonoff RF Bridge will send a signal to set them off and disarm. And the Automation is done using MQTT Publish.
Here are the components I used.
Sonoff RF Bridge (Running Tasmota)
Digoo DG-ROSA 433MHz siren (It has a built-in backup battery!)
This particular Siren, when placed in code learning mode, gets triggered by RfKey4/8/12/16 of the RF Bridge and the RfKey2/6/10/12 will turn the alarm off. You do not need any payload because the topic sends the code to set siren on or off.
Below is my alarm and binary_sensor entry in configuration.yaml
alarm_control_panel:
- platform: manual
name: Home Alarm
code: !secret alarm_code
trigger_time: 600
disarmed:
trigger_time: 0
armed_home:
delay_time: 0
pending_time: 0
armed_away:
delay_time: 60
pending_time: 30
triggered:
pending_time: 0
binary_sensor:
- platform: mqtt
name: "Front Door"
state_topic: "tele/RFBridge_Home/RESULT" #"RFBridge_Home" part will be different for your setup
value_template: '{{value_json.RfReceived.Data}}'
payload_on: '33810A' #Find this codes using RF Bridge Console
payload_off: '33810E' #Find this codes using RF Bridge Console
device_class: door
qos: 1
Here is my automations.yaml
##################################
# Alarm System
##################################
- alias: Trigger alarm while armed
initial_state: 'on'
hide_entity: true
trigger:
- platform: state
entity_id: binary_sensor.front_door
to: 'on'
condition:
condition: or
conditions:
- condition: state
entity_id: alarm_control_panel.home_alarm
state: armed_away
- condition: state
entity_id: alarm_control_panel.home_alarm
state: armed_home
action:
service: alarm_control_panel.alarm_trigger
entity_id: alarm_control_panel.home_alarm
- alias: Sound Siren when alarm triggered
initial_state: 'on'
hide_entity: true
trigger:
- platform: state
entity_id: alarm_control_panel.home_alarm
to: triggered
action:
- service: mqtt.publish
data:
topic: cmnd/RFBridge_Home/RfKey4
payload: ""
- alias: Turn off Siren after triggered alarm disarmed
initial_state: 'on'
hide_entity: true
trigger:
- platform: state
entity_id: alarm_control_panel.home_alarm
to: disarmed
action:
- service: mqtt.publish
data:
topic: cmnd/RFBridge_Home/RfKey2
payload: ""
Topics never send anything. Payloads are published to topics. Even if a payload consists of an empty string (NULL value) it can still be published to a topic.
In addition, your code is literally contradicting the statement “You do not need any payload”
If you have any other RF sensors that will report their state, the configuration for the binary_sensor will also receive their payloads and cause Home Assistant to produce warning messages (“No matching payload for entity …”).
The reason is because the binary_sensor’s configuration only looks for two matches: 33810A and 33810E. If it receives any other payload, it can’t match it to anything and you’ll get a warning message.
Here’s how to prevent it. In this version, the value_template always report a valid state even if it has no match for the received payload.
@chils41 - I assume this worked because you learnt the arm/disarm and sos commands from the digoo remote?
If so can you do me a favour and send the codes to me? Tasmota will display them using the RFkey 5 command, so for yours RFkey4 5, RFkey6 5 and whatever the SOS button is assigned to as well.
For anyone that ends up at this topic, and like me bought the siren but not the remote, the RF codes to usefully implement this thing are as follows.
On Tasmota console execute the following commands:
RfSync 13100
RfHigh 1250
RfLow 420
Put the siren in programming mode for a remote (long press and release after single beep).
RfCode #xxxx88
Where xxxx is any 4 digit hex string.
This is the SOS code. The siren will now recognise xxxx84 as “Arm Home”, xxxx81 as “Arm Away” and xxxx82 as “Disarm”
An easy exercise for the reader would be to have an automation that would trigger the alarm with the SOS code and silence it with the Disarm code. The automation can be triggered by anything you like in HA of course.
Just wondered if anyone has managed to get the volume lower when arming and disarming, as a siren it’s fine, but @ rfontijn has stated it is a tad loud just for setting home and away arming and disarming, it would be good if it could be done / lowered
I assume you are running Tasmota on your bridge? At the main menu of the web interface, there is a console option. Choose that, the console will be displayed and you can enter commands in the box at the bottom.
Thanks @zoogara
Yes, that is correct and I know the console, but I used it only to read the data for the mqtt-payload.
I’ve seen the box to enter commands, but how is the syntax in this case to execute the commands as you described in the post of Jul20?
I followed the manual which was sent with the siren to do the paring process.
Afterwards I serached on youtube for pairing examples, these I found are different, but they worked!
It seems that in the manual it’s the wrong process described or I have missunderstood it