So I have this Arduino Mega with MySensors 2.3.2.
In this code I have a built-in backdoor when a button is pressed the relay will always toggle for 5 seconds.
Now I would like to replace the Arduino Mega with a NodeMCU V3 or something familiar.
I would like to have a fully functional devices like before with the same button.
The new device must always toggle the relay! When it’s not cennected or when wifi is down or when HA is rebooting, etc.
This button is like a secret switch somewhere to open a lock. The ESPHome module is connected to a UPS so power is not an problem.
How to implement this kind of behaviour? Or is it not possible?
A button that toggles a relay isn’t what you’d commonly call a “back door” unless it opens your secret “back door” porn stash. That’s just a basic function and these basic functions are explained in the documentation with several examples that cover exactly what you want. You would have found this if you had done a simple Google search and tried.