Aeon micro motor controller DSC14104

Since you have more than one SmartApp that you want to control the shades, this little app below allows you to use two Momentary Button Tiles (which you can create in the IDE), one for Up and one for Down. Then you can use these virtual switches in the apps that you want to control the motor controller. All of this assumes that you don’t need to use the Stop command. I haven’t tested this, but it should work. Check it out and let me know.

Note: in each case you want to turn On the virtual switch to cause the motor to run Up or Down.

/**
 *  Virtual Shade Mapper
 *
 *  Copyright 2015 Bruce Ravenel
 *
 *  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: "Virtual Shade Mapper",
    namespace: "bravenel",
    author: "Bruce Ravenel",
    description: "Use virtual switches to control Aeon motor controller",
    category: "Convenience",
    iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
    iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
    iconX3Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png")


preferences {
	section("Select the motor controller") {
            input "motor", "capability.doorControl", title: "Which one?", required: true
	}
    
    section("Select the virtual switches") {
            input "upSwitch", "capability.switch", title: "Which switch for Up?", required: true
            input "downSwitch", "capability.switch", title: "Which switch for Down?", required: true
    }
}

def installed() {
	initialize()
}

def updated() {
	unsubscribe()
	initialize()
}

def initialize() {
    subscribe(upSwitch, "switch.on", upHandler)
    subscribe(downSwitch, "switch.on", downHandler)
}

def upHandler(evt) {
	motor.up()
}

def downHandler(evt) {
	motor.down()
}
1 Like