Hi, I am new to Home Assistant and am trying to setup multiple 433 devices with the Sonoff Bridge.
I have a KERUI Door/Window sensor (which sends 2 different codes for open and close), and a KERUI Motion Sensor(which sends only 1 code). I have the below current setup, which I know is not correct.
binary_sensor:
- platform: template
sensors:
motion_sensor1:
friendly_name: "Motion Sensor 1"
value_template: '{{ is_state("sensor.sonoff_bridge_443", "FD859A") }}'
delay_off: '00:00:06'
device_class: motion
door_sensor_open:
friendly_name: "Door Sensor 1"
value_template: '{{ is_state("sensor.sonoff_bridge_443", "7F13EE") }}'
device_class: door
sensor:
- platform: mqtt
state_topic: 'tele/RF_Bridge/RESULT'
value_template: '{{value_json.RfReceived.Data}}'
name: "sonoff bridge 443"
expire_after: 1
Although the above sort of works, the ‘expire_after: 1’ correctly resets the motion sensor, but also resets the door/window sensor. I also what to add in the Sensor close code.
Could someone show me a working example please?
Kind regards.
elRadix
(elRadix)
January 20, 2019, 7:03pm
2
This is my binary sensor for my RF door sensor which has 2 codes: 0E = ON (or CLOSED), 0A = OFF (or OPEN)
No need for a template sensor.
- platform: mqtt
state_topic: "tele/rfbridge/RESULT"
name: 'Main Door'
value_template: '{{value_json.RfReceived.Data}}'
payload_on: '0DF00A'
payload_off: '0DF00E'
device_class: door
optimistic: false
qos: 1
retain: false
Perfect, thanks elRadix, that worked a treat. I left my motion detector with template sensor and changed the door/window sensor to you above suggestion:
binary_sensor:
- platform: mqtt
state_topic: "tele/RF_Bridge/RESULT"
name: 'Main Door'
value_template: '{{value_json.RfReceived.Data}}'
payload_on: '7F13EE'
payload_off: '7F13E7'
device_class: door
optimistic: false
qos: 1
retain: false
- platform: template
sensors:
motion_sensor1:
friendly_name: "Motion Sensor 1"
value_template: '{{ is_state("sensor.sonoff_bridge_443", "FD859A") }}'
delay_off: '00:00:06'
device_class: motion
sensor:
- platform: mqtt
state_topic: 'tele/RF_Bridge/RESULT'
value_template: '{{value_json.RfReceived.Data}}'
name: "sonoff bridge 443"
expire_after: 1
Working well, thanks.
elRadix
(elRadix)
January 20, 2019, 8:52pm
4
you’re welcome.
You can also check this topic, useful tips over there.
This solution is much cleaner than spoofing mqtt messages:
- platform: mqtt
name: "Lounge Window"
payload_on: "5D4533"
device_class: window
state_topic: "rf_bridge/tele/RESULT"
value_template: "{{ value_json.RfReceived.Data }}"
off_delay: 180
rather than what most people propose in this thread:
- platform: mqtt
name: "Lounge Window"
payload_on: "5D4533"
payload_off: "5D4533off"
device_class: window
state_topic: "rf_bridge/tele/RESULT"
value_tem…