Advertisement
Guest User

Untitled

a guest
Jul 13th, 2018
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1.  
  2.  
  3. preferences {
  4.  
  5. }
  6.  
  7. metadata {
  8. definition (name: "Honeywell Alarm", namespace: "nimo", author: "Steven Tomlinson") {
  9.  
  10. capability "Switch"
  11.  
  12. capability "Refresh"
  13. capability "Polling"
  14.  
  15. attribute "program1", "enum", ["on", "off"]
  16. attribute "program2", "enum", ["on", "off"]
  17.  
  18. command "on1"
  19. command "off1"
  20. command "on2"
  21. command "off2"
  22.  
  23. }
  24.  
  25.  
  26. simulator {
  27. // TODO: define status and reply messages here
  28. }
  29.  
  30. tiles (scale: 2) {
  31.  
  32. standardTile("program1", "device.program1",canChangeIcon: false, width: 2, height: 2) {
  33. state "on", label: '${currentValue}', action: "off1", icon: "st.switches.switch.on", backgroundColor: "#00a0dc", nextState:"off"
  34. state "off", label: '${currentValue}', action: "on1", icon: "st.switches.switch.off", backgroundColor: "#ffffff", nextState:"on"
  35. }
  36.  
  37. standardTile("program2", "device.program2",canChangeIcon: false, width: 2, height: 2) {
  38. state "on", label: '${currentValue}', action: "off2", icon: "st.switches.switch.on", backgroundColor: "#00a0dc", nextState:"off"
  39. state "off", label: '${currentValue}', action: "on2", icon: "st.switches.switch.off", backgroundColor: "#ffffff", nextState:"on"
  40. }
  41.  
  42.  
  43.  
  44.  
  45.  
  46. standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
  47. state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
  48. }
  49.  
  50.  
  51. main(["program1"])
  52. details([
  53.  
  54. "program1",
  55. "program2",
  56. "refresh"
  57. ])
  58. }
  59. }
  60.  
  61. // parse events into attributes
  62. def parse(String description) {
  63. log.debug "Parsing '${description}'"
  64.  
  65.  
  66. }
  67.  
  68.  
  69. def on() {
  70. log.debug "All On"
  71. }
  72.  
  73. def off() {
  74. log.debug "All Off"
  75. }
  76.  
  77.  
  78. def on1() {
  79. log.debug "Executing 'on1'"
  80. sendEvent(name: "program1", value: "on", isStateChange: true, display: false)
  81.  
  82.  
  83. }
  84.  
  85. def off1() {
  86. log.debug "Executing 'off1'"
  87. sendEvent(name: "program1", value: "off", isStateChange: true, display: false)
  88.  
  89. }
  90.  
  91.  
  92. def on2() {
  93. log.debug "Executing 'on2'"
  94. sendEvent(name: "program2", value: "on", isStateChange: true, display: false)
  95.  
  96.  
  97. }
  98.  
  99. def off2() {
  100. log.debug "Executing 'off2'"
  101. sendEvent(name: "program2", value: "off", isStateChange: true, display: false)
  102.  
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement