I want to use an RF switch (intercepted by my Sonoff RF Bridge) to toggle a light switch. The RF switch is a simple push button. It does not send “payload_off” data. I push the switch, I get “442122”. I release it and I get nothing. Upon restarting HA or reloading Manually Configured MQTT Entries, I am able to use the automation once. I push the switch and the light comes on. However, subsequent pushes don’t do anything. I’m guessing there’s something wrong with the payload_on and off logic but I can’t seem to make it out.
I managed to fix it by having my Action send a subsequent (at the end) payload for the OFF condition, thereby duping HA into thinking the RF switch has sent it, but I’m not happy about it. Seems like a lot of work for a small thing. I also had to include a small delay to get it working reliably.
Looks like I also use the “_off” like you did. I am not a pro by any means. I recall struggling while trying to do this and searching the forums for what I needed to get it to work at that time.
I have since added a few more RF buttons and they all follow this format.
I see my device_class is motion, which is how I set it up as a newbie a few years ago…
Configuration:
- platform: mqtt
name: "RF_Button_2" #WHITE ROUND PUSH BUTTON
state_topic: "tele/tasmota_rfbridge/RESULT"
value_template: '{{value_json.RfReceived.Data}}'
payload_on: "489521"
payload_off: "489521_off"
device_class: motion
off_delay: 1
qos: 1
#payload_on: "489521" # this is what it is when RF_bridge is not in RAW```