I'm having trouble with getting 2 outputs to work on the ardunio from the ST mobile platform. I'm not a programmer but I'm pretty certain that my code is correct. I think my trouble is in the device handler. Is it possible to have 2 outputs controlled by the same device handler? I can easily get one or the other to work but not both at the same time. I diffidently don't completely understand how the communication works between the mobile platform to the hub to the ardunio.
// Simulator metadata
simulator {
status "on": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6E"
status "off": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6666"
// reply messages
reply "raw 0x0 { 00 00 0a 0a 6f 6e }": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6E"
reply "raw 0x0 { 00 00 0a 0a 6f 66 66 }": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6666"
}
// UI tile definitions
tiles (scale: 2){
standardTile( "switch", "device.switch", width: 3, height: 3, canChangeIcon: true, canChangeBackground: true) {
state "on", label: 'On', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821"
state "off", label: 'Operate Right Door', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff"
}
standardTile( "switch2", "device.switch", width: 3, height: 3, canChangeIcon: true, canChangeBackground: true) {
state "onr", label: 'On', action: "switch.off", icon: "st.switches.switch.on", backgroundColor: "#79b821"
state "offr", label: 'Operate Left Door', action: "switch.on", icon: "st.switches.switch.off", backgroundColor: "#ffffff"
}
standardTile("contact", "device.contact", width: 3, height: 3) {
state "open", label: '${name}', icon: "st.contact.contact.open", backgroundColor: "#ffa81e"
state "closed", label: '${name}', icon: "st.contact.contact.closed", backgroundColor: "#79b821"
}
standardTile("contact", "device.contact", width: 3, height: 3) {
state "open", label: '${name}', icon: "st.contact.contact.open", backgroundColor: "#ffa81e"
state "closed", label: '${name}', icon: "st.contact.contact.closed", backgroundColor: "#79b821"
}
main "switch"
details "switch" , "switch2", "contact" , "contact2"
}