It will require two Smart Lighting automations. One to tie the virtual switch to the physical:
Which lights do you want to control? Living Room Light
What do you want to do? Turn On
Select trigger: Switch
Which switch? Virtual Switch
Turn on lights when Turned On
Turn off as well (probably)
And one to trigger the virtual switch based on your existing criteria (i.e., just change your existing rule to turn on the virtual switch instead of the GE switch). The virtual switch’s only function will be to toggle the state of the physical switch. Anything done on the physical side will override and act independently. Alternatively, you could use the purpose-built smartapp below to replace the extra Smart Lighting automation:
[code]definition(
name: “A Proxy Switch”, namespace: “HDFLucky”, author: “Bruce Ravenel”,
description: “Links a virtual switch to a real one, so that if physical switch is already on, will only be turned off manually.”,
category: “My Apps”,
iconUrl: “http://cdn.device-icons.smartthings.com/Lighting/light13-icn.png”,
iconX2Url: “http://cdn.device-icons.smartthings.com/Lighting/light13-icn@2x.png”,
iconX3Url: “http://cdn.device-icons.smartthings.com/Lighting/light13-icn@2x.png”)
preferences {
section(“Physical Switch”) {
input “physical”, “capability.switch”,
title: "Real switch… ",
required: true
}
section(“Virtual Switch”) {
input “virtual”, “capability.switch”,
title: "Proxy switch… ",
required: true
}
}
def installed() {
subscribe(virtual, “switch.on”, switchOnHandler)
subscribe(virtual, “switch.off”, switchOffHandler)
}
def updated() {
unsubscribe()
subscribe(virtual, “switch.on”, switchOnHandler)
subscribe(virtual, “switch.off”, switchOffHandler)
}
def switchOnHandler(evt) {
state.wasOff = physical.currentValue(“switch”) == "off"
if(state.wasOff)physical.on()
}
def switchOffHandler(evt) {
if(state.wasOff)physical.off()
}
[/code]
This is my modification of a smartapp written by @bravenel. I would have linked to the original, but can’t find it. To add either the virtual device or smartapp, you’ll need IDE access. There are several instructions/tutorials online here in the community. Post up if you have any questions.