Ok I’m using a Arduino board to create a device. The device has multiple motions and switches off it.
tiles {
standardTile("switch", "device.switch", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) {
state "on", label: '${name}', action: "switch.off", icon: "st.presence.house.secured", backgroundColor: "#79b821"
state "off", label: '${name}', action: "switch.on", icon: "st.presence.house.unlocked", backgroundColor: "#ffffff"
}
standardTile("Front.Door", "device.contact", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) {
state "open", label: 'Front Door', icon: "st.contact.contact.open", backgroundColor: "#ffa81e"
state "closed", label: 'Front Door', icon: "st.contact.contact.closed", backgroundColor: "#79b821"
}
standardTile("Garage.Door", "device.contact", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) {
state "open", label: 'Garage Door', icon: "st.contact.contact.open", backgroundColor: "#ffa81e"
state "closed", label: 'Garage Door', icon: "st.contact.contact.closed", backgroundColor: "#79b821"
}
standardTile("Back.Door", "device.contact", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) {
state "open", label: 'Back Door', icon: "st.contact.contact.open", backgroundColor: "#ffa81e"
state "closed", label: 'Back Door', icon: "st.contact.contact.closed", backgroundColor: "#79b821"
}
standardTile("Living.Motion", "device.motion", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) {
state "active", label: 'Living Motion', icon: "st.motion.motion.active", backgroundColor: "#ffa81e"
state "inactive", label: 'Living Motion', icon: "st.motion.motion.inactive", backgroundColor: "#79b821"
}
standardTile("Kitchen.Motion", "device.motion", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) {
state "active", label: 'Kitchen Motion', icon: "st.motion.motion.active", backgroundColor: "#ffa81e"
state "inactive", label: 'Kitchen Motion', icon: "st.motion.motion.inactive", backgroundColor: "#79b821"
}
standardTile("Hall.Motion", "device.motion", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) {
state "active", label: 'Hall Motion', icon: "st.motion.motion.active", backgroundColor: "#ffa81e"
state "inactive", label: 'Hall Motion', icon: "st.motion.motion.inactive", backgroundColor: "#79b821"
}
standardTile("Computer.Motion", "device.motion", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) {
state "active", label: 'Computer Motion', icon: "st.motion.motion.active", backgroundColor: "#ffa81e"
state "inactive", label: 'Computer Motion', icon: "st.motion.motion.inactive", backgroundColor: "#79b821"
}
standardTile("alarm", "device.alarm", width: 1, height: 1, canChangeIcon: true, canChangeBackground: true) {
state "off", label:'off', action:'alarm.both', icon:"st.alarm.alarm.alarm", backgroundColor:"#ffffff"
state "strobe", label:'strobe!', action:'clear', icon:"st.alarm.alarm.alarm", backgroundColor:"#e86d13"
state "siren", label:'siren!', action:'clear', icon:"st.alarm.alarm.alarm", backgroundColor:"#e86d13"
state "both", label:'alarm!', action:'clear', icon:"st.alarm.alarm.alarm", backgroundColor:"#e86d13"
}
main(["switch","Front.Door","Garage.Door","Back.Door","Living.Motion","Kitchen.Motion","Hall.Motion","Computer.Motion","alarm"])
details(["switch","Front.Door","Garage.Door","Back.Door","Living.Motion","Kitchen.Motion","Hall.Motion","Computer.Motion","alarm"])
}
They all show up under the device find and change state when triggered.
The problem I run into is that when I try to create a app to use one of these motions:
preferences {
section("When there's movement...") {
input "motion1", "capability.motionSensor", title: "Where?", multiple: true
}
Is that the only motion sensor that shows up is the main device and not all the motions that are under the single device.
How do you deal with multiple motion/switches or any multiple items under a device and trigger off those and not the main device?