Shortly after submitting the RF Transmitter Problem I found the Solution
As explained in rc-switch on github issues:
You have to use setPulseLength() after calling setProcotol(). Otherwise the pulse length value gets reset to default when you set the protocol.
I have modified the code at your github and created a pull request https://github.com/RuiSantosdotme/Home-Automation-Course/pull/1
PS. Sorry about the second thread for this one. I learned the hard way, don’t mark an issue closed when you are creating a reply. If you do it will wipe out your reply and prevent you from ever replying to the topic.
No problem! Thanks for letting me know and for the pull request.
I’ve accepted the pull request and I’ve updated all the other examples: https://github.com/RuiSantosdotme/Home-Automation-Course/tree/master/code/v2
Since all my RF remote controlled sockets use the protocol 1, even though I was setting it in the wrong order I’ve never experienced that error.