Advertisement
Guest User

Untitled

a guest
Dec 29th, 2018
608
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. 14
  42. //fingerprint manufacturer: "015D", prod: "0651", model: "F51C", deviceJoinName: "Zooz ZEN20 Power Strip"
  43. 15
  44. //fingerprint deviceId: "0x1004", inClusters: "0x5E,0x85,0x59,0x5A,0x72,0x60,0x8E,0x73,0x27,0x25,0x86"
  45. 16
  46. }
  47. 17
  48. }
  49. 18
  50. 19
  51. def installed() {
  52. 20
  53. log.debug "installed"
  54. 21
  55. createChildDevices()
  56. 22
  57. configure()
  58. 23
  59. }
  60. 24
  61. 25
  62. def updated() {
  63. 26
  64. log.debug "updated"
  65. 27
  66.  
  67. 28
  68. if (!childDevices) {
  69. 29
  70. createChildDevices()
  71. 30
  72. }
  73. 31
  74. else if (device.label != state.oldLabel) {
  75. 32
  76. childDevices.each {
  77. 33
  78. def newLabel = "$device.displayName (CH${channelNumber(it.deviceNetworkId)})"
  79. 34
  80. it.setLabel(newLabel)
  81. 35
  82. }
  83. 36
  84.  
  85. 37
  86. state.oldLabel = device.label
  87. 38
  88. }
  89. 39
  90. 40
  91. configure()
  92. 41
  93. }
  94. 42
  95. 43
  96. def configure() {
  97. 44
  98. log.debug "configure"
  99. 45
  100. def cmds = [
  101. 46
  102. zwave.versionV1.versionGet().format(),
  103. 47
  104. zwave.manufacturerSpecificV2.manufacturerSpecificGet().format(),
  105. Terms of Service
  106. Documentation
  107. Community
  108. Support
  109. Copyright 2018 Hubitat, Inc.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement