Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2230 lines
131 KiB

6 years ago
6 years ago
6 years ago
5 years ago
6 years ago
7 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
8 years ago
7 years ago
7 years ago
7 years ago
7 years ago
5 years ago
7 years ago
7 years ago
5 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
6 years ago
7 years ago
8 years ago
8 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
6 years ago
7 years ago
7 years ago
7 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
6 years ago
8 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
6 years ago
8 years ago
7 years ago
8 years ago
7 years ago
8 years ago
7 years ago
7 years ago
8 years ago
7 years ago
7 years ago
8 years ago
7 years ago
7 years ago
8 years ago
7 years ago
7 years ago
8 years ago
7 years ago
8 years ago
8 years ago
8 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
7 years ago
8 years ago
7 years ago
7 years ago
8 years ago
8 years ago
7 years ago
7 years ago
7 years ago
7 years ago
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>ESPurna 0.0.0</title>
  5. <meta charset="utf-8" />
  6. <!-- shortcut::html/favicon.ico -->
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <!-- build:css style.css -->
  9. <link rel="stylesheet" href="vendor/pure-1.0.0.min.css" />
  10. <link rel="stylesheet" href="vendor/pure-grids-responsive-1.0.0.min.css" />
  11. <link rel="stylesheet" href="vendor/side-menu.css" />
  12. <!-- removeIf(!light) -->
  13. <link rel="stylesheet" href="vendor/jquery.wheelcolorpicker-3.0.8.css" />
  14. <!-- endRemoveIf(!light) -->
  15. <!-- removeIf(!rfm69) -->
  16. <link rel="stylesheet" href="vendor/datatables-1.10.16.css" />
  17. <!-- endRemoveIf(!rfm69) -->
  18. <link rel="stylesheet" href="custom.css" />
  19. <!-- endbuild -->
  20. </head>
  21. <body>
  22. <div id="password" class="webmode">
  23. <div class="content">
  24. <form id="formPassword" class="pure-form" autocomplete="off">
  25. <div class="panel block" id="panel-password">
  26. <div class="header">
  27. <h1>SECURITY</h1>
  28. <h2>Before using this device you have to change the default password for the user <strong>admin</strong>. This password will be used for the <strong>AP mode hotspot</strong>, the <strong>web interface</strong> (where you are now) and the <strong>over-the-air updates</strong>.</h2>
  29. </div>
  30. <div class="page">
  31. <fieldset>
  32. <div class="pure-g">
  33. <label class="pure-u-1 pure-u-lg-1-4" for="adminPass1">New Password</label>
  34. <input class="pure-u-1 pure-u-lg-3-4" name="adminPass1" data-settings-real-name="adminPass" minlength="8" maxlength="63" type="password" tabindex="1" autocomplete="false" spellcheck="false" required />
  35. <span class="no-select password-reveal"></span>
  36. </div>
  37. <div class="pure-g">
  38. <label class="pure-u-1 pure-u-lg-1-4" for="adminPass2">Repeat password</label>
  39. <input class="pure-u-1 pure-u-lg-3-4" name="adminPass2" data-settings-real-name="adminPass" minlength="8" maxlength="63" type="password" tabindex="2" autocomplete="false" spellcheck="false" required />
  40. <span class="no-select password-reveal"></span>
  41. </div>
  42. </fieldset>
  43. <div class="pure-g">
  44. <div class="pure-u-1 pure-u-lg-1 hint">
  45. Password must be <strong>8..63 characters</strong> (numbers and letters and any of these special characters: _,.;:~!?@#$%^&amp;*&lt;&gt;\|(){}[]) and have at least <strong>one lowercase</strong> and <strong>one uppercase</strong> or <strong>one number</strong>.</div>
  46. </div>
  47. <div class="pure-g">
  48. <button class="pure-u-11-24 pure-u-lg-1-4 pure-button button-generate-password" type="button" title="Generate password based on password policy">Generate</button>
  49. <div class="pure-u-2-24 pure-u-lg-1-2"></div>
  50. <button class="pure-u-11-24 pure-u-lg-1-4 pure-button button-update-password" type="button" title="Save new password">Save</button>
  51. </div>
  52. </div>
  53. </div>
  54. </form>
  55. </div> <!-- content -->
  56. </div>
  57. <div id="layout" class="webmode">
  58. <a id="menuLink" class="menu-link">
  59. <span></span>
  60. </a>
  61. <div id="menu">
  62. <div class="pure-menu">
  63. <span class="pure-menu-heading" name="hostname">HOSTNAME</span>
  64. <span class="pure-menu-heading small" name="title">ESPurna 0.0.0</span>
  65. <span class="pure-menu-heading small" name="desc"></span>
  66. <ul class="pure-menu-list">
  67. <li class="pure-menu-item">
  68. <a href="#" class="pure-menu-link" data="panel-status">STATUS</a>
  69. </li>
  70. <li class="pure-menu-item menu-item-divided">
  71. <a href="#" class="pure-menu-link" data="panel-general">GENERAL</a>
  72. </li>
  73. <!-- removeIf(!curtain) -->
  74. <li class="pure-menu-item module module-curtain">
  75. <a href="#" class="pure-menu-link" data="panel-curtain">CURTAIN</a>
  76. </li>
  77. <!-- endRemoveIf(!curtain) -->
  78. <!-- removeIf(!thermostat) -->
  79. <li class="pure-menu-item module module-thermostat">
  80. <a href="#" class="pure-menu-link" data="panel-thermostat">THERMOSTAT</a>
  81. </li>
  82. <!-- endRemoveIf(!thermostat) -->
  83. <!-- removeIf(!lightfox) -->
  84. <li class="pure-menu-item module module-lightfox">
  85. <a href="#" class="pure-menu-link" data="panel-lightfox">LIGHTFOX RF</a>
  86. </li>
  87. <!-- endRemoveIf(!lightfox) -->
  88. <li class="pure-menu-item module module-dcz">
  89. <a href="#" class="pure-menu-link" data="panel-domoticz">DOMOTICZ</a>
  90. </li>
  91. <li class="pure-menu-item module module-ha">
  92. <a href="#" class="pure-menu-link" data="panel-ha">HASS</a>
  93. </li>
  94. <li class="pure-menu-item module module-idb">
  95. <a href="#" class="pure-menu-link" data="panel-idb">INFLUXDB</a>
  96. </li>
  97. <li class="pure-menu-item module module-led">
  98. <a href="#" class="pure-menu-link" data="panel-led">LED</a>
  99. </li>
  100. <!-- removeIf(!light) -->
  101. <li class="pure-menu-item module module-color">
  102. <a href="#" class="pure-menu-link" data="panel-color">LIGHTS</a>
  103. </li>
  104. <!-- endRemoveIf(!light) -->
  105. <!-- removeIf(!rfm69) -->
  106. <li class="pure-menu-item module module-rfm69">
  107. <a href="#" class="pure-menu-link" data="panel-mapping">MAPPING</a>
  108. </li>
  109. <li class="pure-menu-item module module-rfm69">
  110. <a href="#" class="pure-menu-link" data="panel-messages">MESSAGES</a>
  111. </li>
  112. <!-- endRemoveIf(!rfm69) -->
  113. <li class="pure-menu-item module module-mqtt">
  114. <a href="#" class="pure-menu-link" data="panel-mqtt">MQTT</a>
  115. </li>
  116. <li class="pure-menu-item module module-nofuss">
  117. <a href="#" class="pure-menu-link" data="panel-nofuss">NOFUSS</a>
  118. </li>
  119. <li class="pure-menu-item module module-ntp">
  120. <a href="#" class="pure-menu-link" data="panel-ntp">NTP</a>
  121. </li>
  122. <!-- removeIf(!rfbridge) -->
  123. <li class="pure-menu-item module module-rfb">
  124. <a href="#" class="pure-menu-link" data="panel-rfb">RF</a>
  125. </li>
  126. <!-- endRemoveIf(!rfbridge) -->
  127. <li class="pure-menu-item module module-rpn">
  128. <a href="#" class="pure-menu-link" data="panel-rpn">RULES</a>
  129. </li>
  130. <li class="pure-menu-item module module-sch">
  131. <a href="#" class="pure-menu-link" data="panel-schedule">SCHEDULE</a>
  132. </li>
  133. <!-- removeIf(!sensor) -->
  134. <li class="pure-menu-item module module-sns">
  135. <a href="#" class="pure-menu-link" data="panel-sns">SENSORS</a>
  136. </li>
  137. <!-- endRemoveIf(!sensor) -->
  138. <li class="pure-menu-item module module-relay">
  139. <a href="#" class="pure-menu-link" data="panel-relay">SWITCHES</a>
  140. </li>
  141. <li class="pure-menu-item module module-tspk">
  142. <a href="#" class="pure-menu-link" data="panel-thingspeak">THINGSPEAK</a>
  143. </li>
  144. <li class="pure-menu-item">
  145. <a href="#" class="pure-menu-link" data="panel-wifi">WIFI</a>
  146. </li>
  147. <li class="pure-menu-item menu-item-divided">
  148. <a href="#" class="pure-menu-link" data="panel-admin">ADMIN</a>
  149. </li>
  150. <li class="pure-menu-item module module-dbg">
  151. <a href="#" class="pure-menu-link" data="panel-dbg">DEBUG</a>
  152. </li>
  153. </ul>
  154. <div class="main-buttons">
  155. <button class="pure-button button-update">Save</button>
  156. <button class="pure-button button-reconnect">Reconnect</button>
  157. <button class="pure-button button-reboot">Reboot</button>
  158. </div>
  159. <div class="footer">
  160. &copy; 2016-2019<br />
  161. Xose Pérez<br/>
  162. <a href="https://twitter.com/xoseperez" rel="noopener" target="_blank">@xoseperez</a><br/>
  163. <a href="http://tinkerman.cat" rel="noopener" target="_blank">http://tinkerman.cat</a><br/>
  164. <a href="https://github.com/xoseperez/espurna" rel="noopener" target="_blank">ESPurna @ GitHub</a><br/>
  165. GPLv3 license<br/>
  166. </div>
  167. </div>
  168. </div>
  169. <div class="content">
  170. <div class="panel block" id="panel-status">
  171. <div class="header">
  172. <h1>STATUS</h1>
  173. <h2>Current configuration</h2>
  174. </div>
  175. <div class="page">
  176. <form class="pure-form pure-form-aligned">
  177. <fieldset>
  178. <div id="relays"></div>
  179. <!-- removeIf(!curtain) -->
  180. <div id="curtains"></div>
  181. <!-- endRemoveIf(!curtain) -->
  182. <!-- removeIf(!light) -->
  183. <div id="colors"></div>
  184. <div id="cct"></div>
  185. <div id="channels"></div>
  186. <!-- endRemoveIf(!light) -->
  187. <!-- removeIf(!sensor) -->
  188. <div id="magnitudes"></div>
  189. <!-- endRemoveIf(!sensor) -->
  190. <!-- removeIf(!rfm69) -->
  191. <div class="pure-g module module-rfm69">
  192. <label class="pure-u-1 pure-u-lg-1-4">Packet count</label>
  193. <div class="pure-u-1 pure-u-lg-1-4"><input class="pure-u-1" type="text" name="packetCount" readonly /></div>
  194. </div>
  195. <div class="pure-g module module-rfm69">
  196. <label class="pure-u-1 pure-u-lg-1-4">Node count</label>
  197. <div class="pure-u-1 pure-u-lg-1-4"><input class="pure-u-1" type="text" name="nodeCount" readonly /></div>
  198. </div>
  199. <!-- endRemoveIf(!rfm69) -->
  200. <div class="pure-u-1 pure-u-lg-1-2 state">
  201. <div class="pure-u-1-2">Manufacturer</div>
  202. <div class="pure-u-11-24"><span class="right" name="manufacturer"></span></div>
  203. <div class="pure-u-1-2">Device</div>
  204. <div class="pure-u-11-24"><span class="right" name="device"></span></div>
  205. <div class="pure-u-1-2">Chip ID</div>
  206. <div class="pure-u-11-24"><span class="right" name="chipid"></span></div>
  207. <div class="pure-u-1-2">Wifi MAC</div>
  208. <div class="pure-u-11-24"><span class="right" name="mac"></span></div>
  209. <div class="pure-u-1-2">SDK version</div>
  210. <div class="pure-u-11-24"><span class="right" name="sdk"></span></div>
  211. <div class="pure-u-1-2">Core version</div>
  212. <div class="pure-u-11-24"><span class="right" name="core"></span></div>
  213. <div class="pure-u-1-2">Firmware name</div>
  214. <div class="pure-u-11-24"><span class="right" name="app_name"></span></div>
  215. <div class="pure-u-1-2">Firmware version</div>
  216. <div class="pure-u-11-24"><span class="right" name="app_version"></span></div>
  217. <div class="pure-u-1-2">Firmware revision</div>
  218. <div class="pure-u-11-24"><span class="right" name="app_revision"></span></div>
  219. <div class="pure-u-1-2">Firmware build date</div>
  220. <div class="pure-u-11-24"><span class="right" name="app_build"></span></div>
  221. <div class="pure-u-1-2">Firmware size</div>
  222. <div class="pure-u-11-24"><span class="right" name="sketch_size" post=" bytes"></span></div>
  223. <div class="pure-u-1-2">Free space</div>
  224. <div class="pure-u-11-24"><span class="right" name="free_size" post=" bytes"></span></div>
  225. </div>
  226. <div class="pure-u-1 pure-u-lg-11-24 state">
  227. <div class="pure-u-1-2">Network</div>
  228. <div class="pure-u-11-24"><span class="right" name="network"></span></div>
  229. <div class="pure-u-1-2">BSSID</div>
  230. <div class="pure-u-11-24"><span class="right" name="bssid"></span></div>
  231. <div class="pure-u-1-2">Channel</div>
  232. <div class="pure-u-11-24"><span class="right" name="channel"></span></div>
  233. <div class="pure-u-1-2">RSSI</div>
  234. <div class="pure-u-11-24"><span class="right" name="rssi"></span></div>
  235. <div class="pure-u-1-2">IP</div>
  236. <div class="pure-u-11-24"><a href=""><span class="right" name="deviceip"></span></a> (<a href=""><span class="right">telnet</span></a>)</div>
  237. <div class="pure-u-1-2">Free heap</div>
  238. <div class="pure-u-11-24"><span class="right" name="heap" post=" bytes"></span></div>
  239. <div class="pure-u-1-2">Load average</div>
  240. <div class="pure-u-11-24"><span class="right" name="loadaverage"></span><span>%</span></div>
  241. <div class="pure-u-1-2">VCC</div>
  242. <div class="pure-u-11-24"><span class="right" name="vcc">? </span><span>mV</span></div>
  243. <div class="pure-u-1-2 module module-mqtt">MQTT Status</div>
  244. <div class="pure-u-11-24 module module-mqtt"><span class="right" name="mqttStatus"></span></div>
  245. <div class="pure-u-1-2 module module-ntp">NTP Status</div>
  246. <div class="pure-u-11-24 module module-ntp"><span class="right" name="ntpStatus"></span></div>
  247. <div class="pure-u-1-2 module module-ntp">Current time</div>
  248. <div class="pure-u-11-24 module module-ntp"><span class="right" name="now"></span></div>
  249. <div class="pure-u-1-2">Uptime</div>
  250. <div class="pure-u-11-24"><span class="right" name="uptime"></span></div>
  251. <div class="pure-u-1-2">Last update</div>
  252. <div class="pure-u-11-24"><span class="right" name="ago">?</span><span> seconds ago</span></div>
  253. </div>
  254. </fieldset>
  255. </form>
  256. </div>
  257. </div>
  258. <form id="form-general" class="pure-form form-settings">
  259. <div class="panel" id="panel-general">
  260. <div class="header">
  261. <h1>GENERAL</h1>
  262. <h2>General configuration values</h2>
  263. </div>
  264. <div class="page">
  265. <fieldset>
  266. <div class="pure-g">
  267. <label class="pure-u-1 pure-u-lg-1-4">Hostname</label>
  268. <input name="hostname" class="pure-u-1 pure-u-lg-1-4" maxlength="31" type="text" action="reboot" tabindex="1" />
  269. <div class="pure-u-0 pure-u-lg-1-2"></div>
  270. <div class="pure-u-0 pure-u-lg-1-4"></div>
  271. <div class="pure-u-1 pure-u-lg-3-4 hint">
  272. This name will identify this device in your network (http://&lt;hostname&gt;.local).<br />
  273. Hostname may contain only the ASCII letters 'a' through 'z' (in a case-insensitive manner), the digits '0' through '9', and the hyphen ('-'). They can neither start or end with an hyphen.<br />
  274. For this setting to take effect you should restart the wifi interface by clicking the "Reconnect" button.
  275. </div>
  276. </div>
  277. <div class="pure-g">
  278. <label class="pure-u-1 pure-u-lg-1-4">Description</label>
  279. <input name="desc" class="pure-u-1 pure-u-lg-3-4" maxlength="64" type="text" tabindex="2" />
  280. <div class="pure-u-0 pure-u-lg-1-4"></div>
  281. <div class="pure-u-1 pure-u-lg-3-4 hint">
  282. Human-friendly name for your device. Will be reported with the heartbeat.<br />
  283. You can use this to specify the location or some other identification information.
  284. </div>
  285. </div>
  286. <div class="pure-g module module-btn">
  287. <label class="pure-u-1 pure-u-lg-1-4">Click repeat delay</label>
  288. <input name="btnRepDel" class="pure-u-1 pure-u-lg-1-4" type="number" action="reboot" min="0" step="100" max="1000" tabindex="6" />
  289. <div class="pure-u-0 pure-u-lg-1-2"></div>
  290. <div class="pure-u-0 pure-u-lg-1-4"></div>
  291. <div class="pure-u-1 pure-u-lg-3-4 hint">
  292. Delay in milliseconds to detect a double or triple click (from 0 to 1000ms).<br />
  293. The lower this number the faster the device will respond to button clicks but the harder it will be to get the expected event.
  294. Increase this number if you are having trouble triggering the event.
  295. Set this value to 0 to disable repeat detection, device will respond immediately to a single button click. When using default configuration, consider that this will disable the SoftAP button action.<br />
  296. You will have to <strong>reboot the device</strong> to apply this setting.
  297. </div>
  298. </div>
  299. <div class="pure-g module module-alexa">
  300. <label class="pure-u-1 pure-u-lg-1-4">Alexa integration</label>
  301. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="alexaEnabled" /></div>
  302. </div>
  303. <div class="pure-g module module-alexa">
  304. <label class="pure-u-1 pure-u-lg-1-4">Alexa device name</label>
  305. <input name="alexaName" class="pure-u-1 pure-u-lg-1-4" maxlength="31" type="text" action="reboot" tabindex="7" />
  306. <div class="pure-u-0 pure-u-lg-1-2"></div>
  307. <div class="pure-u-0 pure-u-lg-1-4"></div>
  308. <div class="pure-u-1 pure-u-lg-3-4 hint">
  309. This name will be used in Alexa integration.<br />
  310. </div>
  311. </div>
  312. </fieldset>
  313. </div>
  314. </div>
  315. </form>
  316. <form id="form-led" class="pure-form form-settings">
  317. <div class="panel" id="panel-led">
  318. <div class="header">
  319. <h1>LED</h1>
  320. <h2>Notification LED configuration</h2>
  321. </div>
  322. <div class="page">
  323. <details>
  324. <summary><legend class="module module-led">Available modes</legend></summary>
  325. <br/>
  326. <div class="pure-g module module-led">
  327. <div class="pure-u-1 pure-u-lg-3-4 hint">
  328. <li><strong>WiFi status</strong> will blink at 1Hz when trying to connect. If successfully connected it will briefly blink every 5 seconds if in STA mode or every second if in AP mode.</li>
  329. <li><strong>Follow switch</strong> will force the LED to follow the status of a given switch (you must define which switch to follow in the side field).</li>
  330. <li><strong>Inverse switch</strong> will force the LED to not-follow the status of a given switch (you must define which switch to follow in the side field).</li>
  331. <li><strong>Find me</strong> will turn the LED ON when all switches are OFF. This is meant to locate switches at night.</li>
  332. <li><strong>Find me &amp; WiFi</strong> will follow the WiFi status but will stay mostly on when switches are OFF, and mostly OFF when any of them is ON.</li>
  333. <li><strong>Switches status</strong> will turn the LED ON whenever any switch is ON, and OFF otherwise. This is global status notification.</li>
  334. <li><strong>Switches status &amp; WiFi</strong> will follow the WiFi status but will stay mostly off when switches are OFF, and mostly ON when any of them is ON.</li>
  335. <li><strong>Manually managed</strong> will let you manage the LED status via MQTT by sending a message to "&lt;base_topic&gt;/led/0/set" with a payload of 0, 1 or 2 (to toggle it).</li>
  336. <li><strong>Always ON</strong> and <strong>Always OFF</strong> modes are self-explanatory.</li>
  337. </div>
  338. </div>
  339. </details>
  340. <fieldset>
  341. <div id="ledConfig"></div>
  342. </fieldset>
  343. </div>
  344. </div>
  345. </form>
  346. <form id="form-relay" class="pure-form form-settings">
  347. <div class="panel" id="panel-relay">
  348. <div class="header">
  349. <h1>SWITCHES</h1>
  350. <h2>Switch / relay configuration</h2>
  351. </div>
  352. <div class="page">
  353. <fieldset>
  354. <legend class="module module-multirelay">General</legend>
  355. <div class="pure-g module module-multirelay">
  356. <label class="pure-u-1 pure-u-lg-1-4">Switch sync mode</label>
  357. <select name="relaySync" class="pure-u-1 pure-u-lg-3-4" tabindex="3">
  358. <option value="0">No synchronisation</option>
  359. <option value="1">Zero or one switches active</option>
  360. <option value="2">One and just one switch active</option>
  361. <option value="3">All synchronised</option>
  362. <option value="4">Switch #0 controls other switches</option>
  363. </select>
  364. <div class="pure-u-0 pure-u-lg-1-4"></div>
  365. <div class="pure-u-1 pure-u-lg-3-4 hint">Define how the different switches should be synchronized.</div>
  366. </div>
  367. <div id="relayConfig"></div>
  368. </fieldset>
  369. </div>
  370. </div>
  371. </form>
  372. <!-- removeIf(!curtain) -->
  373. <form id="form-curtain" class="pure-form form-settings">
  374. <div class="panel" id="panel-curtain">
  375. <div class="header">
  376. <h1>CURTAIN</h1>
  377. <h2>Curtain configuration</h2>
  378. </div>
  379. <div class="page">
  380. <fieldset>
  381. <legend class="module module-curtain">General</legend>
  382. <div class="pure-g module module-curtain">
  383. <label class="pure-u-1 pure-u-lg-1-4">Curtain type</label>
  384. <select class="pure-u-1 pure-u-lg-1-4" name="curtainType" tabindex="3">
  385. <option value="0">Roller</option>
  386. <option value="1">Closing right</option>
  387. <option value="2">Closing left</option>
  388. <option value="3">Two sides</option>
  389. </select>
  390. <div class="pure-u-0 pure-u-lg-1-4"></div>
  391. <div class="pure-u-1 pure-u-lg-3-4 hint">Define your curtain type. It adapts the graphical view in status menu.</div>
  392. </div>
  393. <div class="pure-g module module-curtain">
  394. <label class="pure-u-1 pure-u-lg-1-4">Curtain bootup position</label>
  395. <select class="pure-u-1 pure-u-lg-1-4" name="curtainBoot" tabindex="3">
  396. <option value="0">Do nothing</option>
  397. <option value="1">Closed</option>
  398. <option value="2">Opened</option>
  399. <option value="3">Last set position</option>
  400. </select>
  401. <div class="pure-u-0 pure-u-lg-1-4"></div>
  402. <div class="pure-u-1 pure-u-lg-3-4 hint">Define the initial position of the curtain after a reboot or power loss.</div>
  403. </div>
  404. <div id="curtainConfig"></div>
  405. </fieldset>
  406. </div>
  407. </div>
  408. </form>
  409. <!-- endRemoveIf(!curtain) -->
  410. <!-- removeIf(!light) -->
  411. <form id="form-color" class="pure-form form-settings">
  412. <div class="panel" id="panel-color">
  413. <div class="header">
  414. <h1>LIGHTS</h1>
  415. <h2>Lights configuration</h2>
  416. </div>
  417. <div class="page">
  418. <fieldset>
  419. <div class="pure-g">
  420. <label class="pure-u-1 pure-u-lg-1-4">Use color</label>
  421. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useColor" action="reload" tabindex="8" /></div>
  422. <div class="pure-u-0 pure-u-lg-1-2"></div>
  423. <div class="pure-u-0 pure-u-lg-1-4"></div>
  424. <div class="pure-u-1 pure-u-lg-3-4 hint">Use the first three channels as RGB channels. This will also enable the color picker in the web UI. Will only work if the device has at least 3 dimmable channels.<br />Reload the page to update the web interface.</div>
  425. </div>
  426. <div class="pure-g">
  427. <label class="pure-u-1 pure-u-lg-1-4">Use RGB picker</label>
  428. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useRGB" action="reload" tabindex="11" /></div>
  429. <div class="pure-u-0 pure-u-lg-1-2"></div>
  430. <div class="pure-u-0 pure-u-lg-1-4"></div>
  431. <div class="pure-u-1 pure-u-lg-3-4 hint">Use RGB color picker if enabled (plus brightness), otherwise use HSV (hue-saturation-value) style</div>
  432. </div>
  433. <div class="pure-g">
  434. <label class="pure-u-1 pure-u-lg-1-4">Use white channel</label>
  435. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useWhite" action="reload" tabindex="9" /></div>
  436. <div class="pure-u-0 pure-u-lg-1-2"></div>
  437. <div class="pure-u-0 pure-u-lg-1-4"></div>
  438. <div class="pure-u-1 pure-u-lg-3-4 hint">For 2 channels warm white and cold white lights or color lights to use forth dimmable channel as (cold) white light calculated out of the RGB values.<br />Will only work if the device has at least 4 dimmable channels.<br />Enabling this will render useless the "Channel 4" slider in the status page.<br />Reload the page to update the web interface.</div>
  439. </div>
  440. <div class="pure-g">
  441. <label class="pure-u-1 pure-u-lg-1-4">Use white color temperature</label>
  442. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useCCT" action="reload" tabindex="10" /></div>
  443. <div class="pure-u-0 pure-u-lg-1-2"></div>
  444. <div class="pure-u-0 pure-u-lg-1-4"></div>
  445. <div class="pure-u-1 pure-u-lg-3-4 hint">Use a dimmable channel as warm white light and another dimmable channel as cold white light.<br />On devices with two dimmable channels the first use used for warm white light and the second for cold white light.<br />On color lights the fifth use used for warm white light and the fourth for cold white light.<br />Will only work if the device has exactly 2 dimmable channels or at least 5 dimmable channels and "white channel" above is also ON.<br />Enabling this will render useless the "Channel 5" slider in the status page.<br />Reload the page to update the web interface.</div>
  446. </div>
  447. <div class="pure-g">
  448. <label class="pure-u-1 pure-u-lg-1-4">Use gamma correction</label>
  449. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useGamma" tabindex="11" /></div>
  450. <div class="pure-u-0 pure-u-lg-1-2"></div>
  451. <div class="pure-u-0 pure-u-lg-1-4"></div>
  452. <div class="pure-u-1 pure-u-lg-3-4 hint">Use gamma correction for RGB channels.<br />Will only work if "use colorpicker" above is also ON.</div>
  453. </div>
  454. <div class="pure-g">
  455. <label class="pure-u-1 pure-u-lg-1-4">Use CSS style</label>
  456. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useCSS" tabindex="12" /></div>
  457. <div class="pure-u-0 pure-u-lg-1-2"></div>
  458. <div class="pure-u-0 pure-u-lg-1-4"></div>
  459. <div class="pure-u-1 pure-u-lg-3-4 hint">
  460. <div class="module module-ha">
  461. <strong>WARNING! </strong>Incompatible with Home Assistant MQTT integration
  462. </div>
  463. Use CSS style to report colors to MQTT and REST API. <br />Red will be reported as "#FF0000" if ON, otherwise "255,0,0"
  464. </div>
  465. </div>
  466. <div class="pure-g">
  467. <label class="pure-u-1 pure-u-lg-1-4">Color transitions</label>
  468. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useTransitions" tabindex="13" /></div>
  469. <div class="pure-u-0 pure-u-lg-1-2"></div>
  470. <div class="pure-u-0 pure-u-lg-1-4"></div>
  471. <div class="pure-u-1 pure-u-lg-3-4 hint">If enabled color changes will be smoothed.</div>
  472. </div>
  473. <div class="pure-g">
  474. <label class="pure-u-1 pure-u-lg-1-4">Transition time</label>
  475. <div class="pure-u-1 pure-u-lg-1-4"><input class="pure-u-1" type="number" name="lightTime" min="10" max="5000" tabindex="14" /></div>
  476. <div class="pure-u-0 pure-u-lg-1-2"></div>
  477. <div class="pure-u-0 pure-u-lg-1-4"></div>
  478. <div class="pure-u-1 pure-u-lg-3-4 hint">Time in millisecons to transition from one color to another.</div>
  479. </div>
  480. <div class="pure-g">
  481. <div class="pure-u-1 pure-u-lg-1-4"><label>MQTT group</label></div>
  482. <div class="pure-u-1 pure-u-lg-3-4"><input name="mqttGroupColor" class="pure-u-1" tabindex="15" action="reconnect" /></div>
  483. <div class="pure-u-0 pure-u-lg-1-4"></div>
  484. <div class="pure-u-1 pure-u-lg-3-4 hint">Sync color between different lights.</div>
  485. </div>
  486. </fieldset>
  487. </div>
  488. </div>
  489. </form>
  490. <!-- endRemoveIf(!light) -->
  491. <form id="form-admin" class="pure-form form-settings">
  492. <div class="panel" id="panel-admin">
  493. <div class="header">
  494. <h1>ADMINISTRATION</h1>
  495. <h2>Device administration and security settings</h2>
  496. </div>
  497. <div class="page">
  498. <fieldset>
  499. <div class="pure-g">
  500. <label class="pure-u-1 pure-u-lg-1-4">Settings</label>
  501. <div class="pure-u-1-3 pure-u-lg-1-4"><button type="button" class="pure-button button-settings-backup pure-u-23-24">Backup</button></div>
  502. <div class="pure-u-1-3 pure-u-lg-1-4"><button type="button" class="pure-button button-settings-restore pure-u-23-24">Restore</button></div>
  503. <div class="pure-u-1-3 pure-u-lg-1-4"><button type="button" class="pure-button button-settings-factory pure-u-1">Factory Reset</button></div>
  504. </div>
  505. <div class="pure-g">
  506. <label class="pure-u-1 pure-u-lg-1-4">Admin password</label>
  507. <input name="adminPass1" class="pure-u-1 pure-u-lg-3-4" placeholder="New password" data-settings-real-name="adminPass" minlength="8" maxlength="63" type="password" action="reboot" tabindex="11" autocomplete="false" spellcheck="false" />
  508. <span class="no-select password-reveal"></span>
  509. <div class="pure-u-1 pure-u-lg-1-4"></div>
  510. <input name="adminPass2" class="pure-u-1 pure-u-lg-3-4" placeholder="Repeat password" data-settings-real-name="adminPass" minlength="8" maxlength="63" type="password" action="reboot" tabindex="12" autocomplete="false" spellcheck="false" />
  511. <span class="no-select password-reveal"></span>
  512. <div class="pure-u-0 pure-u-lg-1-4"></div>
  513. <div class="pure-u-1 pure-u-lg-3-4 hint">
  514. The administrator password is used to access this web interface (user 'admin'), but also to connect to the device when in AP mode or to flash a new firmware over-the-air (OTA).<br />
  515. It must be <strong>8..63 characters</strong> (numbers and letters and any of these special characters: _,.;:~!?@#$%^&amp;*&lt;&gt;\|(){}[]) and have at least <strong>one lowercase</strong> and <strong>one uppercase</strong> or <strong>one number</strong>.</div>
  516. </div>
  517. <div class="pure-g">
  518. <label class="pure-u-1 pure-u-lg-1-4">HTTP port</label>
  519. <input name="webPort" class="pure-u-1 pure-u-lg-1-4" type="text" action="reboot" tabindex="13" />
  520. <div class="pure-u-0 pure-u-lg-1-2"></div>
  521. <div class="pure-u-0 pure-u-lg-1-4"></div>
  522. <div class="pure-u-1 pure-u-lg-3-4 hint">
  523. This is the port for the web interface and API requests.
  524. If different than 80 (standard HTTP port) you will have to add it explicitly to your requests: http://myip:myport/
  525. </div>
  526. </div>
  527. <div class="pure-g">
  528. <label class="pure-u-1 pure-u-lg-1-4">Enable WS Auth</label>
  529. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="wsAuth" /></div>
  530. </div>
  531. <div class="pure-g module module-api">
  532. <label class="pure-u-1 pure-u-lg-1-4">Enable HTTP API</label>
  533. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="apiEnabled" /></div>
  534. </div>
  535. <div class="pure-g module module-api">
  536. <label class="pure-u-1 pure-u-lg-1-4">Restful API</label>
  537. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="apiRestFul" /></div>
  538. <div class="pure-u-0 pure-u-lg-1-2"></div>
  539. <div class="pure-u-0 pure-u-lg-1-4"></div>
  540. <div class="pure-u-1 pure-u-lg-3-4 hint">
  541. If enabled, API requests to change a status (like a relay) must be done using PUT.
  542. If disabled you can issue them as GET requests (easier from a browser).
  543. </div>
  544. </div>
  545. <div class="pure-g module module-api">
  546. <label class="pure-u-1 pure-u-lg-1-4">Real time API</label>
  547. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="apiRealTime" /></div>
  548. <div class="pure-u-0 pure-u-lg-1-2"></div>
  549. <div class="pure-u-0 pure-u-lg-1-4"></div>
  550. <div class="pure-u-1 pure-u-lg-3-4 hint">
  551. By default, some magnitudes are being preprocessed and filtered to avoid spurious values.
  552. If you want to get real-time values (not preprocessed) in the API turn on this setting.
  553. </div>
  554. </div>
  555. <div class="pure-g module module-api">
  556. <label class="pure-u-1 pure-u-lg-1-4">HTTP API Key</label>
  557. <input name="apiKey" class="pure-u-3-4 pure-u-lg-1-2" type="text" tabindex="14" />
  558. <div class="pure-u-1-4 pure-u-lg-1-4"><button type="button" class="pure-button button-apikey pure-u-23-24">Auto</button></div>
  559. <div class="pure-u-0 pure-u-lg-1-4"></div>
  560. <div class="pure-u-1 pure-u-lg-3-4 hint">
  561. This is the key you will have to pass with every HTTP request to the API, either to get or write values.
  562. All API calls must contain the <strong>apikey</strong> parameter with the value above.
  563. To know what APIs are enabled do a call to <strong>/apis</strong>.
  564. </div>
  565. </div>
  566. <div class="pure-g module module-telnet">
  567. <label class="pure-u-1 pure-u-lg-1-4">Enable TELNET</label>
  568. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="telnetSTA" /></div>
  569. <div class="pure-u-0 pure-u-lg-1-2"></div>
  570. <div class="pure-u-0 pure-u-lg-1-4"></div>
  571. <div class="pure-u-1 pure-u-lg-3-4 hint">Turn ON to be able to telnet to your device while connected to your home router.<br />TELNET is always enabled in AP mode.</div>
  572. </div>
  573. <div class="pure-g module module-telnet">
  574. <label class="pure-u-1 pure-u-lg-1-4">TELNET Password</label>
  575. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="telnetAuth" /></div>
  576. <div class="pure-u-0 pure-u-lg-1-2"></div>
  577. <div class="pure-u-0 pure-u-lg-1-4"></div>
  578. <div class="pure-u-1 pure-u-lg-3-4 hint">Request password when starting telnet session</div>
  579. </div>
  580. <div class="pure-g">
  581. <label class="pure-u-1 pure-u-lg-1-4">Heartbeat message</label>
  582. <select class="pure-u-1 pure-u-lg-3-4" name="hbMode" tabindex="15" >
  583. <option value="0">Disabled</option>
  584. <option value="1">On device startup</option>
  585. <option value="2">Repeat after defined interval</option>
  586. <option value="3">Repeat only device status</option>
  587. </select>
  588. <div class="pure-u-0 pure-u-lg-1-4"></div>
  589. <div class="pure-u-1 pure-u-lg-3-4 hint">
  590. Define when heartbeat message will be sent.
  591. </div>
  592. </div>
  593. <div class="pure-g">
  594. <label class="pure-u-1 pure-u-lg-1-4">Heartbeat interval</label>
  595. <input name="hbInterval" class="pure-u-1 pure-u-lg-1-4" type="number" tabindex="16" />
  596. <div class="pure-u-0 pure-u-lg-1-2"></div>
  597. <div class="pure-u-0 pure-u-lg-1-4"></div>
  598. <div class="pure-u-1 pure-u-lg-3-4 hint">
  599. This is the interval in <strong>seconds</strong> how often to send the heartbeat message.
  600. </div>
  601. </div>
  602. <div class="pure-g module module-ota">
  603. <label class="pure-u-1 pure-u-lg-1-4">Upgrade</label>
  604. <input class="pure-u-1-2 pure-u-lg-1-2" name="filename" type="text" readonly />
  605. <div class="pure-u-1-4 pure-u-lg-1-8"><button type="button" class="pure-button button-upgrade-browse pure-u-23-24">Browse</button></div>
  606. <div class="pure-u-1-4 pure-u-lg-1-8"><button type="button" class="pure-button button-upgrade pure-u-23-24">Upgrade</button></div>
  607. <div class="pure-u-0 pure-u-lg-1-4"></div>
  608. <div class="pure-u-1 pure-u-lg-3-4 hint">The device has <span name="free_size"></span> bytes available for OTA updates. If your image is larger than this consider doing a <a href="https://github.com/xoseperez/espurna/wiki/TwoStepUpdates" rel="noopener" target="_blank"><strong>two-step update</strong></a>.</div>
  609. <div class="pure-u-0 pure-u-lg-1-4"></div>
  610. <div class="pure-u-1 pure-u-lg-3-4"><progress id="upgrade-progress"></progress></div>
  611. <input name="upgrade" type="file" tabindex="17" />
  612. </div>
  613. </fieldset>
  614. </div>
  615. </div>
  616. </form>
  617. <form id="form-wifi" class="pure-form form-settings">
  618. <div class="panel" id="panel-wifi">
  619. <div class="header">
  620. <h1>WIFI</h1>
  621. <h2>You can configure up to 5 different WiFi networks. The device will try to connect in order of signal strength.</h2>
  622. </div>
  623. <div class="page">
  624. <fieldset>
  625. <legend>General</legend>
  626. <div class="pure-g">
  627. <div class="pure-u-1 pure-u-lg-1-4"></div>
  628. <div class="pure-u-1 pure-u-lg-3-4 hint">Device hostname can be configured on the GENERAL tab.</div>
  629. </div>
  630. <div class="pure-g">
  631. <label class="pure-u-1 pure-u-lg-1-4">Scan networks</label>
  632. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="wifiScan" tabindex="1" /></div>
  633. <div class="pure-u-0 pure-u-lg-1-2"></div>
  634. <div class="pure-u-0 pure-u-lg-1-4"></div>
  635. <div class="pure-u-1 pure-u-lg-3-4 hint">
  636. ESPurna will scan for visible WiFi SSIDs and try to connect to networks defined below in order of <strong>signal strength</strong>, even if multiple AP share the same SSID.
  637. When disabled, ESPurna will try to connect to the networks in the same order they are listed below.
  638. Disable this option if you are <strong>connecting to a single access point</strong> (or router) or to a <strong>hidden SSID</strong>.
  639. </div>
  640. <div class="pure-u-0 pure-u-lg-1-4"></div>
  641. <button class="pure-button button-wifi-scan" type="button">Scan now</button>
  642. <div class="pure-u-0 pure-u-lg-1-4 scan loading"></div>
  643. </div>
  644. <div class="pure-g">
  645. <span class="pure-u-1 terminal" id="scanResult" name="scanResult"></span>
  646. </div>
  647. <legend>Networks</legend>
  648. <div id="networks" class="group-settings" data-settings-target="ssid pass" ></div>
  649. <button type="button" class="pure-button button-add-network">Add network</button>
  650. </fieldset>
  651. </div>
  652. </div>
  653. </form>
  654. <form id="form-schedule" class="pure-form form-settings">
  655. <div class="panel" id="panel-schedule">
  656. <div class="header">
  657. <h1>SCHEDULE</h1>
  658. <h2>Turn switches ON and OFF based on the current time.</h2>
  659. </div>
  660. <div class="page">
  661. <fieldset>
  662. <div id="schedules" class="group-settings" data-settings-max="10" data-settings-target="schSwitch schType" ></div>
  663. <button type="button" class="pure-button button-add-switch-schedule module module-relay">Add switch schedule</button>
  664. <!-- removeIf(!light) -->
  665. <button type="button" class="pure-button button-add-light-schedule module module-color">Add channel schedule</button>
  666. <!-- endRemoveIf(!light) -->
  667. <!-- removeIf(!curtain) -->
  668. <button type="button" class="pure-button button-add-curtain-schedule module module-curtain">Add curtain schedule</button>
  669. <!-- endRemoveIf(!curtain) -->
  670. </fieldset>
  671. </div>
  672. </div>
  673. </form>
  674. <!-- removeIf(!rfm69) -->
  675. <form id="form-mapping" class="pure-form form-settings">
  676. <div class="panel" id="panel-mapping">
  677. <div class="header">
  678. <h1>MAPPING</h1>
  679. <h2>
  680. Configure the map between nodeID/key and MQTT topic. Messages from the given nodeID with the given key will be forwarded to the specified topic.
  681. You can also configure a default topic using {nodeid} and {key} as placeholders, if the default topic is empty messages without defined map will be discarded.
  682. </h2>
  683. </div>
  684. <div class="page">
  685. <fieldset>
  686. <legend>Default topic</legend>
  687. <div class="pure-g">
  688. <input name="rfm69Topic" type="text" class="pure-u-23-24" value="" size="8" tabindex="41" placeholder="Default MQTT Topic (use {nodeid} and {key} as placeholders)">
  689. </div>
  690. <legend>Specific topics</legend>
  691. <div id="mapping" class="group-settings" ></div>
  692. <button type="button" class="pure-button button-add-mapping">Add</button>
  693. </fieldset>
  694. </div>
  695. </div>
  696. </form>
  697. <form id="form-messages" class="pure-form">
  698. <div class="panel" id="panel-messages">
  699. <div class="header">
  700. <h1>MESSAGES</h1>
  701. <h2>
  702. Messages being received. Previous messages are not displayed.
  703. You have to keep the page open in order to keep receiving them.
  704. You can filter/unfilter by clicking on the values.
  705. Left click on a value to show only rows that match that value, middle click to show all rows but those matching that value.
  706. Filtered colums have red headers.
  707. </h2>
  708. </div>
  709. <div class="page">
  710. <table id="packets" class="display" cellspacing="0">
  711. <thead>
  712. <tr>
  713. <th>Timestamp</th>
  714. <th>SenderID</th>
  715. <th>PacketID</th>
  716. <th>TargetID</th>
  717. <th>Key</th>
  718. <th>Value</th>
  719. <th>RSSI</th>
  720. <th>Duplicates</th>
  721. <th>Missing</th>
  722. </tr>
  723. </thead>
  724. <tbody>
  725. </tbody>
  726. </table>
  727. <button type="button" class="pure-button button-clear-filters">Clear filters</button>
  728. <button type="button" class="pure-button button-clear-messages">Clear messages</button>
  729. <button type="button" class="pure-button button-clear-counts">Clear counts</button>
  730. </div>
  731. </div>
  732. </form>
  733. <!-- endRemoveIf(!rfm69) -->
  734. <form id="form-mqtt" class="pure-form form-settings">
  735. <div class="panel" id="panel-mqtt">
  736. <div class="header">
  737. <h1>MQTT</h1>
  738. <h2>Configure an <strong>MQTT broker</strong> in your network and you will be able to change the switch status via an MQTT message.</h2>
  739. </div>
  740. <div class="page">
  741. <fieldset>
  742. <div class="pure-g">
  743. <label class="pure-u-1 pure-u-lg-1-4">Enable MQTT</label>
  744. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="mqttEnabled" tabindex="30" /></div>
  745. </div>
  746. <div class="pure-g">
  747. <label class="pure-u-1 pure-u-lg-1-4">MQTT Broker</label>
  748. <input class="pure-u-1 pure-u-lg-1-4" name="mqttServer" type="text" tabindex="21" placeholder="IP or address of your broker" />
  749. </div>
  750. <div class="pure-g">
  751. <label class="pure-u-1 pure-u-lg-1-4">MQTT Port</label>
  752. <input class="pure-u-1 pure-u-lg-1-4" name="mqttPort" type="text" tabindex="22" value="1883" />
  753. </div>
  754. <div class="pure-g">
  755. <label class="pure-u-1 pure-u-lg-1-4">MQTT User</label>
  756. <input class="pure-u-1 pure-u-lg-1-4" name="mqttUser" type="text" tabindex="23" placeholder="Leave blank if no user" autocomplete="off" />
  757. <div class="pure-u-0 pure-u-lg-1-2"></div>
  758. <div class="pure-u-0 pure-u-lg-1-4"></div>
  759. <div class="pure-u-1 pure-u-lg-3-4 hint">
  760. You can use the following placeholders: {hostname}, {mac}
  761. </div>
  762. </div>
  763. <div class="pure-g">
  764. <label class="pure-u-1 pure-u-lg-1-4">MQTT Password</label>
  765. <input class="pure-u-1 pure-u-lg-1-4" name="mqttPassword" type="password" tabindex="24" placeholder="Leave blank if no pass" autocomplete="new-password" spellcheck="false" />
  766. <span class="no-select password-reveal"></span>
  767. </div>
  768. <div class="pure-g">
  769. <label class="pure-u-1 pure-u-lg-1-4">MQTT Client ID</label>
  770. <input class="pure-u-1 pure-u-lg-1-4" name="mqttClientID" type="text" tabindex="25" />
  771. <div class="pure-u-0 pure-u-lg-1-2"></div>
  772. <div class="pure-u-0 pure-u-lg-1-4"></div>
  773. <div class="pure-u-1 pure-u-lg-3-4 hint">
  774. If left empty the firmware will generate a client ID based on the serial number of the chip. You can use the following placeholders: {hostname}, {mac}
  775. </div>
  776. </div>
  777. <div class="pure-g">
  778. <label class="pure-u-1 pure-u-lg-1-4">MQTT QoS</label>
  779. <select class="pure-u-1 pure-u-lg-1-4" name="mqttQoS" tabindex="26">
  780. <option value="0">0: At most once</option>
  781. <option value="1">1: At least once</option>
  782. <option value="2">2: Exactly once</option>
  783. </select>
  784. </div>
  785. <div class="pure-g">
  786. <label class="pure-u-1 pure-u-lg-1-4">MQTT Retain</label>
  787. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="mqttRetain" tabindex="27" /></div>
  788. </div>
  789. <div class="pure-g">
  790. <label class="pure-u-1 pure-u-lg-1-4">MQTT Keep Alive</label>
  791. <input class="pure-u-1 pure-u-lg-1-4" type="number" name="mqttKeep" min="10" max="3600" tabindex="28" />
  792. </div>
  793. <div class="pure-g module module-mqttssl">
  794. <label class="pure-u-1 pure-u-lg-1-4">Use secure connection (SSL)</label>
  795. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="mqttUseSSL" tabindex="29" /></div>
  796. </div>
  797. <div class="pure-g module module-mqttssl">
  798. <label class="pure-u-1 pure-u-lg-1-4">SSL Fingerprint</label>
  799. <input class="pure-u-1 pure-u-lg-3-4" name="mqttFP" type="text" maxlength="59" tabindex="30" />
  800. <div class="pure-u-0 pure-u-lg-1-4"></div>
  801. <div class="pure-u-1 pure-u-lg-3-4 hint">
  802. This is the fingerprint for the SSL certificate of the server.<br />
  803. You can get it using <a href="https://www.grc.com/fingerprints.htm" rel="noopener" target="_blank">https://www.grc.com/fingerprints.htm</a><br />
  804. or using openssl from a linux box by typing:<br />
  805. <pre>$ openssl s_client -connect &lt;host&gt;:&lt;port&gt; &lt; /dev/null 2&gt;/dev/null | openssl x509 -fingerprint -noout -in /dev/stdin</pre>
  806. </div>
  807. </div>
  808. <div class="pure-g">
  809. <label class="pure-u-1 pure-u-lg-1-4">MQTT Root Topic</label>
  810. <input class="pure-u-1 pure-u-lg-3-4" name="mqttTopic" type="text" tabindex="31" />
  811. <div class="pure-u-0 pure-u-lg-1-4"></div>
  812. <div class="pure-u-1 pure-u-lg-3-4 hint">
  813. This is the root topic for this device. The {hostname} and {mac} placeholders will be replaced by the device hostname and MAC address.<br />
  814. - <strong>&lt;root&gt;/relay/#/set</strong> Send a 0 or a 1 as a payload to this topic to switch it on or off. You can also send a 2 to toggle its current state. Replace # with the switch ID (starting from 0). If the board has only one switch it will be 0.<br />
  815. <!-- removeIf(!curtain) -->
  816. - <strong>&lt;root&gt;/curtain/set</strong> Set the curtain opening value (0-100), 0 means closed, 100 opened. "on", "off", "pause" pilots buttons.<br />
  817. <!-- endRemoveIf(!curtain) -->
  818. <!-- removeIf(!light) -->
  819. <span class="module module-color">- <strong>&lt;root&gt;/rgb/set</strong> Set the color using this topic, your can either send an "#RRGGBB" value or "RRR,GGG,BBB" (0-255 each).<br /></span>
  820. <span class="module module-color">- <strong>&lt;root&gt;/hsv/set</strong> Set the color using hue (0-360), saturation (0-100) and value (0-100) values, comma separated.<br /></span>
  821. <span class="module module-color">- <strong>&lt;root&gt;/brightness/set</strong> Set the brighness (0-255).<br /></span>
  822. <span class="module module-color">- <strong>&lt;root&gt;/channel/#/set</strong> Set the value for a single color channel (0-255). Replace # with the channel ID (starting from 0 and up to 4 for RGBWC lights).<br /></span>
  823. <span class="module module-color">- <strong>&lt;root&gt;/mired/set</strong> Set the temperature color in mired.<br /></span>
  824. <!-- endRemoveIf(!light) -->
  825. - <strong>&lt;root&gt;/status</strong> The device will report a 1 to this topic every few minutes. Upon MQTT disconnecting this will be set to 0.<br />
  826. - Other values reported (depending on the build) are: <strong>firmware</strong> and <strong>version</strong>, <strong>hostname</strong>, <strong>IP</strong>, <strong>MAC</strong>, signal strenth (<strong>RSSI</strong>), <strong>uptime</strong> (in seconds), <strong>free heap</strong> and <strong>power supply</strong>.
  827. </div>
  828. </div>
  829. <div class="pure-g">
  830. <label class="pure-u-1 pure-u-lg-1-4">Use JSON payload</label>
  831. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="mqttUseJson" tabindex="32" /></div>
  832. <div class="pure-u-1 pure-u-lg-1-2"></div>
  833. <div class="pure-u-1 pure-u-lg-1-4"></div>
  834. <div class="pure-u-1 pure-u-lg-3-4 hint">
  835. All messages (except the device status) will be included in a JSON payload along with the timestamp and hostname
  836. and sent under the <strong>&lt;root&gt;/data</strong> topic.<br />
  837. Messages will be queued and sent after 100ms, so different messages could be merged into a single payload.<br />
  838. Subscriptions will still be done to single topics.
  839. </div>
  840. </div>
  841. </fieldset>
  842. </div>
  843. </div>
  844. </form>
  845. <form id="form-nofuss" class="pure-form form-settings">
  846. <div class="panel" id="panel-nofuss">
  847. <div class="header">
  848. <h1>NoFUSS</h1>
  849. <h2>Automatically upgrade the firmware (see <a href="https://bitbucket.org/xoseperez/nofuss">xoseperez/nofuss</a> for details)</h2>
  850. </div>
  851. <div class="page">
  852. <fieldset>
  853. <div class="pure-g">
  854. <label class="pure-u-1 pure-u-lg-1-4">Enable</label>
  855. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="nofussEnabled" /></div>
  856. </div>
  857. <div class="pure-g">
  858. <label class="pure-u-1 pure-u-lg-1-4">Server</label>
  859. <input name="nofussServer" class="pure-u-1 pure-u-lg-3-4" type="text" tabindex="15" />
  860. <div class="pure-u-0 pure-u-lg-1-4"></div>
  861. <div class="pure-u-1 pure-u-lg-3-4 hint">Address of the NoFUSS server</div>
  862. </div>
  863. </fieldset>
  864. </div>
  865. </div>
  866. </form>
  867. <form id="form-ntp" class="pure-form form-settings">
  868. <div class="panel" id="panel-ntp">
  869. <div class="header">
  870. <h1>NTP</h1>
  871. <h2>Configure your NTP (Network Time Protocol) servers and local configuration to keep your device time up to the second for your location.</h2>
  872. </div>
  873. <div class="page">
  874. <fieldset>
  875. <div class="pure-g">
  876. <label class="pure-u-1 pure-u-lg-1-4">Device Current Time</label>
  877. <input class="pure-u-1 pure-u-lg-3-4" name="now" type="text" readonly />
  878. </div>
  879. <div class="pure-g">
  880. <label class="pure-u-1 pure-u-lg-1-4">NTP Server</label>
  881. <input class="pure-u-1 pure-u-lg-3-4" name="ntpServer" type="text" tabindex="41" />
  882. </div>
  883. <div class="pure-g module module-ntplwip">
  884. <label class="pure-u-1 pure-u-lg-1-4">Time Zone</label>
  885. <input class="pure-u-1 pure-u-lg-3-4" name="ntpTZ" type="text" tabindex="42" />
  886. </div>
  887. <div class="pure-g module module-ntplegacy">
  888. <label class="pure-u-1 pure-u-lg-1-4">Time Zone</label>
  889. <select class="pure-u-1 pure-u-lg-1-4" name="ntpOffset" tabindex="42"></select>
  890. </div>
  891. <div class="pure-g module module-ntplegacy">
  892. <label class="pure-u-1 pure-u-lg-1-4">Enable DST</label>
  893. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="ntpDST" /></div>
  894. </div>
  895. <div class="pure-g module module-ntplegacy">
  896. <label class="pure-u-1 pure-u-lg-1-4">DST Region</label>
  897. <select class="pure-u-1 pure-u-lg-1-4" name="ntpRegion">
  898. <option value="0">Europe</option>
  899. <option value="1">USA</option>
  900. </select>
  901. </div>
  902. </fieldset>
  903. </div>
  904. </div>
  905. </form>
  906. <!-- removeIf(!thermostat) -->
  907. <form id="form-thermostat" class="pure-form form-settings">
  908. <div class="panel" id="panel-thermostat">
  909. <div class="header">
  910. <h1>THERMOSTAT</h1>
  911. <h2>Thermostat configuration</h2>
  912. </div>
  913. <div class="page">
  914. <div class="pure-g">
  915. <label class="pure-u-1 pure-u-lg-1-4">Enable Thermostat</label>
  916. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="thermostatEnabled" tabindex="30" /></div>
  917. </div>
  918. <div class="pure-g">
  919. <label class="pure-u-1 pure-u-lg-1-4">Thermostat Mode</label>
  920. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="thermostatMode" tabindex="30" /></div>
  921. </div>
  922. <div class="pure-g">
  923. <label class="pure-u-1 pure-u-lg-1-4" for="thermostatOperationMode">Operation mode</label>
  924. <input class="pure-u-1 pure-u-lg-1-4" name="thermostatOperationMode" type="text" readonly />
  925. </div>
  926. <fieldset>
  927. <legend>Temperature range</legend>
  928. <div class="pure-g">
  929. <label class="pure-u-1 pure-u-lg-1-4">Max (<span class="tmpUnit"></span>)</label>
  930. <input class="pure-u-1 pure-u-lg-1-4" id="tempRangeMaxInput" name="tempRangeMax" type="number" min="1" max="100" tabindex="32" data="20" onchange="checkTempRangeMax()" />
  931. </div>
  932. <div class="pure-g">
  933. <label class="pure-u-1 pure-u-lg-1-4">Min (<span class="tmpUnit"></span>)</label>
  934. <input class="pure-u-1 pure-u-lg-1-4" id="tempRangeMinInput" name="tempRangeMin" type="number" min="0" max="99" tabindex="31" data="10" onchange="checkTempRangeMin()" />
  935. </div>
  936. </fieldset>
  937. <fieldset>
  938. <legend>Remote sensor</legend>
  939. <div class="pure-g">
  940. <label class="pure-u-1 pure-u-lg-1-4" for="remoteSensorName">Remote sensor name</label>
  941. <input class="pure-u-1 pure-u-lg-1-4" name="remoteSensorName" type="text" />
  942. </div>
  943. <div class="pure-g">
  944. <label class="pure-u-1 pure-u-lg-1-4" for="remoteTmp">Remote temperature (<span class="tmpUnit"></span>)</label>
  945. <input class="pure-u-1 pure-u-lg-1-4" name="remoteTmp" type="text" readonly />
  946. </div>
  947. <div class="pure-g">
  948. <label class="pure-u-1 pure-u-lg-1-4" for="remoteTempMaxWait">Remote temperature waiting (s)</label>
  949. <input class="pure-u-1 pure-u-lg-1-4" name="remoteTempMaxWait" type="number" min="0" max="1800" tabindex="33" data="120" />
  950. </div>
  951. </fieldset>
  952. <fieldset>
  953. <legend>Operation mode</legend>
  954. <div class="pure-g">
  955. <label class="pure-u-1 pure-u-lg-1-4" for="maxOnTime">Max heating time (m)</label>
  956. <input class="pure-u-1 pure-u-lg-1-4" name="maxOnTime" type="number" min="0" max="180" tabindex="34" data="30" />
  957. </div>
  958. <div class="pure-g">
  959. <label class="pure-u-1 pure-u-lg-1-4" for="minOffTime">Min rest time (m)</label>
  960. <input class="pure-u-1 pure-u-lg-1-4" name="minOffTime" type="number" min="0" max="60" tabindex="35" data="10" />
  961. </div>
  962. </fieldset>
  963. <fieldset>
  964. <legend>Autonomous mode</legend>
  965. <div class="pure-g">
  966. <label class="pure-u-1 pure-u-lg-1-4" for="aloneOnTime">Heating time (m)</label>
  967. <input class="pure-u-1 pure-u-lg-1-4" name="aloneOnTime" type="number" min="0" max="180" tabindex="36" data="5" />
  968. </div>
  969. <div class="pure-g">
  970. <label class="pure-u-1 pure-u-lg-1-4" for="aloneOffTime">Rest time (m)</label>
  971. <input class="pure-u-1 pure-u-lg-1-4" name="aloneOffTime" type="number" min="0" max="180" tabindex="37" data="55" />
  972. </div>
  973. </fieldset>
  974. <fieldset>
  975. <legend>Time worked</legend>
  976. <div class="pure-g">
  977. <label class="pure-u-1 pure-u-lg-1-4" for="burnToday">Today</label>
  978. <input class="pure-u-1 pure-u-lg-1-4" type="text" name="burnToday" readonly />
  979. </div>
  980. <div class="pure-g">
  981. <label class="pure-u-1 pure-u-lg-1-4" for="burnYesterday">Yesterday</label>
  982. <input class="pure-u-1 pure-u-lg-1-4" type="text" name="burnYesterday" readonly />
  983. </div>
  984. <div class="pure-g">
  985. <label class="pure-u-1 pure-u-lg-1-4" for="burnThisMonth">Current month</label>
  986. <input class="pure-u-1 pure-u-lg-1-4" type="text" name="burnThisMonth" readonly />
  987. </div>
  988. <div class="pure-g">
  989. <label class="pure-u-1 pure-u-lg-1-4" for="burnPrevMonth">Previous month</label>
  990. <input class="pure-u-1 pure-u-lg-1-4" type="text" name="burnPrevMonth" readonly />
  991. </div>
  992. <div class="pure-g">
  993. <label class="pure-u-1 pure-u-lg-1-4" for="burnTotal">Total</label>
  994. <input class="pure-u-1 pure-u-lg-1-4" type="text" name="burnTotal" readonly />
  995. </div>
  996. <div class="pure-g">
  997. <button type="button" class="pure-button button-thermostat-reset-counters">Reset counters</button>
  998. </div>
  999. </fieldset>
  1000. </div>
  1001. </div>
  1002. </form>
  1003. <!-- endRemoveIf(!thermostat) -->
  1004. <form id="form-domoticz" class="pure-form form-settings">
  1005. <div class="panel" id="panel-domoticz">
  1006. <div class="header">
  1007. <h1>DOMOTICZ</h1>
  1008. <h2>
  1009. Configure the connection to your Domoticz server.
  1010. </h2>
  1011. </div>
  1012. <div class="page">
  1013. <fieldset>
  1014. <legend>General</legend>
  1015. <div class="pure-g">
  1016. <label class="pure-u-1 pure-u-lg-1-4">Enable Domoticz</label>
  1017. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="dczEnabled" tabindex="30" /></div>
  1018. </div>
  1019. <div class="pure-g">
  1020. <label class="pure-u-1 pure-u-lg-1-4">Domoticz IN Topic</label>
  1021. <input class="pure-u-1 pure-u-lg-3-4" name="dczTopicIn" type="text" tabindex="31" />
  1022. </div>
  1023. <div class="pure-g">
  1024. <label class="pure-u-1 pure-u-lg-1-4">Domoticz OUT Topic</label>
  1025. <input class="pure-u-1 pure-u-lg-3-4" name="dczTopicOut" type="text" action="reconnect" tabindex="32" />
  1026. </div>
  1027. <legend>Sensors &amp; actuators</legend>
  1028. <div class="pure-g">
  1029. <div class="pure-u-1 hint">Set IDX to 0 to disable notifications from that component.</div>
  1030. </div>
  1031. <div id="dczRelays" class="group-settings" ></div>
  1032. <!-- removeIf(!sensor) -->
  1033. <div id="dczMagnitudes" class="group-settings" ></div>
  1034. <!-- endRemoveIf(!sensor) -->
  1035. </fieldset>
  1036. </div>
  1037. </div>
  1038. </form>
  1039. <form id="form-ha" class="pure-form form-settings">
  1040. <div class="panel" id="panel-ha">
  1041. <div class="header">
  1042. <h1>HOME ASSISTANT</h1>
  1043. <h2>
  1044. Add this device to your Home Assistant.
  1045. </h2>
  1046. </div>
  1047. <div class="page">
  1048. <fieldset>
  1049. <legend>Discover</legend>
  1050. <div class="pure-g">
  1051. <label class="pure-u-1 pure-u-lg-1-4">Discover</label>
  1052. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="haEnabled" tabindex="14" /></div>
  1053. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1054. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1055. <div class="pure-u-1 pure-u-lg-3-4 hint">
  1056. Home Assistant auto-discovery feature. Enable and save to add the device to your HA console.
  1057. </div>
  1058. </div>
  1059. <div class="pure-g">
  1060. <label class="pure-u-1 pure-u-lg-1-4">Prefix</label>
  1061. <input class="pure-u-1 pure-u-lg-1-4" name="haPrefix" type="text" tabindex="15" />
  1062. </div>
  1063. <legend>Configuration</legend>
  1064. <div class="pure-g">
  1065. <label class="pure-u-1 pure-u-lg-1-4">Configuration</label>
  1066. <div class="pure-u-1-4 pure-u-lg-3-4"><button type="button" class="pure-button button-ha-config pure-u-1-3">Show</button></div>
  1067. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1068. <div class="pure-u-1 pure-u-lg-3-4 hint">
  1069. These are the settings you should copy to your Home Assistant "configuration.yaml" file.
  1070. If any of the sections below (switch, light, sensor) already exists, do not duplicate it,
  1071. simply copy the contents of the section below the ones already present.
  1072. </div>
  1073. </div>
  1074. <div class="pure-g">
  1075. <textarea class="pure-u-1 terminal" id="haConfig" name="haConfig" wrap="off" readonly></textarea>
  1076. </div>
  1077. </fieldset>
  1078. </div>
  1079. </div>
  1080. </form>
  1081. <form id="form-thingspeak" class="pure-form form-settings">
  1082. <div class="panel" id="panel-thingspeak">
  1083. <div class="header">
  1084. <h1>THINGSPEAK</h1>
  1085. <h2>
  1086. Send your sensors data to Thingspeak.
  1087. </h2>
  1088. </div>
  1089. <div class="page">
  1090. <fieldset>
  1091. <legend>General</legend>
  1092. <div class="pure-g">
  1093. <label class="pure-u-1 pure-u-lg-1-4">Enable Thingspeak</label>
  1094. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="tspkEnabled" tabindex="30" /></div>
  1095. </div>
  1096. <div class="pure-g">
  1097. <label class="pure-u-1 pure-u-lg-1-4">Clear cache</label>
  1098. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="tspkClear" tabindex="31" /></div>
  1099. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1100. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1101. <div class="pure-u-1 pure-u-lg-3-4 hint">
  1102. With every POST to thinkspeak.com only enqueued fields are sent.
  1103. If you select to clear the cache after every sending this will result in only those fields that have changed will be posted.
  1104. If you want all fields to be sent with every POST do not clear the cache.
  1105. </div>
  1106. </div>
  1107. <div class="pure-g">
  1108. <label class="pure-u-1 pure-u-lg-1-4">Thingspeak address</label>
  1109. <input class="pure-u-1 pure-u-lg-3-4" name="tspkAddress" type="text" tabindex="32" />
  1110. </div>
  1111. <div class="pure-g">
  1112. <label class="pure-u-1 pure-u-lg-1-4">Thingspeak API Key</label>
  1113. <input class="pure-u-1 pure-u-lg-3-4" name="tspkKey" type="text" tabindex="33" />
  1114. </div>
  1115. <legend>Sensors &amp; actuators</legend>
  1116. <div class="pure-g">
  1117. <div class="pure-u-1 hint">Enter the field number to send each data to, 0 disable notifications from that component.</div>
  1118. </div>
  1119. <div id="tspkRelays" class="group-settings" ></div>
  1120. <!-- removeIf(!sensor) -->
  1121. <div id="tspkMagnitudes" class="group-settings" ></div>
  1122. <!-- endRemoveIf(!sensor) -->
  1123. </fieldset>
  1124. </div>
  1125. </div>
  1126. </form>
  1127. <form id="form-idb" class="pure-form form-settings">
  1128. <div class="panel" id="panel-idb">
  1129. <div class="header">
  1130. <h1>INFLUXDB</h1>
  1131. <h2>
  1132. Configure the connection to your InfluxDB server. Leave the host field empty to disable InfluxDB connection.
  1133. </h2>
  1134. </div>
  1135. <div class="page">
  1136. <fieldset>
  1137. <div class="pure-g">
  1138. <label class="pure-u-1 pure-u-lg-1-4">Enable InfluxDB</label>
  1139. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="idbEnabled" tabindex="40" /></div>
  1140. </div>
  1141. <div class="pure-g">
  1142. <label class="pure-u-1 pure-u-lg-1-4">Host</label>
  1143. <input class="pure-u-1 pure-u-lg-3-4" name="idbHost" type="text" tabindex="41" />
  1144. </div>
  1145. <div class="pure-g">
  1146. <label class="pure-u-1 pure-u-lg-1-4">Port</label>
  1147. <input class="pure-u-1 pure-u-lg-3-4" name="idbPort" type="text" tabindex="42" />
  1148. </div>
  1149. <div class="pure-g">
  1150. <label class="pure-u-1 pure-u-lg-1-4">Database</label>
  1151. <input class="pure-u-1 pure-u-lg-3-4" name="idbDatabase" type="text" tabindex="43" />
  1152. </div>
  1153. <div class="pure-g">
  1154. <label class="pure-u-1 pure-u-lg-1-4">Username</label>
  1155. <input class="pure-u-1 pure-u-lg-3-4" name="idbUsername" type="text" tabindex="44" autocomplete="off" />
  1156. </div>
  1157. <div class="pure-g">
  1158. <label class="pure-u-1 pure-u-lg-1-4">Password</label>
  1159. <input class="pure-u-1 pure-u-lg-3-4" name="idbPassword" type="password" tabindex="45" autocomplete="new-password" spellcheck="false" />
  1160. <span class="no-select password-reveal"></span>
  1161. </div>
  1162. </fieldset>
  1163. </div>
  1164. </div>
  1165. </form>
  1166. <form id="form-rpn" class="pure-form form-settings">
  1167. <div class="panel" id="panel-rpn">
  1168. <div class="header">
  1169. <h1>RULES</h1>
  1170. <h2>
  1171. Here you can configure advanced rules based on RPN expressions. Check the <a href="https://github.com/xoseperez/espurna/wiki/RPN-Rules" rel="noopener" target="_blank">wiki page about the RPN Rules module</a> to know how to use them.
  1172. </h2>
  1173. </div>
  1174. <div class="page">
  1175. <fieldset>
  1176. <legend>Configuration</legend>
  1177. <div class="pure-g">
  1178. <label class="pure-u-1 pure-u-lg-1-4">Sticky variables</label>
  1179. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="rpnSticky" tabindex="100" /></div>
  1180. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1181. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1182. <div class="pure-u-1 pure-u-lg-3-4 hint">
  1183. Sticky variables are persistent, once defined the first time they will be always available until next reboot (they do not persist across reboots).
  1184. Non sticky variables are only available during the next rule execution, just after being defined, and then removed. This applies to status, sensor and MQTT variables equally.
  1185. Mind that calling a non-existing variable from a rule will make it silently fail.
  1186. </div>
  1187. </div>
  1188. <div class="pure-g">
  1189. <label class="pure-u-1 pure-u-lg-1-4" for="rpnDelay">Execution delay (ms)</label>
  1190. <input class="pure-u-1 pure-u-lg-1-4" name="rpnDelay" type="number" min="100" tabindex="101" />
  1191. </div>
  1192. <legend>Rules</legend>
  1193. <div id="rpnRules" class="group-settings" data-settings-target="rpnRule" ></div>
  1194. <button type="button" class="pure-button button-add-rpnrule">Add</button>
  1195. <legend>MQTT</legend>
  1196. <div class="pure-g">
  1197. <div class="pure-u-1-2">MQTT Topic</div>
  1198. <div class="pure-u-1-3">Variable Name</div>
  1199. </div>
  1200. <div id="rpnTopics" class="group-settings" data-settings-target="rpnTopic" ></div>
  1201. <button type="button" class="pure-button button-add-rpntopic">Add</button>
  1202. </fieldset>
  1203. </div>
  1204. </div>
  1205. </form>
  1206. <form id="form-dbg" class="pure-form">
  1207. <div class="panel" id="panel-dbg">
  1208. <div class="header">
  1209. <h1>DEBUG LOG</h1>
  1210. <h2>
  1211. Shows debug messages from the device
  1212. </h2>
  1213. </div>
  1214. <div class="page">
  1215. <fieldset>
  1216. <div class="pure-g module module-cmd">
  1217. <div class="pure-u-1 hint">
  1218. Write a command and click send to execute it on the device. The output will be shown in the debug text area below.
  1219. <!-- removeIf(!curtain) -->
  1220. Type "debug" to display MCU serial exchanges. Any other command is sent to MCU serial as is.
  1221. <!-- endRemoveIf(!curtain) -->
  1222. </div>
  1223. <input name="dbgcmd" class="pure-u-3-4" type="text" tabindex="2" />
  1224. <div class="pure-u-1-4 pure-u-lg-1-4"><button type="button" class="pure-button button-dbgcmd pure-u-23-24">Send</button></div>
  1225. </div>
  1226. <div class="pure-g">
  1227. <textarea class="pure-u-1 terminal" id="weblog" name="weblog" wrap="off" readonly></textarea>
  1228. <div class="pure-u-1-4 pure-u-lg-1-4"><button type="button" class="pure-button button-dbg-clear pure-u-23-24">Clear</button></div>
  1229. </div>
  1230. </fieldset>
  1231. </div>
  1232. </div>
  1233. </form>
  1234. <!-- removeIf(!sensor) -->
  1235. <form id="form-sns" class="pure-form form-settings">
  1236. <div class="panel" id="panel-sns">
  1237. <div class="header">
  1238. <h1>SENSOR CONFIGURATION</h1>
  1239. <h2>
  1240. Configure and calibrate your device sensors.
  1241. </h2>
  1242. </div>
  1243. <div class="page">
  1244. <fieldset>
  1245. <legend>General</legend>
  1246. <div class="pure-g">
  1247. <label class="pure-u-1 pure-u-lg-1-4">Read interval</label>
  1248. <select class="pure-u-1 pure-u-lg-1-4" name="snsRead">
  1249. <option value="1">1 second</option>
  1250. <option value="6">6 seconds</option>
  1251. <option value="10">10 seconds</option>
  1252. <option value="15">15 seconds</option>
  1253. <option value="30">30 seconds</option>
  1254. <option value="60">1 minute</option>
  1255. <option value="300">5 minutes</option>
  1256. <option value="600">10 minutes</option>
  1257. <option value="900">15 minutes</option>
  1258. <option value="1800">30 minutes</option>
  1259. <option value="3600">60 minutes</option>
  1260. </select>
  1261. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1262. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1263. <div class="pure-u-1 pure-u-lg-3-4 hint">
  1264. Select the interval between readings. These will be filtered and averaged for the report.
  1265. Please mind some sensors do not have fast refresh intervals. Check the sensor datasheet to know the minimum read interval.
  1266. The default and recommended value is 6 seconds.
  1267. </div>
  1268. </div>
  1269. <div class="pure-g">
  1270. <label class="pure-u-1 pure-u-lg-1-4">Report every</label>
  1271. <div class="pure-u-1 pure-u-lg-1-4"><input name="snsReport" class="pure-u-1" type="number" min="1" step="1" max="60" /></div>
  1272. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1273. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1274. <div class="pure-u-1 pure-u-lg-3-4 hint">
  1275. Select the number of readings to average and report
  1276. </div>
  1277. </div>
  1278. <div class="pure-g module module-pwr">
  1279. <label class="pure-u-1 pure-u-lg-1-4">Save every</label>
  1280. <div class="pure-u-1 pure-u-lg-1-4"><input name="snsSave" class="pure-u-1" type="number" min="0" step="1" max="200" /></div>
  1281. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1282. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1283. <div class="pure-u-1 pure-u-lg-3-4 hint">
  1284. Save aggregated data to EEPROM after these many reports. At the moment this only applies to total energy readings.
  1285. Please mind: saving data to EEPROM too often will wear out the flash memory quickly.
  1286. Set it to 0 to disable this feature (default value).
  1287. </div>
  1288. </div>
  1289. <div class="pure-g module module-pwr">
  1290. <label class="pure-u-1 pure-u-lg-1-4">Power units</label>
  1291. <select name="pwrUnits" tabindex="16" class="pure-u-1 pure-u-lg-1-4">
  1292. <option value="13">Watts (W)</option>
  1293. <option value="14">Kilowatts (kW)</option>
  1294. </select>
  1295. </div>
  1296. <div class="pure-g module module-pwr">
  1297. <label class="pure-u-1 pure-u-lg-1-4">Energy units</label>
  1298. <select name="eneUnits" tabindex="16" class="pure-u-1 pure-u-lg-1-4">
  1299. <option value="15">Joules (J)</option>
  1300. <option value="16">Kilowatts·hour (kWh)</option>
  1301. </select>
  1302. </div>
  1303. <div class="pure-g module module-temperature">
  1304. <label class="pure-u-1 pure-u-lg-1-4">Temperature units</label>
  1305. <select name="tmpUnits" tabindex="16" class="pure-u-1 pure-u-lg-1-4">
  1306. <option value="2">Celsius (&deg;C)</option>
  1307. <option value="3">Fahrenheit (&deg;F)</option>
  1308. <option value="4">Kelvin (K)</option>
  1309. </select>
  1310. </div>
  1311. <div class="pure-g module module-temperature">
  1312. <label class="pure-u-1 pure-u-lg-1-4">Temperature correction</label>
  1313. <input name="tmpCorrection" class="pure-u-1 pure-u-lg-1-4" type="number" action="reboot" min="-100" step="0.1" max="100" tabindex="18" />
  1314. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1315. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1316. <div class="pure-u-1 pure-u-lg-3-4 hint">
  1317. Temperature correction value is added to the measured value which may be inaccurate due to many factors. The value can be negative.
  1318. </div>
  1319. </div>
  1320. <div class="pure-g module module-humidity">
  1321. <label class="pure-u-1 pure-u-lg-1-4">Humidity correction</label>
  1322. <input name="humCorrection" class="pure-u-1 pure-u-lg-1-4" type="number" action="reboot" min="-100" step="0.1" max="100" tabindex="18" />
  1323. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1324. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1325. <div class="pure-u-1 pure-u-lg-3-4 hint">
  1326. Humidity correction value is added to the measured value which may be inaccurate due to many factors. The value can be negative.
  1327. </div>
  1328. </div>
  1329. <div class="pure-g module module-mics">
  1330. <label class="pure-u-1 pure-u-lg-1-4">Calibrate gas sensor</label>
  1331. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="snsResetCalibration" tabindex="55" /></div>
  1332. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1333. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1334. <div class="pure-u-1 pure-u-lg-3-4 hint">Move this switch to ON and press "Save" to reset gas sensor calibration. Check the sensor datasheet for calibration conditions.</div>
  1335. </div>
  1336. <legend class="module module-hlw module-cse module-emon">Energy monitor</legend>
  1337. <div class="pure-g module module-emon">
  1338. <label class="pure-u-1 pure-u-lg-1-4">Voltage</label>
  1339. <input class="pure-u-1 pure-u-lg-3-4" name="pwrVoltage" type="text" tabindex="51" />
  1340. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1341. <div class="pure-u-1 pure-u-lg-3-4 hint">Mains voltage in your system (in V).</div>
  1342. </div>
  1343. <div class="pure-g module module-hlw module-cse">
  1344. <label class="pure-u-1 pure-u-lg-1-4">Expected Current</label>
  1345. <input class="pure-u-1 pure-u-lg-3-4 pwrExpected" name="pwrExpectedC" type="text" tabindex="52" placeholder="0" />
  1346. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1347. <div class="pure-u-1 pure-u-lg-3-4 hint">In Amperes (A). If you are using a pure resistive load like a bulb, this will be the ratio between the two previous values, i.e. power / voltage. You can also use a current clamp around one of the power wires to get this value.</div>
  1348. </div>
  1349. <div class="pure-g module module-hlw module-cse">
  1350. <label class="pure-u-1 pure-u-lg-1-4">Expected Voltage</label>
  1351. <input class="pure-u-1 pure-u-lg-3-4 pwrExpected" name="pwrExpectedV" type="text" tabindex="53" placeholder="0" />
  1352. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1353. <div class="pure-u-1 pure-u-lg-3-4 hint">In Volts (V). Enter your the nominal AC voltage for your household or facility, or use multimeter to get this value.</div>
  1354. </div>
  1355. <div class="pure-g module module-hlw module-cse module-emon">
  1356. <label class="pure-u-1 pure-u-lg-1-4">Expected Power</label>
  1357. <input class="pure-u-1 pure-u-lg-3-4 pwrExpected" name="pwrExpectedP" type="text" tabindex="54" placeholder="0" />
  1358. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1359. <div class="pure-u-1 pure-u-lg-3-4 hint">In Watts (W). Calibrate your sensor connecting a pure resistive load (like a bulb) and enter here its nominal power or use a multimeter.</div>
  1360. </div>
  1361. <div class="pure-g module module-pm">
  1362. <label class="pure-u-1 pure-u-lg-1-4">Energy Ratio</label>
  1363. <input class="pure-u-1 pure-u-lg-3-4" name="pwrRatioE" type="text" tabindex="55" placeholder="0" />
  1364. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1365. <div class="pure-u-1 pure-u-lg-3-4 hint">Energy ratio in pulses/kWh.</div>
  1366. </div>
  1367. <div class="pure-g module module-hlw module-cse module-emon">
  1368. <label class="pure-u-1 pure-u-lg-1-4">Reset calibration</label>
  1369. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="pwrResetCalibration" tabindex="56" /></div>
  1370. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1371. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1372. <div class="pure-u-1 pure-u-lg-3-4 hint">Move this switch to ON and press "Save" to revert to factory calibration values.</div>
  1373. </div>
  1374. <div class="pure-g module module-hlw module-cse module-emon module-pm">
  1375. <label class="pure-u-1 pure-u-lg-1-4">Reset energy</label>
  1376. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="pwrResetE" tabindex="57" /></div>
  1377. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1378. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1379. <div class="pure-u-1 pure-u-lg-3-4 hint">Move this switch to ON and press "Save" to set energy count to 0.</div>
  1380. </div>
  1381. </fieldset>
  1382. </div>
  1383. </div>
  1384. </form>
  1385. <!-- endRemoveIf(!sensor) -->
  1386. <!-- removeIf(!rfbridge) -->
  1387. <form id="form-rfb" class="pure-form form-settings">
  1388. <div class="panel" id="panel-rfb">
  1389. <div class="header">
  1390. <h1>RADIO FREQUENCY</h1>
  1391. <h2>
  1392. Sonoff 433 RF Bridge &amp; RF Link Configuration<br /><br />
  1393. This page allows you to configure the RF codes for the Sonoff RFBridge 433 and also for a basic RF receiver.<br /><br />
  1394. To learn a new code click <strong>LEARN</strong> (the Sonoff RFBridge will beep) then press a button on the remote, the new code should show up (and the RFBridge will double beep). If the device double beeps but the code does not update it has not been properly learnt. Keep trying.<br /><br />
  1395. Modify or create new codes manually and then click <strong>SAVE</strong> to store them in the device memory. If your controlled device uses the same code to switch ON and OFF, learn the code with the ON button and copy paste it to the OFF input box, then click SAVE on the last one to store the value.<br /><br />
  1396. Delete any code clicking the <strong>FORGET</strong> button.
  1397. <br /><br />You can also specify any RAW code. For reference see <a rel="noopener" target="_blank" href="https://github.com/Portisch/RF-Bridge-EFM8BB1/wiki/Commands">possible commands for Sonoff RF Bridge EFM8BB1</a> (original firmware supports codes from <strong>0xA0</strong> to <strong>0xA5</strong>).
  1398. </h2>
  1399. </div>
  1400. <div class="page">
  1401. <fieldset>
  1402. <legend>RF Codes</legend>
  1403. <div id="rfbNodes"></div>
  1404. <legend>Settings</legend>
  1405. <div class="pure-g">
  1406. <label class="pure-u-1 pure-u-lg-1-4">Repeats</label>
  1407. <div class="pure-u-1 pure-u-lg-1-4"><input class="pure-u-1 pure-u-lg-23-24" name="rfbRepeat" type="number" min="1" tabindex="0" /></div>
  1408. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1409. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1410. <div class="pure-u-1 pure-u-lg-3-4 hint">Number of times to repeat transmission</div>
  1411. </div>
  1412. <div class="pure-g module module-rfbdirect">
  1413. <legend>GPIO</legend>
  1414. <div class="pure-u-1 pure-u-lg-1 hint">Pins used by the receiver (RX) and transmitter (TX). Set to <strong>NONE</strong> to disable</div>
  1415. <label class="pure-u-1 pure-u-lg-1-4">RX Pin</label>
  1416. <select class="pure-u-1 pure-u-lg-1-4 gpio-select" name="rfbRX"></select>
  1417. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1418. <label class="pure-u-1 pure-u-lg-1-4">TX Pin</label>
  1419. <select class="pure-u-1 pure-u-lg-1-4 gpio-select" name="rfbTX"></select>
  1420. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1421. </div>
  1422. </fieldset>
  1423. </div>
  1424. </div>
  1425. </form>
  1426. <!-- endRemoveIf(!rfbridge) -->
  1427. <!-- removeIf(!lightfox) -->
  1428. <form id="form-lightfox" class="pure-form form-settings">
  1429. <div class="panel" id="panel-lightfox">
  1430. <div class="header">
  1431. <h1>LIGHTFOX RF</h1>
  1432. <h2>
  1433. LightFox RF configuration<br /><br />
  1434. This page allows you to control LightFox RF receiver options.<br /><br />
  1435. To learn a new code click <strong>LEARN</strong>, wait for 3 seconds then press a button on the remote, one of the relays will toggle. If no device relay toggles the code has not been properly learnt. Keep trying.<br /><br />
  1436. Delete all the codes by clicking the <strong>CLEAR</strong> button and wait for 10 seconds.<br /><br />
  1437. You can also specify which RF button controls which relay using controls below.
  1438. </h2>
  1439. </div>
  1440. <div class="page">
  1441. <div class="pure-g">
  1442. <label class="pure-u-1 pure-u-lg-1-4">RF Actions</label>
  1443. <div class="pure-u-1-2 pure-u-lg-3-8"><button type="button" class="pure-button button-lightfox-learn pure-u-23-24">Learn</button></div>
  1444. <div class="pure-u-1-2 pure-u-lg-3-8"><button type="button" class="pure-button button-lightfox-clear pure-u-1">Clear</button></div>
  1445. </div>
  1446. <fieldset id="lightfoxNodes"></fieldset>
  1447. </div>
  1448. </div>
  1449. </form>
  1450. <!-- endRemoveIf(!lightfox) -->
  1451. </div> <!-- content -->
  1452. </div> <!-- layout -->
  1453. <!-- Templates -->
  1454. <div id="ledConfigTemplate" class="template">
  1455. <div class="pure-form pure-form-aligned">
  1456. <legend class="pure-u-1 pure-u-lg-1-4">LED #<span class="id"></span></legend>
  1457. <div class="pure-control-group">
  1458. <label>GPIO</label>
  1459. <select class="pure-input-2-3 gpio-select" name="ledGPIO" action="reboot"></select>
  1460. </div>
  1461. <div class="pure-control-group">
  1462. <label>Mode</label>
  1463. <select class="pure-input-2-3" name="ledMode">
  1464. <option value="1">WiFi status</option>
  1465. <option value="2">Follow switch #</option>
  1466. <option value="3">Inverse switch #</option>
  1467. <option value="4">Find me</option>
  1468. <option value="5">Find me &amp; WiFi</option>
  1469. <option value="8">Switches status</option>
  1470. <option value="9">Switches &amp; WiFi</option>
  1471. <option value="0">Manual</option>
  1472. <option value="6">Always ON</option>
  1473. <option value="7">Always OFF</option>
  1474. </select>
  1475. </div>
  1476. <div class="pure-control-group">
  1477. <label>Relay ID</label>
  1478. <input class="pure-input-2-3" name="ledRelay" type="number" min="0" data="0"></input>
  1479. </div>
  1480. </div>
  1481. </div>
  1482. <!-- removeIf(!rfbridge) -->
  1483. <div id="rfbNodeTemplate" class="template">
  1484. <legend>Switch #<span></span></legend>
  1485. <div class="pure-g">
  1486. <div class="pure-u-1 pure-u-lg-1-4"><label>Switch ON</label></div>
  1487. <input class="pure-u-1 pure-u-lg-1-3" type="text" maxlength="116" name="rfbcode" data-status="1" data-settings-ignore="true" />
  1488. <div class="pure-u-1-3 pure-u-lg-1-8"><button type="button" class="pure-u-23-24 pure-button button-rfb-learn">LEARN</button></div>
  1489. <div class="pure-u-1-3 pure-u-lg-1-8"><button type="button" class="pure-u-23-24 pure-button button-rfb-send">SAVE</button></div>
  1490. <div class="pure-u-1-3 pure-u-lg-1-8"><button type="button" class="pure-u-23-24 pure-button button-rfb-forget">FORGET</button></div>
  1491. </div>
  1492. <div class="pure-g">
  1493. <div class="pure-u-1 pure-u-lg-1-4"><label>Switch OFF</label></div>
  1494. <input class="pure-u-1 pure-u-lg-1-3" type="text" maxlength="116" name="rfbcode" data-status="0" data-settings-ignore="true" />
  1495. <div class="pure-u-1-3 pure-u-lg-1-8"><button type="button" class="pure-u-23-24 pure-button button-rfb-learn">LEARN</button></div>
  1496. <div class="pure-u-1-3 pure-u-lg-1-8"><button type="button" class="pure-u-23-24 pure-button button-rfb-send">SAVE</button></div>
  1497. <div class="pure-u-1-3 pure-u-lg-1-8"><button type="button" class="pure-u-23-24 pure-button button-rfb-forget">FORGET</button></div>
  1498. </div>
  1499. </div>
  1500. <!-- endRemoveIf(!rfbridge) -->
  1501. <!-- removeIf(!lightfox) -->
  1502. <div id="lightfoxNodeTemplate" class="template">
  1503. <div class="pure-g">
  1504. <label class="pure-u-1 pure-u-lg-1-4">Button #<span></span></label>
  1505. <select class="pure-u-1 pure-u-lg-3-4" name="btnRelay" action="reboot"></select>
  1506. </div>
  1507. </div>
  1508. <!-- endRemoveIf(!lightfox) -->
  1509. <div id="networkTemplate" class="template">
  1510. <div class="pure-g">
  1511. <label class="pure-u-1 pure-u-lg-1-4">Network SSID</label>
  1512. <div class="pure-u-5-6 pure-u-lg-2-3"><input name="ssid" type="text" action="reconnect" class="pure-u-23-24" value="" tabindex="0" placeholder="Network SSID" required autocomplete="false" /></div>
  1513. <div class="pure-u-1-6 pure-u-lg-1-12"><button type="button" class="pure-button button-more-network pure-u-1">...</button></div>
  1514. <label class="pure-u-1 pure-u-lg-1-4 more">Password</label>
  1515. <input class="pure-u-1 pure-u-lg-3-4 more" name="pass" type="password" action="reconnect" value="" tabindex="0" autocomplete="new-password" spellcheck="false" />
  1516. <span class="no-select password-reveal more"></span>
  1517. <label class="pure-u-1 pure-u-lg-1-4 more">Static IP</label>
  1518. <input class="pure-u-1 pure-u-lg-3-4 more" name="ip" type="text" action="reconnect" value="" maxlength="15" tabindex="0" autocomplete="false" />
  1519. <div class="pure-u-0 pure-u-lg-1-4 more"></div>
  1520. <div class="pure-u-1 pure-u-lg-3-4 hint more">Leave empty for DHCP negotiation</div>
  1521. <label class="pure-u-1 pure-u-lg-1-4 more">Gateway IP</label>
  1522. <input class="pure-u-1 pure-u-lg-3-4 more" name="gw" type="text" action="reconnect" value="" maxlength="15" tabindex="0" autocomplete="false" />
  1523. <div class="pure-u-0 pure-u-lg-1-4 more"></div>
  1524. <div class="pure-u-1 pure-u-lg-3-4 hint more">Set when using a static IP</div>
  1525. <label class="pure-u-1 pure-u-lg-1-4 more">Network Mask</label>
  1526. <input class="pure-u-1 pure-u-lg-3-4 more" name="mask" type="text" action="reconnect" value="" maxlength="15" tabindex="0" autocomplete="false" />
  1527. <div class="pure-u-0 pure-u-lg-1-4 more"></div>
  1528. <div class="pure-u-1 pure-u-lg-3-4 hint more">Usually 255.255.255.0 for /24 networks</div>
  1529. <label class="pure-u-1 pure-u-lg-1-4 more">DNS IP</label>
  1530. <input class="pure-u-1 pure-u-lg-3-4 more" name="dns" type="text" action="reconnect" value="" maxlength="15" tabindex="0" autocomplete="false" />
  1531. <div class="pure-u-0 pure-u-lg-1-4 more"></div>
  1532. <div class="pure-u-1 pure-u-lg-3-4 hint more">Set the Domain Name Server IP to use when using a static IP</div>
  1533. <div class="pure-u-0 pure-u-lg-1-4 more"></div>
  1534. <button class="pure-button button-del-network more" type="button">Delete network</button>
  1535. </div>
  1536. </div>
  1537. <div id="scheduleTemplate" class="template">
  1538. <div class="pure-g">
  1539. <label class="pure-u-1 pure-u-lg-1-4">When time is</label>
  1540. <div class="pure-u-1-4 pure-u-lg-1-5">
  1541. <input class="pure-u-2-3" name="schHour" type="number" min="0" step="1" max="23" value="0" />
  1542. <div class="pure-u-1-4 hint center">&nbsp;h</div>
  1543. </div>
  1544. <div class="pure-u-1-4 pure-u-lg-1-5">
  1545. <input class="pure-u-2-3" name="schMinute" type="number" min="0" step="1" max="59" value="0" />
  1546. <div class="pure-u-1-4 hint center">&nbsp;m</div>
  1547. </div>
  1548. <div class="pure-u-0 pure-u-lg-1-3"></div>
  1549. <label class="pure-u-1 pure-u-lg-1-4">Use UTC time</label>
  1550. <div class="pure-u-1 pure-u-lg-3-4"><input type="checkbox" name="schUTC" /></div>
  1551. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1552. <label class="pure-u-1 pure-u-lg-1-4">And weekday is one of</label>
  1553. <div class="pure-u-2-5 pure-u-lg-1-5">
  1554. <input class="pure-u-23-24 pure-u-lg-23-24" name="schWDs" type="text" maxlength="15" tabindex="0" value="1,2,3,4,5,6,7" />
  1555. </div>
  1556. <div class="pure-u-3-5 pure-u-lg-1-2 hint center">&nbsp;1 for Monday, 2 for Tuesday etc., comma separated</div>
  1557. <div id="schActionDiv" class="pure-u-1">
  1558. </div>
  1559. <label class="pure-u-1 pure-u-lg-1-4">Enabled</label>
  1560. <div class="pure-u-1 pure-u-lg-3-4"><input type="checkbox" name="schEnabled" /></div>
  1561. <div class="pure-u-1 pure-u-lg-1-2"></div>
  1562. <button class="pure-button button-del-schedule" type="button">Delete schedule</button>
  1563. </div>
  1564. </div>
  1565. <div id="switchActionTemplate" class="template">
  1566. <label class="pure-u-1 pure-u-lg-1-4">Action</label>
  1567. <div class="pure-u-1 pure-u-lg-1-5">
  1568. <select class="pure-u-1 pure-u-lg-23-24" name="schAction" haschanged="true">
  1569. <option value="0">Turn OFF</option>
  1570. <option value="1">Turn ON</option>
  1571. <option value="2">Toggle</option>
  1572. </select>
  1573. </div>
  1574. <select class="pure-u-1 pure-u-lg-1-5 isrelay" name="schSwitch" ></select>
  1575. <input type="hidden" name="schType" value="1">
  1576. </div>
  1577. <!-- removeIf(!light) -->
  1578. <div id="lightActionTemplate" class="template">
  1579. <label class="pure-u-1 pure-u-lg-1-4">Brightness</label>
  1580. <div class="pure-u-1 pure-u-lg-1-5">
  1581. <input class="pure-u-2-3" name="schAction" type="number" min="0" step="1" max="255" value="0" />
  1582. </div>
  1583. <select class="pure-u-1 pure-u-lg-1-5 islight" name="schSwitch" ></select>
  1584. <input type="hidden" name="schType" value="2">
  1585. </div>
  1586. <!-- endRemoveIf(!light) -->
  1587. <!-- removeIf(!curtain) -->
  1588. <div id="curtainActionTemplate" class="template">
  1589. <label class="pure-u-1 pure-u-lg-1-4">Curtain position (0 = open to 100 = closed)</label>
  1590. <div class="pure-u-1 pure-u-lg-1-5">
  1591. <input class="pure-u-2-3" name="schAction" type="number" min="0" step="1" max="100" value="0" />
  1592. </div>
  1593. <select class="pure-u-1 pure-u-lg-1-5 iscurtain" name="schSwitch" ></select>
  1594. <input type="hidden" name="schType" value="3">
  1595. </div>
  1596. <!-- endRemoveIf(!curtain) -->
  1597. <div id="relayTemplate" class="template">
  1598. <div class="pure-g">
  1599. <label class="pure-u-1 pure-u-lg-1-4">Switch #<span class="id"></span></label>
  1600. <div><input name="relay" type="checkbox" on="ON" off="OFF" /></div>
  1601. </div>
  1602. </div>
  1603. <div id="relayConfigTemplate" class="template">
  1604. <legend>Switch #<span class="id"></span> (<span class="gpio"></span>)</legend>
  1605. <div class="pure-g">
  1606. <div class="pure-u-1 pure-u-lg-1-4"><label>Boot mode</label></div>
  1607. <select class="pure-u-1 pure-u-lg-3-4" name="relayBoot">
  1608. <option value="0">Always OFF</option>
  1609. <option value="1">Always ON</option>
  1610. <option value="2">Same as before</option>
  1611. <option value="3">Toggle before</option>
  1612. <option value="4">Locked OFF</option>
  1613. <option value="5">Locked ON</option>
  1614. </select>
  1615. </div>
  1616. <div class="pure-g">
  1617. <div class="pure-u-1 pure-u-lg-1-4"><label>Pulse mode</label></div>
  1618. <select class="pure-u-1 pure-u-lg-3-4" name="relayPulse">
  1619. <option value="0">Don't pulse</option>
  1620. <option value="1">Normally OFF</option>
  1621. <option value="2">Normally ON</option>
  1622. </select>
  1623. </div>
  1624. <div class="pure-g">
  1625. <div class="pure-u-1 pure-u-lg-1-4"><label>Pulse time (s)</label></div>
  1626. <div class="pure-u-1 pure-u-lg-1-4"><input name="relayTime" class="pure-u-1" type="number" min="0" step="0.1" max="3600" /></div>
  1627. </div>
  1628. <div class="pure-g module module-sch">
  1629. <div class="pure-u-1 pure-u-lg-1-4"><label>Restore last schedule</label></div>
  1630. <div><input name="relayLastSch" data-settings-real-name="relayLastSch" type="checkbox" /></div>
  1631. </div>
  1632. <div class="pure-g module module-mqtt">
  1633. <div class="pure-u-1 pure-u-lg-1-4"><label>MQTT group</label></div>
  1634. <div class="pure-u-1 pure-u-lg-3-4"><input name="mqttGroup" class="pure-u-1" tabindex="0" data="0" action="reconnect" /></div>
  1635. </div>
  1636. <div class="pure-g module module-mqtt">
  1637. <div class="pure-u-1 pure-u-lg-1-4"><label>MQTT group sync</label></div>
  1638. <select class="pure-u-1 pure-u-lg-3-4" name="mqttGroupSync">
  1639. <option value="0">Same</option>
  1640. <option value="1">Inverse</option>
  1641. <option value="2">Receive Only</option>
  1642. </select>
  1643. </div>
  1644. <div class="pure-g module module-mqtt">
  1645. <div class="pure-u-1 pure-u-lg-1-4"><label>On MQTT disconnect</label></div>
  1646. <select class="pure-u-1 pure-u-lg-3-4" name="relayOnDisc">
  1647. <option value="0">Don't change</option>
  1648. <option value="1">Turn the switch OFF</option>
  1649. <option value="2">Turn the switch ON</option>
  1650. </select>
  1651. </div>
  1652. </div>
  1653. <div id="dczRelayTemplate" class="template">
  1654. <div class="pure-g">
  1655. <label class="pure-u-1 pure-u-lg-1-4">Switch</label>
  1656. <div class="pure-u-1 pure-u-lg-1-4"><input class="pure-u-1 pure-u-lg-23-24 dczRelayIdx" name="dczRelayIdx" type="number" min="0" tabindex="0" data="0" /></div>
  1657. </div>
  1658. </div>
  1659. <!-- removeIf(!sensor) -->
  1660. <div id="dczMagnitudeTemplate" class="template">
  1661. <div class="pure-g">
  1662. <label class="pure-u-1 pure-u-lg-1-4">Magnitude</label>
  1663. <div class="pure-u-1 pure-u-lg-1-4"><input class="pure-u-1 pure-u-lg-23-24 center" name="dczMagnitude" type="number" min="0" tabindex="0" data="0" /></div>
  1664. <div class="pure-u-1 pure-u-lg-1-2 hint center"></div>
  1665. </div>
  1666. </div>
  1667. <!-- endRemoveIf(!sensor) -->
  1668. <div id="tspkRelayTemplate" class="template">
  1669. <div class="pure-g">
  1670. <label class="pure-u-1 pure-u-lg-1-4">Switch</label>
  1671. <div class="pure-u-1 pure-u-lg-1-4"><input class="pure-u-1 pure-u-lg-23-24" name="tspkRelay" type="number" min="0" max="8" tabindex="0" data="0" /></div>
  1672. </div>
  1673. </div>
  1674. <!-- removeIf(!sensor) -->
  1675. <div id="tspkMagnitudeTemplate" class="template">
  1676. <div class="pure-g">
  1677. <label class="pure-u-1 pure-u-lg-1-4">Magnitude</label>
  1678. <div class="pure-u-1 pure-u-lg-1-4"><input class="pure-u-1 pure-u-lg-23-24 center" name="tspkMagnitude" type="number" min="0" max="8" tabindex="0" data="0" /></div>
  1679. <div class="pure-u-1 pure-u-lg-1-2 hint center"></div>
  1680. </div>
  1681. </div>
  1682. <!-- endRemoveIf(!sensor) -->
  1683. <!-- removeIf(!light) -->
  1684. <div id="colorTemplate" class="template">
  1685. <div class="pure-g">
  1686. <label class="pure-u-1 pure-u-lg-1-4">Color</label>
  1687. <input class="pure-u-1 pure-u-lg-1-4" data-wcp-layout="block" name="color" readonly />
  1688. </div>
  1689. </div>
  1690. <div id="brightnessTemplate" class="template">
  1691. <div class="pure-g">
  1692. <label class="pure-u-1 pure-u-lg-1-4">Brightness</label>
  1693. <input type="range" min="0" max="255" class="slider pure-u-lg-1-4" id="brightness">
  1694. <span class="slider brightness pure-u-lg-1-4"></span>
  1695. </div>
  1696. </div>
  1697. <div id="channelTemplate" class="template">
  1698. <div class="pure-g">
  1699. <label class="pure-u-1 pure-u-lg-1-4">Channel #</label>
  1700. <input type="range" min="0" max="255" class="slider channels pure-u-lg-1-4" data="99">
  1701. <span class="slider pure-u-lg-1-4"></span>
  1702. </div>
  1703. </div>
  1704. <div id="miredsTemplate" class="template">
  1705. <div class="pure-g">
  1706. <label class="pure-u-1 pure-u-lg-1-4">Mireds (Cold &harr; Warm)</label>
  1707. <input type="range" min="153" max="500" class="slider pure-u-lg-1-4" id="mireds">
  1708. <span class="slider mireds pure-u-lg-1-4"></span>
  1709. </div>
  1710. </div>
  1711. <!-- endRemoveIf(!light) -->
  1712. <!-- removeIf(!curtain) -->
  1713. <div id="curtainTemplate" class="template">
  1714. <div class="pure-g">
  1715. <div class="pure-u-1-1 curtain-div">
  1716. <div class="curtain-roller" id="curtainGetPicture"></div>
  1717. </div>
  1718. </div>
  1719. <div class="pure-g">
  1720. <div class="pure-u-1-3 curtain-div"><button type="button" class="pure-button curtain-button button-curtain-close">CLOSE</button></div>
  1721. <div class="pure-u-1-3 curtain-div"><button type="button" class="pure-button curtain-button button-curtain-pause">PAUSE</button></div>
  1722. <div class="pure-u-1-3 curtain-div"><button type="button" class="pure-button curtain-button button-curtain-open">OPEN</button></div>
  1723. </div>
  1724. <div class="pure-g">
  1725. <input type="range" list="tickmarks" min="0" max="100" class="slider pure-u-1-1 reverse-range" id="curtainSet">
  1726. <datalist id="tickmarks">
  1727. <option value="0"></option>
  1728. <option value="50"></option>
  1729. <option value="100"></option>
  1730. </datalist>
  1731. </div>
  1732. </div>
  1733. <!-- endRemoveIf(!curtain) -->
  1734. <!-- removeIf(!sensor) -->
  1735. <div id="magnitudeTemplate" class="template">
  1736. <div class="pure-g">
  1737. <label class="pure-u-1 pure-u-lg-1-4"></label>
  1738. <div class="pure-u-1 pure-u-lg-1-4">
  1739. <input class="pure-u-1 pure-u-lg-23-24 center" type="text" name="magnitude" data="256" readonly />
  1740. </div>
  1741. <div class="pure-u-1 pure-u-lg-1-2 hint center sns-desc"></div>
  1742. <div class="pure-u-1 pure-u-lg-1 hint sns-info">
  1743. </div>
  1744. </div>
  1745. </div>
  1746. <!-- endRemoveIf(!sensor) -->
  1747. <!-- removeIf(!rfm69) -->
  1748. <div id="nodeTemplate" class="template">
  1749. <div class="pure-g">
  1750. <div class="pure-u-md-1-6 pure-u-1-2"><input name="node" type="text" class="pure-u-11-12" value="" size="8" tabindex="0" placeholder="Node ID" autocomplete="false"></div>
  1751. <div class="pure-u-md-1-6 pure-u-1-2"><input name="key" type="text" class="pure-u-11-12" value="" size="8" tabindex="0" placeholder="Key"></div>
  1752. <div class="pure-u-md-1-2 pure-u-3-4"><input name="topic" type="text" class="pure-md-11-12 pure-u-23-24" value="" size="8" tabindex="0" placeholder="MQTT Topic"></div>
  1753. <div class="pure-u-md-1-6 pure-u-1-4"><button type="button" class="pure-button button-del-parent pure-u-5-6 pure-u-md-5-6">Del</button></div>
  1754. </div>
  1755. </div>
  1756. <!-- endRemoveIf(!rfm69) -->
  1757. <div id="rpnRuleTemplate" class="template">
  1758. <div class="pure-g">
  1759. <div class="pure-u-5-6"><input name="rpnRule" type="text" class="pure-u-23-24" value="" tabindex="0" autocomplete="false" /></div>
  1760. <div class="pure-u-1-6"><button type="button" class="pure-button button-del-parent pure-u-1">Del</button></div>
  1761. </div>
  1762. </div>
  1763. <div id="rpnTopicTemplate" class="template">
  1764. <div class="pure-g">
  1765. <div class="pure-u-1-2"><input name="rpnTopic" type="text" class="pure-u-23-24" value="" tabindex="0" autocomplete="false" /></div>
  1766. <div class="pure-u-1-3"><input name="rpnName" type="text" class="pure-u-23-24" value="" tabindex="0" autocomplete="false" /></div>
  1767. <div class="pure-u-1-6"><button type="button" class="pure-button button-del-parent pure-u-1">Del</button></div>
  1768. </div>
  1769. </div>
  1770. <iframe id="downloader"></iframe>
  1771. <input id="uploader" type="file" />
  1772. </body>
  1773. <!-- build:js script.js -->
  1774. <script src="vendor/jquery-3.4.1.slim.min.js"></script>
  1775. <script src="custom.js"></script>
  1776. <!-- removeIf(!light) -->
  1777. <script src="vendor/jquery.wheelcolorpicker-3.0.8.min.js"></script>
  1778. <!-- endRemoveIf(!light) -->
  1779. <!-- removeIf(!rfm69) -->
  1780. <script src="vendor/datatables-1.10.16.min.js"></script>
  1781. <!-- endRemoveIf(!rfm69) -->
  1782. <!-- endbuild -->
  1783. </html>