Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- preferences {
- }
- metadata {
- definition (name: "Honeywell Alarm", namespace: "nimo", author: "Steven Tomlinson") {
- capability "Switch"
- capability "Refresh"
- capability "Polling"
- attribute "program1", "enum", ["on", "off"]
- attribute "program2", "enum", ["on", "off"]
- command "on1"
- command "off1"
- command "on2"
- command "off2"
- }
- simulator {
- // TODO: define status and reply messages here
- }
- tiles (scale: 2) {
- standardTile("program1", "device.program1",canChangeIcon: false, width: 2, height: 2) {
- state "on", label: '${currentValue}', action: "off1", icon: "st.switches.switch.on", backgroundColor: "#00a0dc", nextState:"off"
- state "off", label: '${currentValue}', action: "on1", icon: "st.switches.switch.off", backgroundColor: "#ffffff", nextState:"on"
- }
- standardTile("program2", "device.program2",canChangeIcon: false, width: 2, height: 2) {
- state "on", label: '${currentValue}', action: "off2", icon: "st.switches.switch.on", backgroundColor: "#00a0dc", nextState:"off"
- state "off", label: '${currentValue}', action: "on2", icon: "st.switches.switch.off", backgroundColor: "#ffffff", nextState:"on"
- }
- standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
- state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
- }
- main(["program1"])
- details([
- "program1",
- "program2",
- "refresh"
- ])
- }
- }
- // parse events into attributes
- def parse(String description) {
- log.debug "Parsing '${description}'"
- }
- def on() {
- log.debug "All On"
- }
- def off() {
- log.debug "All Off"
- }
- def on1() {
- log.debug "Executing 'on1'"
- sendEvent(name: "program1", value: "on", isStateChange: true, display: false)
- }
- def off1() {
- log.debug "Executing 'off1'"
- sendEvent(name: "program1", value: "off", isStateChange: true, display: false)
- }
- def on2() {
- log.debug "Executing 'on2'"
- sendEvent(name: "program2", value: "on", isStateChange: true, display: false)
- }
- def off2() {
- log.debug "Executing 'off2'"
- sendEvent(name: "program2", value: "off", isStateChange: true, display: false)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement