I pressed button, NodeMCU publish "1" to my selected topic. I pressed button again - publish "0". Also I will be controlling Sonoff remotely, so I need that NodeMCU would know what status is Sonoff in at the moment.
Is there any tutorials of maybe someone can help me with this?