After slogging through the learning curve to get a working handler, I’m stuck on the UI/tile layout for my device in the iOS app.
Basically, the device is a multi-channel that supports four binary switches. The relevant part of the code is:
tiles(scale:2) {
standardTile(“switch1”, “device.switch1”,canChangeIcon: true, width: 1, height: 1) {
state “on”, label: “switch1”, action: “off1”, icon: “st.switches.switch.on”, backgroundColor: “#79b821”
state “off”, label: “switch1”, action: “on1”, icon: “st.switches.switch.off”, backgroundColor: “#ffffff”
}
standardTile(“switch2”, “device.switch2”,canChangeIcon: true, width: 1, height: 1) {
state “on”, label: “switch2”, action: “off2”, icon: “st.switches.switch.on”, backgroundColor: “#79b821”
state “off”, label: “switch2”, action: “on2”, icon: “st.switches.switch.off”, backgroundColor: “#ffffff”
}
standardTile(“switch3”, “device.switch3”,canChangeIcon: true, width: 1, height: 1) {
state “on”, label: “switch3”, action: “off3”, icon: “st.switches.switch.on”, backgroundColor: “#79b821”
state “off”, label: “switch3”, action: “on3”, icon: “st.switches.switch.off”, backgroundColor: “#ffffff”
}
standardTile(“switch4”, “device.switch4”,canChangeIcon: true, width: 1, height: 1) {
state “on”, label: “switch4”, action: “off4”, icon: “st.switches.switch.on”, backgroundColor: “#79b821”
state “off”, label: “switch4”, action: “on4”, icon: “st.switches.switch.off”, backgroundColor: “#ffffff”
}
// Set switch1 to be the one we see in the Things view
main(“switch1”)
details([“switch1”,“switch2”,“switch3”,“switch4”])
}
At the very least, this displays the four switches in the simulator (and they work… triggering the device and also properly representing the actual state of the switches):
But, when I look at it in the iOS app, I get these “broken cloud” icons (the dimmer section is left over from when I temporarily changed the handler to a dimmer-capable third-party handler so that I could see how their code differed):
Any suggestions?