You need to write a SmartApp that tracks the status of the Roller Shutter and updates the Virtual Switch accordingly!
It’s something that should have been built into the platform, but, alas, it isn’t there. I don’t know what CoRE can or cannot do in this regard.
I just handle this problem with my custom SmartApp(s): Almost the exact same situation: A Projector Screen that has up/down/stop. But I didn’t bother with a Virtual Switch for Stop.
You may find the code below helpful… or not. Dunno.
/**
* Copyright 2015 Terry Gauchat
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
* for the specific language governing permissions and limitations under the License.
*/
definition(
name: "Screen Down Up Virtual Switch App",
namespace: "CosmicPuppy",
author: "Terry Gauchat",
description: "Turns on (down) and off (up) movie screen linking it to Virtual Switch and ThingShield Projector Device",
category: "My Apps",
iconUrl: "http://thumb1.shutterstock.com/display_pic_with_logo/1943207/159822338/stock-vector--projector-screen-159822338.jpg",
iconX2Url: "http://thumb1.shutterstock.com/display_pic_with_logo/1943207/159822338/stock-vector--projector-screen-159822338.jpg",
iconX3Url: "http://thumb1.shutterstock.com/display_pic_with_logo/1943207/159822338/stock-vector--projector-screen-159822338.jpg"
)
preferences {
section("When this Virtual Screen Switch is turned on / off :") {
input "virtualSwitch", "device.projectorVirtualScreen", title: "VirtualSwitch", multiple: false, required: true
}
section("Turn on (down) / off (up) Projector Screen:") {
input "projector", "device.projectorScreenShield", multiple: false, required: true
}
}
def installed()
{
subscribeToCommand(virtualSwitch, "switch.on", onHandler)
subscribeToCommand(virtualSwitch, "switch.off", offHandler)
subscribe(projector, "screen.on", screenPhysicalOnHandler)
subscribe(projector, "screen.off", screenPhysicalOffHandler)
}
def updated()
{
unsubscribe()
subscribeToCommand(virtualSwitch, "on", onHandler)
subscribeToCommand(virtualSwitch, "off", offHandler)
subscribe(projector, "screen.on", screenPhysicalOnHandler)
subscribe(projector, "screen.off", screenPhysicalOffHandler)
}
def logHandler(evt) {
log.debug evt.value
}
def onHandler(evt) {
log.debug "Handler caught On request from virtualSwitch."
projector.screenOn()
}
def offHandler(evt) {
log.debug "Handler caught On request from virtualSwitch."
projector.screenOff()
}
def screenPhysicalOnHandler(evt) {
log.debug "Handler Caught screen Physical On. Should not move screen."
virtualSwitch.onPhysical()
}
def screenPhysicalOffHandler(evt) {
log.debug "Handler Caught screen Physical Off. Should not move screen."
virtualSwitch.offPhysical()
}
/* =========== */
/* End of File */
/* =========== */