ramp-thermostat.html 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <script type="text/x-red" data-template-name="ramp-thermostat">
  2. <div class="form-row">
  3. <label for="node-input-profile"><i class="fa fa-line-chart"></i> Profile</label>
  4. <input type="text" id="node-input-profile">
  5. </div>
  6. <div class="form-row">
  7. <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
  8. <input type="text" id="node-input-name" placeholder="Name">
  9. </div>
  10. </script>
  11. <script type="text/x-red" data-help-name="ramp-thermostat">
  12. <p>A node that emulates a thermostat.</p>
  13. <p>The ramp-thermostat controls a heating-device such a valve
  14. depending on the actual input temperature and the target temperature.</p>
  15. <p>The target temperature is defined by a profile that
  16. provides the value depending on the current time <code>00:00-24:00</code>.
  17. The profile consists of several points whose connections build a sequence of lines.
  18. The switching moment can be optimized by defing a gradient line like a <code>ramp</code>.</p>
  19. <p>The node provides 3 outputs:</p>
  20. <ul>
  21. <li><code>state (boolean)</code></li>
  22. <li><code>actual temperature</code></li>
  23. <li><code>target temperature</code></li>
  24. </ul>
  25. </script>
  26. <script type="text/javascript">
  27. RED.nodes.registerType('ramp-thermostat',{
  28. category: 'smart home',
  29. color: '#E9967A',
  30. defaults: {
  31. name: {value:""},
  32. profile: {value:"",type:"profile"}
  33. },
  34. inputs:1,
  35. outputs:3,
  36. icon: "trigger.png",
  37. label: function() {
  38. return this.name||"ramp-thermostat";
  39. },
  40. paletteLabel: 'thermostat'
  41. });
  42. </script>
  43. <script type="text/x-red" data-template-name="profile">
  44. <div class="form-row">
  45. <label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
  46. <input type="text" id="node-config-input-name">
  47. </div>
  48. <div>
  49. <label style="float:left; margin-bottom:10px"><i class="fa fa-dot-circle-o"></i> Points:</label>
  50. <label style="float:left;margin-left:45px;"> Time (hh:mm)&nbsp;&nbsp&nbsp;Temp (°)</label>
  51. </div>
  52. <div class="form-row">
  53. <label for="node-config-input-time1"><i class="fa fa-dot-circle-o"></i> #1</label>
  54. <input class="input-append-left" type="text" id="node-config-input-time1" style="width:50px">
  55. <input type="text" id="node-config-input-temp1" style="margin-left:45px; width:50px">
  56. </div>
  57. <div class="form-row">
  58. <label for="node-config-input-time2"><i class="fa fa-dot-circle-o"></i> #2</label>
  59. <input class="input-append-left" type="text" id="node-config-input-time2" style="width:50px">
  60. <input type="text" id="node-config-input-temp2" style="margin-left:45px; width:50px">
  61. </div>
  62. <div class="form-row">
  63. <label for="node-config-input-time3"><i class="fa fa-dot-circle-o"></i> #3</label>
  64. <input class="input-append-left" type="text" id="node-config-input-time3" style="width:50px">
  65. <input type="text" id="node-config-input-temp3" style="margin-left:45px; width:50px">
  66. </div>
  67. <div class="form-row">
  68. <label for="node-config-input-time4"><i class="fa fa-dot-circle-o"></i> #4</label>
  69. <input class="input-append-left" type="text" id="node-config-input-time4" style="width:50px">
  70. <input type="text" id="node-config-input-temp4" style="margin-left:45px; width:50px">
  71. </div>
  72. <div class="form-row">
  73. <label for="node-config-input-time5"><i class="fa fa-dot-circle-o"></i> #5</label>
  74. <input class="input-append-left" type="text" id="node-config-input-time5" style="width:50px">
  75. <input type="text" id="node-config-input-temp5" style="margin-left:45px; width:50px">
  76. </div>
  77. <div class="form-row">
  78. <label for="node-config-input-time6"><i class="fa fa-dot-circle-o"></i> #6</label>
  79. <input class="input-append-left" type="text" id="node-config-input-time6" style="width:50px">
  80. <input type="text" id="node-config-input-temp6" style="margin-left:45px; width:50px">
  81. </div>
  82. <div class="form-row">
  83. <label for="node-config-input-time7"><i class="fa fa-dot-circle-o"></i> #7</label>
  84. <input class="input-append-left" type="text" id="node-config-input-time7" style="width:50px">
  85. <input type="text" id="node-config-input-temp7" style="margin-left:45px; width:50px">
  86. </div>
  87. <div class="form-row">
  88. <label for="node-config-input-time8"><i class="fa fa-dot-circle-o"></i> #8</label>
  89. <input class="input-append-left" type="text" id="node-config-input-time8" style="width:50px">
  90. <input type="text" id="node-config-input-temp8" style="margin-left:45px; width:50px">
  91. </div>
  92. <div class="form-row">
  93. <label for="node-config-input-time9"><i class="fa fa-dot-circle-o"></i> #9</label>
  94. <input class="input-append-left" type="text" id="node-config-input-time9" style="width:50px">
  95. <input type="text" id="node-config-input-temp9" style="margin-left:45px; width:50px">
  96. </div>
  97. <div class="form-row">
  98. <label for="node-config-input-time10"><i class="fa fa-dot-circle-o"></i> #10</label>
  99. <input class="input-append-left" type="text" id="node-config-input-time10" style="width:50px">
  100. <input type="text" id="node-config-input-temp10" style="margin-left:45px; width:50px">
  101. </div>
  102. <div class="form-tips"><span>You can define up to 10 Points. A Profile has at least 2 Points.<br>
  103. The first Point must start at 00:00 and the last at 24:00.</span></div>
  104. </script>
  105. <script type="text/javascript">
  106. RED.nodes.registerType('profile',{
  107. category: 'config',
  108. defaults: {
  109. name: {value:'',required:true},
  110. time1: {value:''},
  111. temp1: {value:''},
  112. time2: {value:''},
  113. temp2: {value:''},
  114. time3: {value:''},
  115. temp3: {value:''},
  116. time4: {value:''},
  117. temp4: {value:''},
  118. time5: {value:''},
  119. temp5: {value:''},
  120. time6: {value:''},
  121. temp6: {value:''},
  122. time7: {value:''},
  123. temp7: {value:''},
  124. time8: {value:''},
  125. temp8: {value:''},
  126. time9: {value:''},
  127. temp9: {value:''},
  128. time10: {value:''},
  129. temp10: {value:''},
  130. },
  131. label: function() {
  132. return this.name;
  133. }
  134. });
  135. </script>