I am just starting with HA.
I have set up some rf switches with the sonoff rf bridge flashed with tasmota. I can receive the codes via mqtt in node red.
What is the correct way to integrate with HA? I looked at the binary sensor switch but it works like a toggle switch and my switches are momentary.
You mentioned you have rf switches but are these with same code for switching on and off?In normal condition you can create a template switch like this
switch:
- platform: template
switches:
remote_1:
turn_on:
service: mqtt.publish
data:
topic: cmnd/tasmotaRF1/RFsend
payload: '{"Data":"0x846008","Bits":24,"Protocol":1,"Pulse":192}'
turn_off:
service: mqtt.publish
data:
topic: cmnd/tasmotaRF1/RFsend
payload: '{"Data":"0x846008","Bits":24,"Protocol":1,"Pulse":192}'
Just replace the mqtt topic with your topic and the payload also
Thanks for your help. here is the code that i ended up with.
I would prefer if the off_delay
was shorter than 1 second
binary_sensor:
# 2 gang RF wall switch 1
- platform: mqtt
name: "Wall Switch (RF) 1.Right"
state_topic: "tele/RF/RESULT"
value_template: '{{value_json.RfReceived.Data}}'
payload_on: "83C002"
off_delay: 1
qos: 1
- platform: mqtt
name: "Wall Switch (RF) 1.Left"
state_topic: "tele/RF/RESULT"
value_template: '{{value_json.RfReceived.Data}}'
payload_on: "83C008"
off_delay: 1
qos: 1