I was looking at using the RF Bridge with inexpensive hardware switches - I had a number of RF devices around the house - old wireless plugs and controllers, doorbell switches etc., but after ordering a Sonoff RF Bridge found that this would either not recognise the RF packets or the sender was using a rolling code that would make it difficult to integrate into logic within HA.
I took the plunge and bought a dirt cheap RF based remote plug system from my local superstore (Asda in Nottingham UK) and to my delight, this has a sender that has easy to use transmission packets with no rolling code to complicate matters. The sender has 10 buttons that can be assigned to ten different functions within HA - perfect!
The plug package from Asda is a âMasterplug remote control socket - 2 pack - SWITCHED POWERâ
To get everything working, I flashed my RF Bridge with Tasmota, giving me mqtt messages in the form of:
tele/rf-bridge/STATE
and the payload looks like the following json:
{âRfReceivedâ:{âSyncâ:10350,âLowâ:320,âHighâ:830,âDataâ:âF6250Bâ,âRfKeyâ:âNoneâ}}
I followed advice from DrZZs in order to get the Data component of this json (it is the Data item that is different for each button) and bingo.
To create this setup, I needed to first set up the messages as an MQTT Binary Sensor:
binary_sensor:
- platform: mqtt
hidden: true
name: "RF Plug"
state_topic: "tele/rf-bridge/RESULT"
value_template: '{{value_json.RfReceived.Data}}'
payload_on: 'F6250F'
payload_off: 'F6250E'
optimistic: false
qos: 1
retain: true
and then to process this, create automations to perform whatever I require - in the following case I wanted to control another Tasmota Sonoff device:
- id: rf_plug_on
alias: RF Plug On
initial_state: 'on'
trigger:
platform: state
entity_id: binary_sensor.rf_plug
to: 'on'
action:
service: switch.turn_on
data:
entity_id: switch.plug
- id: rf_plug_off
alias: RF Plug Off
initial_state: 'on'
trigger:
platform: state
entity_id: binary_sensor.rf_plug
to: 'off'
action:
service: switch.turn_off
data:
entity_id: switch.plug
I will freely admit that my code could probably be improved upon, however I am just delightedto now have 10 individually operating buttons,working at 100x the speed of my Dash buttons (via Dashio) and at around a 10th of the cost!
I