Guest User

Untitled

a guest
Dec 29th, 2018
918
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. Dual Relay Driver
  2. chat_bubble_outline
  3. more_vert
  4.  
  5. Dashboards
  6. Devices
  7. Apps
  8. Settings
  9. Advanced
  10. codeApps Code
  11. codeDrivers Code
  12. System Events
  13. Logs
  14. Dual Relay Driver Import HelpDeleteSave
  15.  
  16. 1
  17. /*
  18. 2
  19. * Monoprice/Vision Dual Relay Parent Driver
  20. 3
  21. */
  22. 4
  23. metadata {
  24. 5
  25. definition (name: "Dual Relay Driver", namespace: "hubitat", author: "hubitat") {
  26. 6
  27. capability "Refresh"
  28. 7
  29. capability "Actuator"
  30. 8
  31.  
  32. 9
  33. command "childOn"
  34. 10
  35. command "childOff"
  36. 11
  37. command "recreateChildDevices"
  38. 12
  39. command "deleteChildren"
  40. 13
  41. ​
  42. 14
  43. //fingerprint manufacturer: "015D", prod: "0651", model: "F51C", deviceJoinName: "Zooz ZEN20 Power Strip"
  44. 15
  45. //fingerprint deviceId: "0x1004", inClusters: "0x5E,0x85,0x59,0x5A,0x72,0x60,0x8E,0x73,0x27,0x25,0x86"
  46. 16
  47. }
  48. 17
  49. }
  50. 18
  51. ​
  52. 19
  53. def installed() {
  54. 20
  55. log.debug "installed"
  56. 21
  57. createChildDevices()
  58. 22
  59. configure()
  60. 23
  61. }
  62. 24
  63. ​
  64. 25
  65. def updated() {
  66. 26
  67. log.debug "updated"
  68. 27
  69.  
  70. 28
  71. if (!childDevices) {
  72. 29
  73. createChildDevices()
  74. 30
  75. }
  76. 31
  77. else if (device.label != state.oldLabel) {
  78. 32
  79. childDevices.each {
  80. 33
  81. def newLabel = "$device.displayName (CH${channelNumber(it.deviceNetworkId)})"
  82. 34
  83. it.setLabel(newLabel)
  84. 35
  85. }
  86. 36
  87.  
  88. 37
  89. state.oldLabel = device.label
  90. 38
  91. }
  92. 39
  93. ​
  94. 40
  95. configure()
  96. 41
  97. }
  98. 42
  99. ​
  100. 43
  101. def configure() {
  102. 44
  103. log.debug "configure"
  104. 45
  105. def cmds = [
  106. 46
  107. zwave.versionV1.versionGet().format(),
  108. 47
  109. zwave.manufacturerSpecificV2.manufacturerSpecificGet().format(),
  110. Terms of Service
  111. Documentation
  112. Community
  113. Support
  114. Copyright 2018 Hubitat, Inc.
Advertisement
Add Comment
Please, Sign In to add comment