Switch to switch feedback

how to configure blynk app switch to act if switch1 is on then it should be turned off to turn on switch2 & vice versa. (if switch1 is on then switch2 should be inactive unless switch1 is turned off)

BLYNK_WRITE(V1)
{
  if(param.asInt())
  {
   Blynk.virtualWrite(V2,0);
  }
}

BLYNK_WRITE(V2)
{
  if(param.asInt())
  {
   Blynk.virtualWrite(V1,0);
  }
}

Pete.

Thanks Pete,
But this code workes like if sw1 is on then sw2 is off only
required if sw1 is on then sw2 cannot operate untill sw1 is off, is that possible…

I think you need to properly specify your requirements.

Pete.

Hi Pete, from a water tank there are 3 solenoid valve connected to 3 houses, if house1 solenoid is on then other two house’s solenoid shouldn’t be able to control till house1 solenoid is turned.

Thanks for your quick response…

Doesn’t tell me anything about the widgets you’re going to be using, what datastreams they are connected to, how you’ll be handling security to prevent someone turning off the current house and turning on theirs etc.

Pete.

Hi Pete,

assume house1, 2 & 3 are blynk app users and solenoid are sw1, sw2 & sw3 respectively connected to V1, V2 & V3