Hi everyone!
I’ve been using Sonoff switches flashed with Tasmota firmware connected by MQTT to my Home Assistant.
I like to program the physical switches apart from the relays. The manual activation of the switches sends an MQTT message and HA without actually toggling the electronic relay. I did this by setting the switchmode to 15 on the Tasmota web console, and then creating a binary_sensor in the MQTT YAML file.
Now I got a Sonoff Switchman M5-2C and I want to do something similar, but this device has buttons and not switches. I already set tue buttontopics in the console, so I get a cmnd/TAS-M5-01-B1/POWER1 message when I push the physical button.
I’m not having success creating a virtual button in the MQTT YAML file. I tried something similar to what I had before, but instead of creating a binary_sensor I created a button:
button:
- name: "TAS-M5-01-Living-B2"
command_topic: "cmnd/TAS-M5-01-B3/POWER1"
payload_press: "cmnd/TAS-M5-01-B2/POWER1"
I only added the command_topic line because without it the reload shows an error. I don’t know what’s the actual line I need to use for the “virtual button” to react to an MQTT message. I tried copying the same logic I have in the binary_sensor used for the switches but clearly the button works differently.
Any help or recommendations are appreciated!!
Thanks,
Rodrigo