Home assistant tasmota discovery switches

Since the MyQ debacle, I am also trying to get this to work on a couple old garage doors.
I have found several ways that I don’t understand and can’t make work anyway and I would like to understand what makes it work for future use and not just copy and paste. Thanks in advance.