Page 1 of 1

On - Off Switch

Posted: Tuesday 30 June 2020 13:57
by paul402
I have an on/off switch which executes a python script to write a value to a file. It writes a 1 for on and a 0 for off.
There is no programming to change the state of the switch itself.
Three or so seconds after pressing "on" the switch state reverts to "off", although the script to write the value for off is not executed.
If I select "off" on the switch whilst it is "on" then the script to write the value for off is executed.
Please tell me what is happening to reset the switch! Have I selected the incorrect switch type for what I want to do?