I Want Physical Switch Action to do nothing


#1

1) Give a description of the problem
When a switch is physically turned off, I don’t want anything at all to happen.

2) What is the expected behaviour?
When the switch is physically turned off, I don’t want the lights to toggle.

3) What is happening/not happening?
If the switch is pressed off, it still toggles.

4) Post a Green Snapshot of the pistonimage
(UPLOAD YOUR IMAGE HERE)

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

You did not post your piston’s green snapshot… but here is what happens with webCoRE.

If you subscribe to a device’s attributes, (let’s say "DeviceA’s switch), then each time that switch changes at all (in either direction) the piston will run thru the code, top to bottom, and execute anything not blocked by conditions.

For example:

IF DeviceA's switch changes to on
Then
    Do cool stuff
END IF
Toggle Light

Basically:

  • When switch changes to on, it does cool stuff and toggles the light
  • When switch changes to off, it only toggles the light
    (since there’s no conditional block around that command)

Keeping all code in the proper block can help with your issue.
(Drag and Drop is your friend :grin:)


#3

In addition to what @WCmore said above, as long as you have your light directly connected to the switch, you cannot stop it from toggling. When you turn the switch off, it goes off. Then WebCoRE sees it go off and can react to turn it back on. Until the switch changes, webcore won’t do anything because webcore is event driven. Someone may correct me but I believe the only way to “stop the switch from going off” is if you have both a switch and a relay and the switch is only connected to webcore which controls the relay.