-
Notifications
You must be signed in to change notification settings - Fork 414
RF Bridge
The PIR sensor sends a signal if it detects motion. The door / window sensor sends a signal when open. You can set the time after which the sensor goes into off state. Default 120 seconds.
If you has door sensor with two states (for open and for closed state) like this one, you can config payload_off
as in the example below. Also disable the timeout if you do not need it in this case (with timeout: 0
option).
You can use any device_class
that is supported in Binary Sensor.
PIR Sensor
sonoff:
rfbridge:
PIR Sensor 1: # sensor name in eWeLink application
device_class: motion
timeout: 60 # optional (default 120), timeout in seconds for auto turn off
Single State Sensor
sonoff:
rfbridge:
Door Sensor 1: # sensor name in eWeLink application
name: Door Sensor # optional, you can change sensor name
device_class: door # e.g. door, window
timeout: 5
Dual State Sensor
sonoff:
rfbridge:
Sensor1: # sensor name in eWeLink application (open signal)
name: Window Sensor # optional, you can change sensor name
device_class: window # e.g. door, window
timeout: 0 # disable auto close timeout
payload_off: Sensor2 # sensor name in eWeLink application (close signal)
Component will create Remote entity per RF Bridge - remote.sonoff_1000xxxxxx
.
You can receive signals from RF Buttons and RF Sensors through an event sonoff.remote
. And send signals using the service remote.send_command
.
Although the component supports training, it is recommended to train RF Buttons through the eWeLink application.
When a command is received, the event sonoff.remote
is generated with a button number and response time (in UTC, sends the device).
Example for receive all RF signal
automation:
- alias: Sonoff RF Receive
trigger:
platform: event
event_type: sonoff.remote # this is NOT entity_id, don't change it!
action:
service: persistent_notification.create
data_template:
title: Sonoff RF Receive
message: |-
Name: {{ trigger.event.data.name }}
Command: {{ trigger.event.data.command }}
Time: {{ trigger.event.data.ts }}
Example of reaction to the selected button
Instead of a name: Button1
, you can use command: 0
number of the button in the eWeLink application (starts from zero).
automation:
- alias: Receive Button1
trigger:
platform: event
event_type: sonoff.remote # this is NOT entity_id, don't change it!
event_data:
name: Button1 # button/sensor name in eWeLink application
action:
service: persistent_notification.create
data:
message: My Remote button pressed
Example for send RF signal
script:
send_button1:
alias: Send RF Button1
sequence:
- service: remote.send_command
data:
entity_id: remote.sonoff_1000abcdef
command: Button1 # button name in eWeLink application