Hello
I am new to Home assistant and am falling over at the first hurdle. Despite trawling forums for a solution I am clearly missing something trivial. I am at the fundamental understanding stage where I am just getting things to talk to each other before I automate
I am trying to switch an RF socket via a tasmota flashed sonoff rf bridge. RfKey1 is set to turn the socket on. RfKey2 to turn it off. Within the tasmota console this works correctly when the commands are issued.
Home assistant sees the MQTT sensor message if the doorbell is activated and the badge changes to “on”, suggesting the RF Bridge is communicating with the MQTT broker and HA receiving it
However if I operate the switch to turn on / off the socket on the HA overview then nothing happens, the switch icon changes to the “on” icon in the overview, but the rf bridge console doesn’t receive any message. I have installed the android “mqtt client” app and subscribed to all variations of cmnd/sonoff/rfkey but no message is ever received.
However if I call the mqtt.publish service in developer tools and send
{ “topic”: “cmnd/sonoff/rfkey1”, “payload”: “rfkey1”}
If I leave the payload blank, ie “”, then this works aswell
Then the rf bridge receives the message (and also my phone) and the socket operates as expected
To me it seems as though everything is talking to each other but the switch entity does not publish the mqtt command (or at least to the address I am expecting it to)
I have used mosquitto on the same PI as HA, and also installed it on a separate PI and re-referenced everything, but got the same results whereby it works when you call a service mqtt.publish, but not through clicking the “Power On” icon to “on”
I am assuming I am missing a link between the two, but cannot for the life of me work out what that is
Many thanks for taking the time to help
configuration.yaml snippet:
mqtt:
broker: 192.168.0.xx
port: 1883
username: xxxxxx
password: xxxxxxx
switch:
- platform: mqtt
name: “Power On”
command_topic: “cmnd/sonoff/rfkey1”
payload_on: “”
payload_off: “rfkey1off”
binary_sensor:
- platform: mqtt
name: “Doorbell”
payload_on: “4906099”
payload_off: “4906099off”
state_topic: “tele/sonoff/RESULT”
value_template: “{{ value_json.RfReceived.Data}}”