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.

1841 lines
109 KiB

6 years ago
6 years ago
6 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
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
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
6 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
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
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.3.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" 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" 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(!lightfox) -->
  74. <li class="pure-menu-item module module-lightfox">
  75. <a href="#" class="pure-menu-link" data="panel-lightfox">LIGHTFOX RF</a>
  76. </li>
  77. <!-- endRemoveIf(!lightfox) -->
  78. <li class="pure-menu-item module module-dcz">
  79. <a href="#" class="pure-menu-link" data="panel-domoticz">DOMOTICZ</a>
  80. </li>
  81. <li class="pure-menu-item module module-ha">
  82. <a href="#" class="pure-menu-link" data="panel-ha">HASS</a>
  83. </li>
  84. <li class="pure-menu-item module module-idb">
  85. <a href="#" class="pure-menu-link" data="panel-idb">INFLUXDB</a>
  86. </li>
  87. <li class="pure-menu-item module module-led">
  88. <a href="#" class="pure-menu-link" data="panel-led">LED</a>
  89. </li>
  90. <!-- removeIf(!light) -->
  91. <li class="pure-menu-item module module-color">
  92. <a href="#" class="pure-menu-link" data="panel-color">LIGHTS</a>
  93. </li>
  94. <!-- endRemoveIf(!light) -->
  95. <!-- removeIf(!rfm69) -->
  96. <li class="pure-menu-item module module-rfm69">
  97. <a href="#" class="pure-menu-link" data="panel-mapping">MAPPING</a>
  98. </li>
  99. <li class="pure-menu-item module module-rfm69">
  100. <a href="#" class="pure-menu-link" data="panel-messages">MESSAGES</a>
  101. </li>
  102. <!-- endRemoveIf(!rfm69) -->
  103. <li class="pure-menu-item module module-mqtt">
  104. <a href="#" class="pure-menu-link" data="panel-mqtt">MQTT</a>
  105. </li>
  106. <li class="pure-menu-item module module-nofuss">
  107. <a href="#" class="pure-menu-link" data="panel-nofuss">NOFUSS</a>
  108. </li>
  109. <li class="pure-menu-item module module-ntp">
  110. <a href="#" class="pure-menu-link" data="panel-ntp">NTP</a>
  111. </li>
  112. <!-- removeIf(!rfbridge) -->
  113. <li class="pure-menu-item module module-rfb">
  114. <a href="#" class="pure-menu-link" data="panel-rfb">RF</a>
  115. </li>
  116. <!-- endRemoveIf(!rfbridge) -->
  117. <li class="pure-menu-item module module-sch">
  118. <a href="#" class="pure-menu-link" data="panel-schedule">SCHEDULE</a>
  119. </li>
  120. <!-- removeIf(!sensor) -->
  121. <li class="pure-menu-item module module-sns">
  122. <a href="#" class="pure-menu-link" data="panel-sns">SENSORS</a>
  123. </li>
  124. <!-- endRemoveIf(!sensor) -->
  125. <li class="pure-menu-item module module-relay">
  126. <a href="#" class="pure-menu-link" data="panel-relay">SWITCHES</a>
  127. </li>
  128. <li class="pure-menu-item module module-tspk">
  129. <a href="#" class="pure-menu-link" data="panel-thingspeak">THINGSPEAK</a>
  130. </li>
  131. <li class="pure-menu-item">
  132. <a href="#" class="pure-menu-link" data="panel-wifi">WIFI</a>
  133. </li>
  134. <li class="pure-menu-item menu-item-divided">
  135. <a href="#" class="pure-menu-link" data="panel-admin">ADMIN</a>
  136. </li>
  137. <li class="pure-menu-item module module-dbg">
  138. <a href="#" class="pure-menu-link" data="panel-dbg">DEBUG</a>
  139. </li>
  140. </ul>
  141. <div class="main-buttons">
  142. <button class="pure-button button-update">Save</button>
  143. <button class="pure-button button-reconnect">Reconnect</button>
  144. <button class="pure-button button-reboot">Reboot</button>
  145. </div>
  146. <div class="footer">
  147. &copy; 2016-2019<br />
  148. Xose Pérez<br/>
  149. <a href="https://twitter.com/xoseperez" rel="noopener" target="_blank">@xoseperez</a><br/>
  150. <a href="http://tinkerman.cat" rel="noopener" target="_blank">http://tinkerman.cat</a><br/>
  151. <a href="https://github.com/xoseperez/espurna" rel="noopener" target="_blank">ESPurna @ GitHub</a><br/>
  152. GPLv3 license<br/>
  153. </div>
  154. </div>
  155. </div>
  156. <div class="content">
  157. <div class="panel block" id="panel-status">
  158. <div class="header">
  159. <h1>STATUS</h1>
  160. <h2>Current configuration</h2>
  161. </div>
  162. <div class="page">
  163. <form class="pure-form pure-form-aligned">
  164. <fieldset>
  165. <div id="relays"></div>
  166. <!-- removeIf(!light) -->
  167. <div id="colors"></div>
  168. <div id="cct"></div>
  169. <div id="channels"></div>
  170. <!-- endRemoveIf(!light) -->
  171. <!-- removeIf(!sensor) -->
  172. <div id="magnitudes"></div>
  173. <!-- endRemoveIf(!sensor) -->
  174. <!-- removeIf(!rfm69) -->
  175. <div class="pure-g module module-rfm69">
  176. <label class="pure-u-1 pure-u-lg-1-4">Packet count</label>
  177. <div class="pure-u-1 pure-u-lg-1-4"><input class="pure-u-1" type="text" name="packetCount" readonly /></div>
  178. </div>
  179. <div class="pure-g module module-rfm69">
  180. <label class="pure-u-1 pure-u-lg-1-4">Node count</label>
  181. <div class="pure-u-1 pure-u-lg-1-4"><input class="pure-u-1" type="text" name="nodeCount" readonly /></div>
  182. </div>
  183. <!-- endRemoveIf(!rfm69) -->
  184. <div class="pure-u-1 pure-u-lg-1-2 state">
  185. <div class="pure-u-1-2">Manufacturer</div>
  186. <div class="pure-u-11-24"><span class="right" name="manufacturer"></span></div>
  187. <div class="pure-u-1-2">Device</div>
  188. <div class="pure-u-11-24"><span class="right" name="device"></span></div>
  189. <div class="pure-u-1-2">Chip ID</div>
  190. <div class="pure-u-11-24"><span class="right" name="chipid"></span></div>
  191. <div class="pure-u-1-2">Wifi MAC</div>
  192. <div class="pure-u-11-24"><span class="right" name="mac"></span></div>
  193. <div class="pure-u-1-2">SDK version</div>
  194. <div class="pure-u-11-24"><span class="right" name="sdk"></span></div>
  195. <div class="pure-u-1-2">Core version</div>
  196. <div class="pure-u-11-24"><span class="right" name="core"></span></div>
  197. <div class="pure-u-1-2">Firmware name</div>
  198. <div class="pure-u-11-24"><span class="right" name="app_name"></span></div>
  199. <div class="pure-u-1-2">Firmware version</div>
  200. <div class="pure-u-11-24"><span class="right" name="app_version"></span></div>
  201. <div class="pure-u-1-2">Firmware revision</div>
  202. <div class="pure-u-11-24"><span class="right" name="app_revision"></span></div>
  203. <div class="pure-u-1-2">Firmware build date</div>
  204. <div class="pure-u-11-24"><span class="right" name="app_build"></span></div>
  205. <div class="pure-u-1-2">Firmware size</div>
  206. <div class="pure-u-11-24"><span class="right" name="sketch_size" post=" bytes"></span></div>
  207. <div class="pure-u-1-2">Free space</div>
  208. <div class="pure-u-11-24"><span class="right" name="free_size" post=" bytes"></span></div>
  209. </div>
  210. <div class="pure-u-1 pure-u-lg-11-24 state">
  211. <div class="pure-u-1-2">Network</div>
  212. <div class="pure-u-11-24"><span class="right" name="network"></span></div>
  213. <div class="pure-u-1-2">BSSID</div>
  214. <div class="pure-u-11-24"><span class="right" name="bssid"></span></div>
  215. <div class="pure-u-1-2">Channel</div>
  216. <div class="pure-u-11-24"><span class="right" name="channel"></span></div>
  217. <div class="pure-u-1-2">RSSI</div>
  218. <div class="pure-u-11-24"><span class="right" name="rssi"></span></div>
  219. <div class="pure-u-1-2">IP</div>
  220. <div class="pure-u-11-24"><a href=""><span class="right" name="deviceip"></span></a> (<a href=""><span class="right">telnet</span></a>)</div>
  221. <div class="pure-u-1-2">Free heap</div>
  222. <div class="pure-u-11-24"><span class="right" name="heap" post=" bytes"></span></div>
  223. <div class="pure-u-1-2">Load average</div>
  224. <div class="pure-u-11-24"><span class="right" name="loadaverage"></span><span>%</span></div>
  225. <div class="pure-u-1-2">VCC</div>
  226. <div class="pure-u-11-24"><span class="right" name="vcc">? </span><span>mV</span></div>
  227. <div class="pure-u-1-2 module module-mqtt">MQTT Status</div>
  228. <div class="pure-u-11-24 module module-mqtt"><span class="right" name="mqttStatus"></span></div>
  229. <div class="pure-u-1-2 module module-ntp">NTP Status</div>
  230. <div class="pure-u-11-24 module module-ntp"><span class="right" name="ntpStatus"></span></div>
  231. <div class="pure-u-1-2 module module-ntp">Current time</div>
  232. <div class="pure-u-11-24 module module-ntp"><span class="right" name="now"></span></div>
  233. <div class="pure-u-1-2">Uptime</div>
  234. <div class="pure-u-11-24"><span class="right" name="uptime"></span></div>
  235. <div class="pure-u-1-2">Last update</div>
  236. <div class="pure-u-11-24"><span class="right" name="ago">?</span><span> seconds ago</span></div>
  237. </div>
  238. </fieldset>
  239. </form>
  240. </div>
  241. </div>
  242. <form id="form-general" class="pure-form form-settings">
  243. <div class="panel" id="panel-general">
  244. <div class="header">
  245. <h1>GENERAL</h1>
  246. <h2>General configuration values</h2>
  247. </div>
  248. <div class="page">
  249. <fieldset>
  250. <div class="pure-g">
  251. <label class="pure-u-1 pure-u-lg-1-4">Hostname</label>
  252. <input name="hostname" class="pure-u-1 pure-u-lg-1-4" maxlength="31" type="text" action="reboot" tabindex="1" />
  253. <div class="pure-u-0 pure-u-lg-1-2"></div>
  254. <div class="pure-u-0 pure-u-lg-1-4"></div>
  255. <div class="pure-u-1 pure-u-lg-3-4 hint">
  256. This name will identify this device in your network (http://&lt;hostname&gt;.local).<br />
  257. 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 />
  258. For this setting to take effect you should restart the wifi interface by clicking the "Reconnect" button.
  259. </div>
  260. </div>
  261. <div class="pure-g">
  262. <label class="pure-u-1 pure-u-lg-1-4">Description</label>
  263. <input name="desc" class="pure-u-1 pure-u-lg-3-4" maxlength="64" type="text" tabindex="2" />
  264. <div class="pure-u-0 pure-u-lg-1-4"></div>
  265. <div class="pure-u-1 pure-u-lg-3-4 hint">
  266. Human-friendly name for your device. Will be reported with the heartbeat.<br />
  267. You can use this to specify the location or some other identification information.
  268. </div>
  269. </div>
  270. <div class="pure-g">
  271. <label class="pure-u-1 pure-u-lg-1-4">Double click delay</label>
  272. <input name="btnDelay" class="pure-u-1 pure-u-lg-1-4" type="number" action="reboot" min="0" step="100" max="1000" tabindex="6" />
  273. <div class="pure-u-0 pure-u-lg-1-2"></div>
  274. <div class="pure-u-0 pure-u-lg-1-4"></div>
  275. <div class="pure-u-1 pure-u-lg-3-4 hint">
  276. Delay in milliseconds to detect a double click (from 0 to 1000ms).<br />
  277. The lower this number the faster the device will respond to button clicks but the harder it will be to get a double click.
  278. Increase this number if you are having trouble to double click the button.
  279. Set this value to 0 to disable double click. You won't be able to set the device in AP mode manually but your device will respond immediately to button clicks.<br />
  280. You will have to <strong>reboot the device</strong> after updating for this setting to apply.
  281. </div>
  282. </div>
  283. <div class="pure-g module module-alexa">
  284. <label class="pure-u-1 pure-u-lg-1-4">Alexa integration</label>
  285. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="alexaEnabled" /></div>
  286. </div>
  287. </fieldset>
  288. </div>
  289. </div>
  290. </form>
  291. <form id="form-led" class="pure-form form-settings">
  292. <div class="panel" id="panel-led">
  293. <div class="header">
  294. <h1>LED</h1>
  295. <h2>Notification LED configuration</h2>
  296. </div>
  297. <div class="page">
  298. <fieldset>
  299. <div class="pure-g module module-led">
  300. <div class="pure-u-0 pure-u-lg-1-4">Modes</div>
  301. <div class="pure-u-1 pure-u-lg-3-4 hint">
  302. <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>
  303. <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>
  304. <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>
  305. <li><strong>Find me</strong> will turn the LED ON when all switches are OFF. This is meant to locate switches at night.</li>
  306. <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>
  307. <li><strong>Switches status</strong> will turn the LED ON whenever any switch is ON, and OFF otherwise. This is global status notification.</li>
  308. <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>
  309. <li><strong>MQTT 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>
  310. <li><strong>Always ON</strong> and <strong>Always OFF</strong> modes are self-explanatory.</li>
  311. </div>
  312. </div>
  313. <div id="ledConfig"></div>
  314. </fieldset>
  315. </div>
  316. </div>
  317. </form>
  318. <form id="form-relay" class="pure-form form-settings">
  319. <div class="panel" id="panel-relay">
  320. <div class="header">
  321. <h1>SWITCHES</h1>
  322. <h2>Switch / relay configuration</h2>
  323. </div>
  324. <div class="page">
  325. <fieldset>
  326. <legend class="module module-multirelay">General</legend>
  327. <div class="pure-g module module-multirelay">
  328. <label class="pure-u-1 pure-u-lg-1-4">Switch sync mode</label>
  329. <select name="relaySync" class="pure-u-1 pure-u-lg-3-4" tabindex="3">
  330. <option value="0">No synchronisation</option>
  331. <option value="1">Zero or one switches active</option>
  332. <option value="2">One and just one switch active</option>
  333. <option value="3">All synchronised</option>
  334. </select>
  335. <div class="pure-u-0 pure-u-lg-1-4"></div>
  336. <div class="pure-u-1 pure-u-lg-3-4 hint">Define how the different switches should be synchronized.</div>
  337. </div>
  338. <div id="relayConfig"></div>
  339. </fieldset>
  340. </div>
  341. </div>
  342. </form>
  343. <!-- removeIf(!light) -->
  344. <form id="form-color" class="pure-form form-settings">
  345. <div class="panel" id="panel-color">
  346. <div class="header">
  347. <h1>LIGHTS</h1>
  348. <h2>Lights configuration</h2>
  349. </div>
  350. <div class="page">
  351. <fieldset>
  352. <div class="pure-g">
  353. <label class="pure-u-1 pure-u-lg-1-4">Use color</label>
  354. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useColor" action="reload" tabindex="8" /></div>
  355. <div class="pure-u-0 pure-u-lg-1-2"></div>
  356. <div class="pure-u-0 pure-u-lg-1-4"></div>
  357. <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>
  358. </div>
  359. <div class="pure-g">
  360. <label class="pure-u-1 pure-u-lg-1-4">Use RGB picker</label>
  361. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useRGB" action="reload" tabindex="11" /></div>
  362. <div class="pure-u-0 pure-u-lg-1-2"></div>
  363. <div class="pure-u-0 pure-u-lg-1-4"></div>
  364. <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>
  365. </div>
  366. <div class="pure-g">
  367. <label class="pure-u-1 pure-u-lg-1-4">Use white channel</label>
  368. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useWhite" action="reload" tabindex="9" /></div>
  369. <div class="pure-u-0 pure-u-lg-1-2"></div>
  370. <div class="pure-u-0 pure-u-lg-1-4"></div>
  371. <div class="pure-u-1 pure-u-lg-3-4 hint">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>
  372. </div>
  373. <div class="pure-g">
  374. <label class="pure-u-1 pure-u-lg-1-4">Use white color temperature</label>
  375. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useCCT" action="reload" tabindex="10" /></div>
  376. <div class="pure-u-0 pure-u-lg-1-2"></div>
  377. <div class="pure-u-0 pure-u-lg-1-4"></div>
  378. <div class="pure-u-1 pure-u-lg-3-4 hint">Use fifth dimmable channel as warm white light and the forth dimmable channel as cold white.<br />Will only work if the device has 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>
  379. </div>
  380. <div class="pure-g">
  381. <label class="pure-u-1 pure-u-lg-1-4">Use gamma correction</label>
  382. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useGamma" tabindex="11" /></div>
  383. <div class="pure-u-0 pure-u-lg-1-2"></div>
  384. <div class="pure-u-0 pure-u-lg-1-4"></div>
  385. <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>
  386. </div>
  387. <div class="pure-g">
  388. <label class="pure-u-1 pure-u-lg-1-4">Use CSS style</label>
  389. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useCSS" tabindex="12" /></div>
  390. <div class="pure-u-0 pure-u-lg-1-2"></div>
  391. <div class="pure-u-0 pure-u-lg-1-4"></div>
  392. <div class="pure-u-1 pure-u-lg-3-4 hint">Use CSS style to report colors to MQTT and REST API. <br />Red will be reported as "#FF0000" if ON, otherwise "255,0,0"</div>
  393. </div>
  394. <div class="pure-g">
  395. <label class="pure-u-1 pure-u-lg-1-4">Color transitions</label>
  396. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useTransitions" tabindex="13" /></div>
  397. <div class="pure-u-0 pure-u-lg-1-2"></div>
  398. <div class="pure-u-0 pure-u-lg-1-4"></div>
  399. <div class="pure-u-1 pure-u-lg-3-4 hint">If enabled color changes will be smoothed.</div>
  400. </div>
  401. <div class="pure-g">
  402. <label class="pure-u-1 pure-u-lg-1-4">Transition time</label>
  403. <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>
  404. <div class="pure-u-0 pure-u-lg-1-2"></div>
  405. <div class="pure-u-0 pure-u-lg-1-4"></div>
  406. <div class="pure-u-1 pure-u-lg-3-4 hint">Time in millisecons to transition from one color to another.</div>
  407. </div>
  408. <div class="pure-g">
  409. <div class="pure-u-1 pure-u-lg-1-4"><label>MQTT group</label></div>
  410. <div class="pure-u-1 pure-u-lg-3-4"><input name="mqttGroupColor" class="pure-u-1" tabindex="15" action="reconnect" /></div>
  411. <div class="pure-u-0 pure-u-lg-1-4"></div>
  412. <div class="pure-u-1 pure-u-lg-3-4 hint">Sync color between different lights.</div>
  413. </div>
  414. </fieldset>
  415. </div>
  416. </div>
  417. </form>
  418. <!-- endRemoveIf(!light) -->
  419. <form id="form-admin" class="pure-form form-settings">
  420. <div class="panel" id="panel-admin">
  421. <div class="header">
  422. <h1>ADMINISTRATION</h1>
  423. <h2>Device administration and security settings</h2>
  424. </div>
  425. <div class="page">
  426. <fieldset>
  427. <div class="pure-g">
  428. <label class="pure-u-1 pure-u-lg-1-4">Settings</label>
  429. <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>
  430. <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>
  431. <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>
  432. </div>
  433. <div class="pure-g">
  434. <label class="pure-u-1 pure-u-lg-1-4">Admin password</label>
  435. <input name="adminPass1" class="pure-u-1 pure-u-lg-3-4" placeholder="New password" minlength="8" maxlength="63" type="password" action="reboot" tabindex="11" autocomplete="false" spellcheck="false" />
  436. <span class="no-select password-reveal"></span>
  437. <div class="pure-u-1 pure-u-lg-1-4"></div>
  438. <input name="adminPass2" class="pure-u-1 pure-u-lg-3-4" placeholder="Repeat password" minlength="8" maxlength="63" type="password" action="reboot" tabindex="12" autocomplete="false" spellcheck="false" />
  439. <span class="no-select password-reveal"></span>
  440. <div class="pure-u-0 pure-u-lg-1-4"></div>
  441. <div class="pure-u-1 pure-u-lg-3-4 hint">
  442. 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 />
  443. 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>
  444. </div>
  445. <div class="pure-g">
  446. <label class="pure-u-1 pure-u-lg-1-4">HTTP port</label>
  447. <input name="webPort" class="pure-u-1 pure-u-lg-1-4" type="text" action="reboot" tabindex="13" />
  448. <div class="pure-u-0 pure-u-lg-1-2"></div>
  449. <div class="pure-u-0 pure-u-lg-1-4"></div>
  450. <div class="pure-u-1 pure-u-lg-3-4 hint">
  451. This is the port for the web interface and API requests.
  452. If different than 80 (standard HTTP port) you will have to add it explicitly to your requests: http://myip:myport/
  453. </div>
  454. </div>
  455. <div class="pure-g">
  456. <label class="pure-u-1 pure-u-lg-1-4">Enable WS Auth</label>
  457. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="wsAuth" /></div>
  458. </div>
  459. <div class="pure-g module module-api">
  460. <label class="pure-u-1 pure-u-lg-1-4">Enable HTTP API</label>
  461. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="apiEnabled" /></div>
  462. </div>
  463. <div class="pure-g module module-api">
  464. <label class="pure-u-1 pure-u-lg-1-4">Restful API</label>
  465. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="apiRestFul" /></div>
  466. <div class="pure-u-0 pure-u-lg-1-2"></div>
  467. <div class="pure-u-0 pure-u-lg-1-4"></div>
  468. <div class="pure-u-1 pure-u-lg-3-4 hint">
  469. If enabled, API requests to change a status (like a relay) must be done using PUT.
  470. If disabled you can issue them as GET requests (easier from a browser).
  471. </div>
  472. </div>
  473. <div class="pure-g module module-api">
  474. <label class="pure-u-1 pure-u-lg-1-4">Real time API</label>
  475. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="apiRealTime" /></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">
  479. By default, some magnitudes are being preprocessed and filtered to avoid spurious values.
  480. If you want to get real-time values (not preprocessed) in the API turn on this setting.
  481. </div>
  482. </div>
  483. <div class="pure-g module module-api">
  484. <label class="pure-u-1 pure-u-lg-1-4">HTTP API Key</label>
  485. <input name="apiKey" class="pure-u-3-4 pure-u-lg-1-2" type="text" tabindex="14" />
  486. <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>
  487. <div class="pure-u-0 pure-u-lg-1-4"></div>
  488. <div class="pure-u-1 pure-u-lg-3-4 hint">
  489. This is the key you will have to pass with every HTTP request to the API, either to get or write values.
  490. All API calls must contain the <strong>apikey</strong> parameter with the value above.
  491. To know what APIs are enabled do a call to <strong>/apis</strong>.
  492. </div>
  493. </div>
  494. <div class="pure-g module module-telnet">
  495. <label class="pure-u-1 pure-u-lg-1-4">Enable TELNET</label>
  496. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="telnetSTA" /></div>
  497. <div class="pure-u-0 pure-u-lg-1-2"></div>
  498. <div class="pure-u-0 pure-u-lg-1-4"></div>
  499. <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>
  500. </div>
  501. <div class="pure-g module module-telnet">
  502. <label class="pure-u-1 pure-u-lg-1-4">TELNET Password</label>
  503. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="telnetAuth" /></div>
  504. <div class="pure-u-0 pure-u-lg-1-2"></div>
  505. <div class="pure-u-0 pure-u-lg-1-4"></div>
  506. <div class="pure-u-1 pure-u-lg-3-4 hint">Request password when starting telnet session</div>
  507. </div>
  508. <div class="pure-g">
  509. <label class="pure-u-1 pure-u-lg-1-4">Heartbeat message</label>
  510. <select class="pure-u-1 pure-u-lg-3-4" name="hbMode" tabindex="15" >
  511. <option value="0">Disabled</option>
  512. <option value="1">On device startup</option>
  513. <option value="2">Repeat after defined interval</option>
  514. <option value="3">Repeat only device status</option>
  515. </select>
  516. <div class="pure-u-0 pure-u-lg-1-4"></div>
  517. <div class="pure-u-1 pure-u-lg-3-4 hint">
  518. Define when heartbeat message will be sent.
  519. </div>
  520. </div>
  521. <div class="pure-g">
  522. <label class="pure-u-1 pure-u-lg-1-4">Heartbeat interval</label>
  523. <input name="hbInterval" class="pure-u-1 pure-u-lg-1-4" type="number" tabindex="16" />
  524. <div class="pure-u-0 pure-u-lg-1-2"></div>
  525. <div class="pure-u-0 pure-u-lg-1-4"></div>
  526. <div class="pure-u-1 pure-u-lg-3-4 hint">
  527. This is the interval in <strong>seconds</strong> how often to send the heartbeat message.
  528. </div>
  529. </div>
  530. <div class="pure-g">
  531. <label class="pure-u-1 pure-u-lg-1-4">Upgrade</label>
  532. <input class="pure-u-1-2 pure-u-lg-1-2" name="filename" type="text" readonly />
  533. <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>
  534. <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>
  535. <div class="pure-u-0 pure-u-lg-1-4"></div>
  536. <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>
  537. <div class="pure-u-0 pure-u-lg-1-4"></div>
  538. <div class="pure-u-1 pure-u-lg-3-4"><progress id="upgrade-progress"></progress></div>
  539. <input name="upgrade" type="file" tabindex="17" />
  540. </div>
  541. </fieldset>
  542. </div>
  543. </div>
  544. </form>
  545. <form id="form-wifi" class="pure-form form-settings">
  546. <div class="panel" id="panel-wifi">
  547. <div class="header">
  548. <h1>WIFI</h1>
  549. <h2>You can configure up to 5 different WiFi networks. The device will try to connect in order of signal strength.</h2>
  550. </div>
  551. <div class="page">
  552. <fieldset>
  553. <legend>General</legend>
  554. <div class="pure-g">
  555. <div class="pure-u-1 pure-u-lg-1-4"></div>
  556. <div class="pure-u-1 pure-u-lg-3-4 hint">Device hostname can be configured on the GENERAL tab.</div>
  557. </div>
  558. <div class="pure-g">
  559. <label class="pure-u-1 pure-u-lg-1-4">Scan networks</label>
  560. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="wifiScan" tabindex="1" /></div>
  561. <div class="pure-u-0 pure-u-lg-1-2"></div>
  562. <div class="pure-u-0 pure-u-lg-1-4"></div>
  563. <div class="pure-u-1 pure-u-lg-3-4 hint">
  564. 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.
  565. When disabled, ESPurna will try to connect to the networks in the same order they are listed below.
  566. Disable this option if you are <strong>connecting to a single access point</strong> (or router) or to a <strong>hidden SSID</strong>.
  567. </div>
  568. <div class="pure-u-0 pure-u-lg-1-4"></div>
  569. <button class="pure-button button-wifi-scan" type="button">Scan now</button>
  570. <div class="pure-u-0 pure-u-lg-1-4 scan loading"></div>
  571. </div>
  572. <div class="pure-g">
  573. <span class="pure-u-1 terminal" id="scanResult" name="scanResult"></span>
  574. </div>
  575. <legend>Networks</legend>
  576. <div id="networks"></div>
  577. <button type="button" class="pure-button button-add-network">Add network</button>
  578. </fieldset>
  579. </div>
  580. </div>
  581. </form>
  582. <form id="form-schedule" class="pure-form form-settings">
  583. <div class="panel" id="panel-schedule">
  584. <div class="header">
  585. <h1>SCHEDULE</h1>
  586. <h2>Turn switches ON and OFF based on the current time.</h2>
  587. </div>
  588. <div class="page">
  589. <fieldset>
  590. <div id="schedules"></div>
  591. <button type="button" class="pure-button button-add-switch-schedule module module-relay">Add switch schedule</button>
  592. <!-- removeIf(!light) -->
  593. <button type="button" class="pure-button button-add-light-schedule module module-color">Add channel schedule</button>
  594. <!-- endRemoveIf(!light) -->
  595. </fieldset>
  596. </div>
  597. </div>
  598. </form>
  599. <!-- removeIf(!rfm69) -->
  600. <form id="form-mapping" class="pure-form form-settings">
  601. <div class="panel" id="panel-mapping">
  602. <div class="header">
  603. <h1>MAPPING</h1>
  604. <h2>
  605. 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.
  606. 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.
  607. </h2>
  608. </div>
  609. <div class="page">
  610. <fieldset>
  611. <legend>Default topic</legend>
  612. <div class="pure-g">
  613. <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)">
  614. </div>
  615. <legend>Specific topics</legend>
  616. <div id="mapping"></div>
  617. <button type="button" class="pure-button button-add-mapping">Add</button>
  618. </fieldset>
  619. </div>
  620. </div>
  621. </form>
  622. <form id="form-messages" class="pure-form">
  623. <div class="panel" id="panel-messages">
  624. <div class="header">
  625. <h1>MESSAGES</h1>
  626. <h2>
  627. Messages being received. Previous messages are not displayed.
  628. You have to keep the page open in order to keep receiving them.
  629. You can filter/unfilter by clicking on the values.
  630. Left click on a value to show only rows that match that value, middle click to show all rows but those matching that value.
  631. Filtered colums have red headers.
  632. </h2>
  633. </div>
  634. <div class="page">
  635. <table id="packets" class="display" cellspacing="0">
  636. <thead>
  637. <tr>
  638. <th>Timestamp</th>
  639. <th>SenderID</th>
  640. <th>PacketID</th>
  641. <th>TargetID</th>
  642. <th>Key</th>
  643. <th>Value</th>
  644. <th>RSSI</th>
  645. <th>Duplicates</th>
  646. <th>Missing</th>
  647. </tr>
  648. </thead>
  649. <tbody>
  650. </tbody>
  651. </table>
  652. <button type="button" class="pure-button button-clear-filters">Clear filters</button>
  653. <button type="button" class="pure-button button-clear-messages">Clear messages</button>
  654. <button type="button" class="pure-button button-clear-counts">Clear counts</button>
  655. </div>
  656. </div>
  657. </form>
  658. <!-- endRemoveIf(!rfm69) -->
  659. <form id="form-mqtt" class="pure-form form-settings">
  660. <div class="panel" id="panel-mqtt">
  661. <div class="header">
  662. <h1>MQTT</h1>
  663. <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>
  664. </div>
  665. <div class="page">
  666. <fieldset>
  667. <div class="pure-g">
  668. <label class="pure-u-1 pure-u-lg-1-4">Enable MQTT</label>
  669. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="mqttEnabled" tabindex="30" /></div>
  670. </div>
  671. <div class="pure-g">
  672. <label class="pure-u-1 pure-u-lg-1-4">MQTT Broker</label>
  673. <input class="pure-u-1 pure-u-lg-1-4" name="mqttServer" type="text" tabindex="21" placeholder="IP or address of your broker" />
  674. </div>
  675. <div class="pure-g">
  676. <label class="pure-u-1 pure-u-lg-1-4">MQTT Port</label>
  677. <input class="pure-u-1 pure-u-lg-1-4" name="mqttPort" type="text" tabindex="22" value="1883" />
  678. </div>
  679. <div class="pure-g">
  680. <label class="pure-u-1 pure-u-lg-1-4">MQTT User</label>
  681. <input class="pure-u-1 pure-u-lg-1-4" name="mqttUser" type="text" tabindex="23" placeholder="Leave blank if no user" autocomplete="off" />
  682. <div class="pure-u-0 pure-u-lg-1-2"></div>
  683. <div class="pure-u-0 pure-u-lg-1-4"></div>
  684. <div class="pure-u-1 pure-u-lg-3-4 hint">
  685. You can use the following placeholders: {hostname}, {mac}
  686. </div>
  687. </div>
  688. <div class="pure-g">
  689. <label class="pure-u-1 pure-u-lg-1-4">MQTT Password</label>
  690. <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" />
  691. <span class="no-select password-reveal"></span>
  692. </div>
  693. <div class="pure-g">
  694. <label class="pure-u-1 pure-u-lg-1-4">MQTT Client ID</label>
  695. <input class="pure-u-1 pure-u-lg-1-4" name="mqttClientID" type="text" tabindex="25" />
  696. <div class="pure-u-0 pure-u-lg-1-2"></div>
  697. <div class="pure-u-0 pure-u-lg-1-4"></div>
  698. <div class="pure-u-1 pure-u-lg-3-4 hint">
  699. 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}
  700. </div>
  701. </div>
  702. <div class="pure-g">
  703. <label class="pure-u-1 pure-u-lg-1-4">MQTT QoS</label>
  704. <select class="pure-u-1 pure-u-lg-1-4" name="mqttQoS" tabindex="26">
  705. <option value="0">0: At most once</option>
  706. <option value="1">1: At least once</option>
  707. <option value="2">2: Exactly once</option>
  708. </select>
  709. </div>
  710. <div class="pure-g">
  711. <label class="pure-u-1 pure-u-lg-1-4">MQTT Retain</label>
  712. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="mqttRetain" tabindex="27" /></div>
  713. </div>
  714. <div class="pure-g">
  715. <label class="pure-u-1 pure-u-lg-1-4">MQTT Keep Alive</label>
  716. <input class="pure-u-1 pure-u-lg-1-4" type="number" name="mqttKeep" min="10" max="3600" tabindex="28" />
  717. </div>
  718. <div class="pure-g module module-mqttssl">
  719. <label class="pure-u-1 pure-u-lg-1-4">Use secure connection (SSL)</label>
  720. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="mqttUseSSL" tabindex="29" /></div>
  721. </div>
  722. <div class="pure-g module module-mqttssl">
  723. <label class="pure-u-1 pure-u-lg-1-4">SSL Fingerprint</label>
  724. <input class="pure-u-1 pure-u-lg-3-4" name="mqttFP" type="text" maxlength="59" tabindex="30" />
  725. <div class="pure-u-0 pure-u-lg-1-4"></div>
  726. <div class="pure-u-1 pure-u-lg-3-4 hint">
  727. This is the fingerprint for the SSL certificate of the server.<br />
  728. 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 />
  729. or using openssl from a linux box by typing:<br />
  730. <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>
  731. </div>
  732. </div>
  733. <div class="pure-g">
  734. <label class="pure-u-1 pure-u-lg-1-4">MQTT Root Topic</label>
  735. <input class="pure-u-1 pure-u-lg-3-4" name="mqttTopic" type="text" tabindex="31" />
  736. <div class="pure-u-0 pure-u-lg-1-4"></div>
  737. <div class="pure-u-1 pure-u-lg-3-4 hint">
  738. This is the root topic for this device. The {hostname} and {mac} placeholders will be replaced by the device hostname and MAC address.<br />
  739. - <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 />
  740. <!-- removeIf(!light) -->
  741. <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>
  742. <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>
  743. <span class="module module-color">- <strong>&lt;root&gt;/brightness/set</strong> Set the brighness (0-255).<br /></span>
  744. <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>
  745. <span class="module module-color">- <strong>&lt;root&gt;/mired/set</strong> Set the temperature color in mired.<br /></span>
  746. <!-- endRemoveIf(!light) -->
  747. - <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 />
  748. - 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>.
  749. </div>
  750. </div>
  751. <div class="pure-g">
  752. <label class="pure-u-1 pure-u-lg-1-4">Use JSON payload</label>
  753. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="mqttUseJson" tabindex="32" /></div>
  754. <div class="pure-u-1 pure-u-lg-1-2"></div>
  755. <div class="pure-u-1 pure-u-lg-1-4"></div>
  756. <div class="pure-u-1 pure-u-lg-3-4 hint">
  757. All messages (except the device status) will be included in a JSON payload along with the timestamp and hostname
  758. and sent under the <strong>&lt;root&gt;/data</strong> topic.<br />
  759. Messages will be queued and sent after 100ms, so different messages could be merged into a single payload.<br />
  760. Subscriptions will still be done to single topics.
  761. </div>
  762. </div>
  763. </fieldset>
  764. </div>
  765. </div>
  766. </form>
  767. <form id="form-nofuss" class="pure-form form-settings">
  768. <div class="panel" id="panel-nofuss">
  769. <div class="header">
  770. <h1>NoFUSS</h1>
  771. <h2>Automatically upgrade the firmware (see <a href="https://bitbucket.org/xoseperez/nofuss">xoseperez/nofuss</a> for details)</h2>
  772. </div>
  773. <div class="page">
  774. <fieldset>
  775. <div class="pure-g">
  776. <label class="pure-u-1 pure-u-lg-1-4">Enable</label>
  777. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="nofussEnabled" /></div>
  778. </div>
  779. <div class="pure-g">
  780. <label class="pure-u-1 pure-u-lg-1-4">Server</label>
  781. <input name="nofussServer" class="pure-u-1 pure-u-lg-3-4" type="text" tabindex="15" />
  782. <div class="pure-u-0 pure-u-lg-1-4"></div>
  783. <div class="pure-u-1 pure-u-lg-3-4 hint">Address of the NoFUSS server</div>
  784. </div>
  785. </fieldset>
  786. </div>
  787. </div>
  788. </form>
  789. <form id="form-ntp" class="pure-form form-settings">
  790. <div class="panel" id="panel-ntp">
  791. <div class="header">
  792. <h1>NTP</h1>
  793. <h2>Configure your NTP (Network Time Protocol) servers and local configuration to keep your device time up to the second for your location.</h2>
  794. </div>
  795. <div class="page">
  796. <fieldset>
  797. <div class="pure-g">
  798. <label class="pure-u-1 pure-u-lg-1-4">Device Current Time</label>
  799. <input class="pure-u-1 pure-u-lg-3-4" name="now" type="text" readonly />
  800. </div>
  801. <div class="pure-g">
  802. <label class="pure-u-1 pure-u-lg-1-4">NTP Server</label>
  803. <input class="pure-u-1 pure-u-lg-3-4" name="ntpServer" type="text" tabindex="41" />
  804. </div>
  805. <div class="pure-g">
  806. <label class="pure-u-1 pure-u-lg-1-4">Time Zone</label>
  807. <select class="pure-u-1 pure-u-lg-1-4" name="ntpOffset" tabindex="42"></select>
  808. </div>
  809. <div class="pure-g">
  810. <label class="pure-u-1 pure-u-lg-1-4">Enable DST</label>
  811. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="ntpDST" /></div>
  812. </div>
  813. <div class="pure-g">
  814. <label class="pure-u-1 pure-u-lg-1-4">DST Region</label>
  815. <select class="pure-u-1 pure-u-lg-1-4" name="ntpRegion">
  816. <option value="0">Europe</option>
  817. <option value="1">USA</option>
  818. </select>
  819. </div>
  820. </fieldset>
  821. </div>
  822. </div>
  823. </form>
  824. <form id="form-domoticz" class="pure-form form-settings">
  825. <div class="panel" id="panel-domoticz">
  826. <div class="header">
  827. <h1>DOMOTICZ</h1>
  828. <h2>
  829. Configure the connection to your Domoticz server.
  830. </h2>
  831. </div>
  832. <div class="page">
  833. <fieldset>
  834. <legend>General</legend>
  835. <div class="pure-g">
  836. <label class="pure-u-1 pure-u-lg-1-4">Enable Domoticz</label>
  837. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="dczEnabled" tabindex="30" /></div>
  838. </div>
  839. <div class="pure-g">
  840. <label class="pure-u-1 pure-u-lg-1-4">Domoticz IN Topic</label>
  841. <input class="pure-u-1 pure-u-lg-3-4" name="dczTopicIn" type="text" tabindex="31" />
  842. </div>
  843. <div class="pure-g">
  844. <label class="pure-u-1 pure-u-lg-1-4">Domoticz OUT Topic</label>
  845. <input class="pure-u-1 pure-u-lg-3-4" name="dczTopicOut" type="text" action="reconnect" tabindex="32" />
  846. </div>
  847. <legend>Sensors &amp; actuators</legend>
  848. <div class="pure-g">
  849. <div class="pure-u-1 hint">Set IDX to 0 to disable notifications from that component.</div>
  850. </div>
  851. <div id="dczRelays"></div>
  852. <!-- removeIf(!sensor) -->
  853. <div id="dczMagnitudes"></div>
  854. <!-- endRemoveIf(!sensor) -->
  855. </fieldset>
  856. </div>
  857. </div>
  858. </form>
  859. <form id="form-ha" class="pure-form form-settings">
  860. <div class="panel" id="panel-ha">
  861. <div class="header">
  862. <h1>HOME ASSISTANT</h1>
  863. <h2>
  864. Add this device to your Home Assistant.
  865. </h2>
  866. </div>
  867. <div class="page">
  868. <fieldset>
  869. <legend>Discover</legend>
  870. <div class="pure-g">
  871. <label class="pure-u-1 pure-u-lg-1-4">Discover</label>
  872. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="haEnabled" tabindex="14" /></div>
  873. <div class="pure-u-0 pure-u-lg-1-2"></div>
  874. <div class="pure-u-0 pure-u-lg-1-4"></div>
  875. <div class="pure-u-1 pure-u-lg-3-4 hint">
  876. Home Assistant auto-discovery feature. Enable and save to add the device to your HA console.
  877. <!-- removeIf(!light) -->
  878. When using a colour light you might want to disable CSS style so Home Assistant can parse the color.
  879. <!-- endRemoveIf(!light) -->
  880. </div>
  881. </div>
  882. <div class="pure-g">
  883. <label class="pure-u-1 pure-u-lg-1-4">Prefix</label>
  884. <input class="pure-u-1 pure-u-lg-1-4" name="haPrefix" type="text" tabindex="15" />
  885. </div>
  886. <legend>Configuration</legend>
  887. <div class="pure-g">
  888. <label class="pure-u-1 pure-u-lg-1-4">Configuration</label>
  889. <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>
  890. <div class="pure-u-0 pure-u-lg-1-4"></div>
  891. <div class="pure-u-1 pure-u-lg-3-4 hint">
  892. These are the settings you should copy to your Home Assistant "configuration.yaml" file.
  893. If any of the sections below (switch, light, sensor) already exists, do not duplicate it,
  894. simply copy the contents of the section below the ones already present.
  895. </div>
  896. </div>
  897. <div class="pure-g">
  898. <textarea class="pure-u-1 terminal" id="haConfig" name="haConfig" wrap="off" readonly></textarea>
  899. </div>
  900. </fieldset>
  901. </div>
  902. </div>
  903. </form>
  904. <form id="form-thingspeak" class="pure-form form-settings">
  905. <div class="panel" id="panel-thingspeak">
  906. <div class="header">
  907. <h1>THINGSPEAK</h1>
  908. <h2>
  909. Send your sensors data to Thingspeak.
  910. </h2>
  911. </div>
  912. <div class="page">
  913. <fieldset>
  914. <legend>General</legend>
  915. <div class="pure-g">
  916. <label class="pure-u-1 pure-u-lg-1-4">Enable Thingspeak</label>
  917. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="tspkEnabled" tabindex="30" /></div>
  918. </div>
  919. <div class="pure-g">
  920. <label class="pure-u-1 pure-u-lg-1-4">Clear cache</label>
  921. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="tspkClear" tabindex="31" /></div>
  922. <div class="pure-u-0 pure-u-lg-1-2"></div>
  923. <div class="pure-u-0 pure-u-lg-1-4"></div>
  924. <div class="pure-u-1 pure-u-lg-3-4 hint">
  925. With every POST to thinkspeak.com only enqueued fields are sent.
  926. If you select to clear the cache after every sending this will result in only those fields that have changed will be posted.
  927. If you want all fields to be sent with every POST do not clear the cache.
  928. </div>
  929. </div>
  930. <div class="pure-g">
  931. <label class="pure-u-1 pure-u-lg-1-4">Thingspeak API Key</label>
  932. <input class="pure-u-1 pure-u-lg-3-4" name="tspkKey" type="text" tabindex="32" />
  933. </div>
  934. <legend>Sensors &amp; actuators</legend>
  935. <div class="pure-g">
  936. <div class="pure-u-1 hint">Enter the field number to send each data to, 0 disable notifications from that component.</div>
  937. </div>
  938. <div id="tspkRelays"></div>
  939. <!-- removeIf(!sensor) -->
  940. <div id="tspkMagnitudes"></div>
  941. <!-- endRemoveIf(!sensor) -->
  942. </fieldset>
  943. </div>
  944. </div>
  945. </form>
  946. <form id="form-idb" class="pure-form form-settings">
  947. <div class="panel" id="panel-idb">
  948. <div class="header">
  949. <h1>INFLUXDB</h1>
  950. <h2>
  951. Configure the connection to your InfluxDB server. Leave the host field empty to disable InfluxDB connection.
  952. </h2>
  953. </div>
  954. <div class="page">
  955. <fieldset>
  956. <div class="pure-g">
  957. <label class="pure-u-1 pure-u-lg-1-4">Enable InfluxDB</label>
  958. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="idbEnabled" tabindex="40" /></div>
  959. </div>
  960. <div class="pure-g">
  961. <label class="pure-u-1 pure-u-lg-1-4">Host</label>
  962. <input class="pure-u-1 pure-u-lg-3-4" name="idbHost" type="text" tabindex="41" />
  963. </div>
  964. <div class="pure-g">
  965. <label class="pure-u-1 pure-u-lg-1-4">Port</label>
  966. <input class="pure-u-1 pure-u-lg-3-4" name="idbPort" type="text" tabindex="42" />
  967. </div>
  968. <div class="pure-g">
  969. <label class="pure-u-1 pure-u-lg-1-4">Database</label>
  970. <input class="pure-u-1 pure-u-lg-3-4" name="idbDatabase" type="text" tabindex="43" />
  971. </div>
  972. <div class="pure-g">
  973. <label class="pure-u-1 pure-u-lg-1-4">Username</label>
  974. <input class="pure-u-1 pure-u-lg-3-4" name="idbUsername" type="text" tabindex="44" autocomplete="off" />
  975. </div>
  976. <div class="pure-g">
  977. <label class="pure-u-1 pure-u-lg-1-4">Password</label>
  978. <input class="pure-u-1 pure-u-lg-3-4" name="idbPassword" type="password" tabindex="45" autocomplete="new-password" spellcheck="false" />
  979. <span class="no-select password-reveal"></span>
  980. </div>
  981. </fieldset>
  982. </div>
  983. </div>
  984. </form>
  985. <form id="form-dbg" class="pure-form">
  986. <div class="panel" id="panel-dbg">
  987. <div class="header">
  988. <h1>DEBUG LOG</h1>
  989. <h2>
  990. Shows debug messages from the device
  991. </h2>
  992. </div>
  993. <div class="page">
  994. <fieldset>
  995. <div class="pure-g module module-cmd">
  996. <div class="pure-u-1 hint">
  997. Write a command and click send to execute it on the device. The output will be shown in the debug text area below.
  998. </div>
  999. <input name="dbgcmd" class="pure-u-3-4" type="text" tabindex="2" />
  1000. <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>
  1001. </div>
  1002. <div class="pure-g">
  1003. <textarea class="pure-u-1 terminal" id="weblog" name="weblog" wrap="off" readonly></textarea>
  1004. <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>
  1005. </div>
  1006. </fieldset>
  1007. </div>
  1008. </div>
  1009. </form>
  1010. <!-- removeIf(!sensor) -->
  1011. <form id="form-sns" class="pure-form form-settings">
  1012. <div class="panel" id="panel-sns">
  1013. <div class="header">
  1014. <h1>SENSOR CONFIGURATION</h1>
  1015. <h2>
  1016. Configure and calibrate your device sensors.
  1017. </h2>
  1018. </div>
  1019. <div class="page">
  1020. <fieldset>
  1021. <legend>General</legend>
  1022. <div class="pure-g">
  1023. <label class="pure-u-1 pure-u-lg-1-4">Read interval</label>
  1024. <select class="pure-u-1 pure-u-lg-1-4" name="snsRead">
  1025. <option value="1">1 second</option>
  1026. <option value="6">6 seconds</option>
  1027. <option value="10">10 seconds</option>
  1028. <option value="15">15 seconds</option>
  1029. <option value="30">30 seconds</option>
  1030. <option value="60">1 minute</option>
  1031. <option value="300">5 minutes</option>
  1032. <option value="600">10 minutes</option>
  1033. <option value="900">15 minutes</option>
  1034. <option value="1800">30 minutes</option>
  1035. <option value="3600">60 minutes</option>
  1036. </select>
  1037. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1038. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1039. <div class="pure-u-1 pure-u-lg-3-4 hint">
  1040. Select the interval between readings. These will be filtered and averaged for the report.
  1041. Please mind some sensors do not have fast refresh intervals. Check the sensor datasheet to know the minimum read interval.
  1042. The default and recommended value is 6 seconds.
  1043. </div>
  1044. </div>
  1045. <div class="pure-g">
  1046. <label class="pure-u-1 pure-u-lg-1-4">Report every</label>
  1047. <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>
  1048. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1049. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1050. <div class="pure-u-1 pure-u-lg-3-4 hint">
  1051. Select the number of readings to average and report
  1052. </div>
  1053. </div>
  1054. <div class="pure-g module module-pwr">
  1055. <label class="pure-u-1 pure-u-lg-1-4">Save every</label>
  1056. <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>
  1057. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1058. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1059. <div class="pure-u-1 pure-u-lg-3-4 hint">
  1060. Save aggregated data to EEPROM after these many reports. At the moment this only applies to total energy readings.
  1061. Please mind: saving data to EEPROM too often will wear out the flash memory quickly.
  1062. Set it to 0 to disable this feature (default value).
  1063. </div>
  1064. </div>
  1065. <div class="pure-g module module-pwr">
  1066. <label class="pure-u-1 pure-u-lg-1-4">Power units</label>
  1067. <select name="pwrUnits" tabindex="16" class="pure-u-1 pure-u-lg-1-4">
  1068. <option value="0">Watts (W)</option>
  1069. <option value="1">Kilowatts (kW)</option>
  1070. </select>
  1071. </div>
  1072. <div class="pure-g module module-pwr">
  1073. <label class="pure-u-1 pure-u-lg-1-4">Energy units</label>
  1074. <select name="eneUnits" tabindex="16" class="pure-u-1 pure-u-lg-1-4">
  1075. <option value="0">Joules (J)</option>
  1076. <option value="1">Kilowatts·hour (kWh)</option>
  1077. </select>
  1078. </div>
  1079. <div class="pure-g module module-temperature">
  1080. <label class="pure-u-1 pure-u-lg-1-4">Temperature units</label>
  1081. <select name="tmpUnits" tabindex="16" class="pure-u-1 pure-u-lg-1-4">
  1082. <option value="0">Celsius (&deg;C)</option>
  1083. <option value="1">Fahrenheit (&deg;F)</option>
  1084. </select>
  1085. </div>
  1086. <div class="pure-g module module-temperature">
  1087. <label class="pure-u-1 pure-u-lg-1-4">Temperature correction</label>
  1088. <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" />
  1089. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1090. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1091. <div class="pure-u-1 pure-u-lg-3-4 hint">
  1092. Temperature correction value is added to the measured value which may be inaccurate due to many factors. The value can be negative.
  1093. </div>
  1094. </div>
  1095. <div class="pure-g module module-humidity">
  1096. <label class="pure-u-1 pure-u-lg-1-4">Humidity correction</label>
  1097. <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" />
  1098. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1099. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1100. <div class="pure-u-1 pure-u-lg-3-4 hint">
  1101. Humidity correction value is added to the measured value which may be inaccurate due to many factors. The value can be negative.
  1102. </div>
  1103. </div>
  1104. <div class="pure-g module module-mics">
  1105. <label class="pure-u-1 pure-u-lg-1-4">Calibrate gas sensor</label>
  1106. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="snsResetCalibration" tabindex="55" /></div>
  1107. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1108. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1109. <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>
  1110. </div>
  1111. <legend class="module module-hlw module-cse module-emon">Energy monitor</legend>
  1112. <div class="pure-g module module-emon">
  1113. <label class="pure-u-1 pure-u-lg-1-4">Voltage</label>
  1114. <input class="pure-u-1 pure-u-lg-3-4" name="pwrVoltage" type="text" tabindex="51" />
  1115. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1116. <div class="pure-u-1 pure-u-lg-3-4 hint">Mains voltage in your system (in V).</div>
  1117. </div>
  1118. <div class="pure-g module module-hlw module-cse">
  1119. <label class="pure-u-1 pure-u-lg-1-4">Expected Current</label>
  1120. <input class="pure-u-1 pure-u-lg-3-4 pwrExpected" name="pwrExpectedC" type="text" tabindex="52" placeholder="0" />
  1121. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1122. <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>
  1123. </div>
  1124. <div class="pure-g module module-hlw module-cse">
  1125. <label class="pure-u-1 pure-u-lg-1-4">Expected Voltage</label>
  1126. <input class="pure-u-1 pure-u-lg-3-4 pwrExpected" name="pwrExpectedV" type="text" tabindex="53" placeholder="0" />
  1127. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1128. <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>
  1129. </div>
  1130. <div class="pure-g module module-hlw module-cse module-emon">
  1131. <label class="pure-u-1 pure-u-lg-1-4">Expected Power</label>
  1132. <input class="pure-u-1 pure-u-lg-3-4 pwrExpected" name="pwrExpectedP" type="text" tabindex="54" placeholder="0" />
  1133. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1134. <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>
  1135. </div>
  1136. <div class="pure-g module module-pm">
  1137. <label class="pure-u-1 pure-u-lg-1-4">Energy Ratio</label>
  1138. <input class="pure-u-1 pure-u-lg-3-4" name="pwrRatioE" type="text" tabindex="55" placeholder="0" />
  1139. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1140. <div class="pure-u-1 pure-u-lg-3-4 hint">Energy ratio in pulses/kWh.</div>
  1141. </div>
  1142. <div class="pure-g module module-hlw module-cse module-emon">
  1143. <label class="pure-u-1 pure-u-lg-1-4">Reset calibration</label>
  1144. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="pwrResetCalibration" tabindex="56" /></div>
  1145. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1146. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1147. <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>
  1148. </div>
  1149. <div class="pure-g module module-hlw module-cse module-emon module-pm">
  1150. <label class="pure-u-1 pure-u-lg-1-4">Reset energy</label>
  1151. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="pwrResetE" tabindex="57" /></div>
  1152. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1153. <div class="pure-u-0 pure-u-lg-1-4"></div>
  1154. <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>
  1155. </div>
  1156. </fieldset>
  1157. </div>
  1158. </div>
  1159. </form>
  1160. <!-- endRemoveIf(!sensor) -->
  1161. <!-- removeIf(!rfbridge) -->
  1162. <form id="form-rfb" class="pure-form form-settings">
  1163. <div class="panel" id="panel-rfb">
  1164. <div class="header">
  1165. <h1>RADIO FREQUENCY</h1>
  1166. <h2>
  1167. Sonoff 433 RF Bridge &amp; RF Link Configuration<br /><br />
  1168. This page allows you to configure the RF codes for the Sonoff RFBridge 433 and also for a basic RF receiver.<br /><br />
  1169. 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 />
  1170. 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 />
  1171. Delete any code clicking the <strong>FORGET</strong> button.
  1172. <span class="module module-rfbraw"><br /><br />You can also specify 116-chars long RAW codes. Raw codes require a <a rel="noopener" target="_blank" href="https://github.com/rhx/RF-Bridge-EFM8BB1">specific firmware for for the EFM8BB1</a>.</span>
  1173. </h2>
  1174. </div>
  1175. <div class="page">
  1176. <fieldset>
  1177. <div id="rfbNodes"></div>
  1178. </fieldset>
  1179. </div>
  1180. </div>
  1181. </form>
  1182. <!-- endRemoveIf(!rfbridge) -->
  1183. <!-- removeIf(!lightfox) -->
  1184. <form id="form-lightfox" class="pure-form form-settings">
  1185. <div class="panel" id="panel-lightfox">
  1186. <div class="header">
  1187. <h1>LIGHTFOX RF</h1>
  1188. <h2>
  1189. LightFox RF configuration<br /><br />
  1190. This page allows you to control LightFox RF receiver options.<br /><br />
  1191. 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 />
  1192. Delete all the codes by clicking the <strong>CLEAR</strong> button and wait for 10 seconds.<br /><br />
  1193. You can also specify which RF button controls which relay using controls below.
  1194. </h2>
  1195. </div>
  1196. <div class="page">
  1197. <div class="pure-g">
  1198. <label class="pure-u-1 pure-u-lg-1-4">RF Actions</label>
  1199. <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>
  1200. <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>
  1201. </div>
  1202. <fieldset id="lightfoxNodes"></fieldset>
  1203. </div>
  1204. </div>
  1205. </form>
  1206. <!-- endRemoveIf(!lightfox) -->
  1207. </div> <!-- content -->
  1208. </div> <!-- layout -->
  1209. <!-- Templates -->
  1210. <div id="ledConfigTemplate" class="template">
  1211. <div class="pure-g">
  1212. <label class="pure-u-1 pure-u-lg-1-4">LED #<span class="id"></span> mode</label>
  1213. <select name="ledMode" class="pure-u-1-4">
  1214. <option value="1">WiFi status</option>
  1215. <option value="2">Follow switch #</option>
  1216. <option value="3">Inverse switch #</option>
  1217. <option value="4">Find me</option>
  1218. <option value="5">Find me &amp; WiFi</option>
  1219. <option value="8">Switches status</option>
  1220. <option value="9">Switches &amp; WiFi</option>
  1221. <option value="0">MQTT managed</option>
  1222. <option value="6">Always ON</option>
  1223. <option value="7">Always OFF</option>
  1224. </select>
  1225. &nbsp;
  1226. <div class="pure-u-1-4"><input class="pure-u-23-24" name="ledRelay" type="number" min="0" data="0" /></div>
  1227. </div>
  1228. </div>
  1229. <!-- removeIf(!rfbridge) -->
  1230. <div id="rfbNodeTemplate" class="template">
  1231. <legend>Switch #<span></span></legend>
  1232. <div class="pure-g">
  1233. <div class="pure-u-1 pure-u-lg-1-4"><label>Switch ON</label></div>
  1234. <input class="pure-u-1 pure-u-lg-1-3" type="text" maxlength="18" name="rfbcode" data-id="1" data-status="1" />
  1235. <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>
  1236. <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>
  1237. <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>
  1238. </div>
  1239. <div class="pure-g">
  1240. <div class="pure-u-1 pure-u-lg-1-4"><label>Switch OFF</label></div>
  1241. <input class="pure-u-1 pure-u-lg-1-3" type="text" maxlength="18" name="rfbcode" data-id="1" data-status="0" />
  1242. <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>
  1243. <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>
  1244. <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>
  1245. </div>
  1246. </div>
  1247. <!-- endRemoveIf(!rfbridge) -->
  1248. <!-- removeIf(!lightfox) -->
  1249. <div id="lightfoxNodeTemplate" class="template">
  1250. <div class="pure-g">
  1251. <label class="pure-u-1 pure-u-lg-1-4">Button #<span></span></label>
  1252. <select class="pure-u-1 pure-u-lg-3-4" name="btnRelay" action="reboot"></select>
  1253. </div>
  1254. </div>
  1255. <!-- endRemoveIf(!lightfox) -->
  1256. <div id="networkTemplate" class="template">
  1257. <div class="pure-g">
  1258. <label class="pure-u-1 pure-u-lg-1-4">Network SSID</label>
  1259. <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>
  1260. <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>
  1261. <label class="pure-u-1 pure-u-lg-1-4 more">Password</label>
  1262. <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" />
  1263. <span class="no-select password-reveal more"></span>
  1264. <label class="pure-u-1 pure-u-lg-1-4 more">Static IP</label>
  1265. <input class="pure-u-1 pure-u-lg-3-4 more" name="ip" type="text" action="reconnect" value="" maxlength="15" tabindex="0" autocomplete="false" />
  1266. <div class="pure-u-0 pure-u-lg-1-4 more"></div>
  1267. <div class="pure-u-1 pure-u-lg-3-4 hint more">Leave empty for DHCP negotiation</div>
  1268. <label class="pure-u-1 pure-u-lg-1-4 more">Gateway IP</label>
  1269. <input class="pure-u-1 pure-u-lg-3-4 more" name="gw" type="text" action="reconnect" value="" maxlength="15" tabindex="0" autocomplete="false" />
  1270. <div class="pure-u-0 pure-u-lg-1-4 more"></div>
  1271. <div class="pure-u-1 pure-u-lg-3-4 hint more">Set when using a static IP</div>
  1272. <label class="pure-u-1 pure-u-lg-1-4 more">Network Mask</label>
  1273. <input class="pure-u-1 pure-u-lg-3-4 more" name="mask" type="text" action="reconnect" value="255.255.255.0" maxlength="15" tabindex="0" autocomplete="false" />
  1274. <div class="pure-u-0 pure-u-lg-1-4 more"></div>
  1275. <div class="pure-u-1 pure-u-lg-3-4 hint more">Usually 255.255.255.0 for /24 networks</div>
  1276. <label class="pure-u-1 pure-u-lg-1-4 more">DNS IP</label>
  1277. <input class="pure-u-1 pure-u-lg-3-4 more" name="dns" type="text" action="reconnect" value="8.8.8.8" maxlength="15" tabindex="0" autocomplete="false" />
  1278. <div class="pure-u-0 pure-u-lg-1-4 more"></div>
  1279. <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>
  1280. <div class="pure-u-0 pure-u-lg-1-4 more"></div>
  1281. <button class="pure-button button-del-network more" type="button">Delete network</button>
  1282. </div>
  1283. </div>
  1284. <div id="scheduleTemplate" class="template">
  1285. <div class="pure-g">
  1286. <label class="pure-u-1 pure-u-lg-1-4">When time is</label>
  1287. <div class="pure-u-1-4 pure-u-lg-1-5">
  1288. <input class="pure-u-2-3" name="schHour" type="number" min="0" step="1" max="23" value="0" />
  1289. <div class="pure-u-1-4 hint center">&nbsp;h</div>
  1290. </div>
  1291. <div class="pure-u-1-4 pure-u-lg-1-5">
  1292. <input class="pure-u-2-3" name="schMinute" type="number" min="0" step="1" max="59" value="0" />
  1293. <div class="pure-u-1-4 hint center">&nbsp;m</div>
  1294. </div>
  1295. <div class="pure-u-0 pure-u-lg-1-3"></div>
  1296. <label class="pure-u-1 pure-u-lg-1-4">Use UTC time</label>
  1297. <div class="pure-u-1 pure-u-lg-3-4"><input type="checkbox" name="schUTC" /></div>
  1298. <div class="pure-u-0 pure-u-lg-1-2"></div>
  1299. <label class="pure-u-1 pure-u-lg-1-4">And weekday is one of</label>
  1300. <div class="pure-u-2-5 pure-u-lg-1-5">
  1301. <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" />
  1302. </div>
  1303. <div class="pure-u-3-5 pure-u-lg-1-2 hint center">&nbsp;1 for Monday, 2 for Tuesday...</div>
  1304. <div id="schActionDiv" class="pure-u-1">
  1305. </div>
  1306. <label class="pure-u-1 pure-u-lg-1-4">Enabled</label>
  1307. <div class="pure-u-1 pure-u-lg-3-4"><input type="checkbox" name="schEnabled" /></div>
  1308. <div class="pure-u-1 pure-u-lg-1-2"></div>
  1309. <button class="pure-button button-del-schedule" type="button">Delete schedule</button>
  1310. </div>
  1311. </div>
  1312. <div id="switchActionTemplate" class="template">
  1313. <label class="pure-u-1 pure-u-lg-1-4">Action</label>
  1314. <div class="pure-u-1 pure-u-lg-1-5">
  1315. <select class="pure-u-1 pure-u-lg-23-24" name="schAction">
  1316. <option value="0">Turn OFF</option>
  1317. <option value="1">Turn ON</option>
  1318. <option value="2">Toggle</option>
  1319. </select>
  1320. </div>
  1321. <select class="pure-u-1 pure-u-lg-1-5 isrelay" name="schSwitch"></select>
  1322. <input type="hidden" name="schType" value="1">
  1323. </div>
  1324. <!-- removeIf(!light) -->
  1325. <div id="lightActionTemplate" class="template">
  1326. <label class="pure-u-1 pure-u-lg-1-4">Brightness</label>
  1327. <div class="pure-u-1 pure-u-lg-1-5">
  1328. <input class="pure-u-2-3" name="schAction" type="number" min="0" step="1" max="255" value="0" />
  1329. </div>
  1330. <select class="pure-u-1 pure-u-lg-1-5 islight" name="schSwitch"></select>
  1331. <input type="hidden" name="schType" value="2">
  1332. </div>
  1333. <!-- endRemoveIf(!light) -->
  1334. <div id="relayTemplate" class="template">
  1335. <div class="pure-g">
  1336. <label class="pure-u-1 pure-u-lg-1-4">Switch #<span class="id"></span></label>
  1337. <div><input name="relay" type="checkbox" on="ON" off="OFF" /></div>
  1338. </div>
  1339. </div>
  1340. <div id="relayConfigTemplate" class="template">
  1341. <legend>Switch #<span class="id"></span> (<span class="gpio"></span>)</legend>
  1342. <div class="pure-g">
  1343. <div class="pure-u-1 pure-u-lg-1-4"><label>Boot mode</label></div>
  1344. <select class="pure-u-1 pure-u-lg-3-4" name="relayBoot">
  1345. <option value="0">Always OFF</option>
  1346. <option value="1">Always ON</option>
  1347. <option value="2">Same as before</option>
  1348. <option value="3">Toggle before</option>
  1349. </select>
  1350. </div>
  1351. <div class="pure-g">
  1352. <div class="pure-u-1 pure-u-lg-1-4"><label>Pulse mode</label></div>
  1353. <select class="pure-u-1 pure-u-lg-3-4" name="relayPulse">
  1354. <option value="0">Don't pulse</option>
  1355. <option value="1">Normally OFF</option>
  1356. <option value="2">Normally ON</option>
  1357. </select>
  1358. </div>
  1359. <div class="pure-g">
  1360. <div class="pure-u-1 pure-u-lg-1-4"><label>Pulse time (s)</label></div>
  1361. <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>
  1362. </div>
  1363. <div class="pure-g module module-mqtt">
  1364. <div class="pure-u-1 pure-u-lg-1-4"><label>MQTT group</label></div>
  1365. <div class="pure-u-1 pure-u-lg-3-4"><input name="mqttGroup" class="pure-u-1" tabindex="0" data="0" action="reconnect" /></div>
  1366. </div>
  1367. <div class="pure-g module module-mqtt">
  1368. <div class="pure-u-1 pure-u-lg-1-4"><label>MQTT group sync</label></div>
  1369. <select class="pure-u-1 pure-u-lg-3-4" name="mqttGroupSync">
  1370. <option value="0">Same</option>
  1371. <option value="1">Inverse</option>
  1372. <option value="2">Receive Only</option>
  1373. </select>
  1374. </div>
  1375. <div class="pure-g module module-mqtt">
  1376. <div class="pure-u-1 pure-u-lg-1-4"><label>On MQTT disconnect</label></div>
  1377. <select class="pure-u-1 pure-u-lg-3-4" name="relayOnDisc">
  1378. <option value="0">Don't change</option>
  1379. <option value="1">Turn the switch OFF</option>
  1380. <option value="2">Turn the switch ON</option>
  1381. </select>
  1382. </div>
  1383. </div>
  1384. <div id="dczRelayTemplate" class="template">
  1385. <div class="pure-g">
  1386. <label class="pure-u-1 pure-u-lg-1-4">Switch</label>
  1387. <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>
  1388. </div>
  1389. </div>
  1390. <!-- removeIf(!sensor) -->
  1391. <div id="dczMagnitudeTemplate" class="template">
  1392. <div class="pure-g">
  1393. <label class="pure-u-1 pure-u-lg-1-4">Magnitude</label>
  1394. <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>
  1395. <div class="pure-u-1 pure-u-lg-1-2 hint center"></div>
  1396. </div>
  1397. </div>
  1398. <!-- endRemoveIf(!sensor) -->
  1399. <div id="tspkRelayTemplate" class="template">
  1400. <div class="pure-g">
  1401. <label class="pure-u-1 pure-u-lg-1-4">Switch</label>
  1402. <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>
  1403. </div>
  1404. </div>
  1405. <!-- removeIf(!sensor) -->
  1406. <div id="tspkMagnitudeTemplate" class="template">
  1407. <div class="pure-g">
  1408. <label class="pure-u-1 pure-u-lg-1-4">Magnitude</label>
  1409. <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>
  1410. <div class="pure-u-1 pure-u-lg-1-2 hint center"></div>
  1411. </div>
  1412. </div>
  1413. <!-- endRemoveIf(!sensor) -->
  1414. <!-- removeIf(!light) -->
  1415. <div id="colorTemplate" class="template">
  1416. <div class="pure-g">
  1417. <label class="pure-u-1 pure-u-lg-1-4">Color</label>
  1418. <input class="pure-u-1 pure-u-lg-1-4" data-wcp-layout="block" name="color" readonly />
  1419. </div>
  1420. </div>
  1421. <div id="brightnessTemplate" class="template">
  1422. <div class="pure-g">
  1423. <label class="pure-u-1 pure-u-lg-1-4">Brightness</label>
  1424. <input type="range" min="0" max="255" class="slider pure-u-lg-1-4" id="brightness">
  1425. <span class="slider brightness pure-u-lg-1-4"></span>
  1426. </div>
  1427. </div>
  1428. <div id="channelTemplate" class="template">
  1429. <div class="pure-g">
  1430. <label class="pure-u-1 pure-u-lg-1-4">Channel #</label>
  1431. <input type="range" min="0" max="255" class="slider channels pure-u-lg-1-4" data="99">
  1432. <span class="slider pure-u-lg-1-4"></span>
  1433. </div>
  1434. </div>
  1435. <div id="miredsTemplate" class="template">
  1436. <div class="pure-g">
  1437. <label class="pure-u-1 pure-u-lg-1-4">Mireds (Cold &harr; Warm)</label>
  1438. <input type="range" min="153" max="500" class="slider pure-u-lg-1-4" id="mireds">
  1439. <span class="slider mireds pure-u-lg-1-4"></span>
  1440. </div>
  1441. </div>
  1442. <!-- endRemoveIf(!light) -->
  1443. <!-- removeIf(!sensor) -->
  1444. <div id="magnitudeTemplate" class="template">
  1445. <div class="pure-g">
  1446. <label class="pure-u-1 pure-u-lg-1-4"></label>
  1447. <div class="pure-u-1 pure-u-lg-1-4">
  1448. <input class="pure-u-1 pure-u-lg-23-24 center" type="text" name="magnitude" data="256" readonly />
  1449. </div>
  1450. <div class="pure-u-1 pure-u-lg-1-2 hint center"></div>
  1451. </div>
  1452. </div>
  1453. <!-- endRemoveIf(!sensor) -->
  1454. <!-- removeIf(!rfm69) -->
  1455. <div id="nodeTemplate" class="template">
  1456. <div class="pure-g">
  1457. <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>
  1458. <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>
  1459. <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>
  1460. <div class="pure-u-md-1-6 pure-u-1-4"><button type="button" class="pure-button button-del-mapping pure-u-5-6 pure-u-md-5-6">Del</button></div>
  1461. </div>
  1462. </div>
  1463. <!-- endRemoveIf(!rfm69) -->
  1464. <iframe id="downloader"></iframe>
  1465. <input id="uploader" type="file" />
  1466. </body>
  1467. <!-- build:js script.js -->
  1468. <script src="vendor/jquery-3.2.1.min.js"></script>
  1469. <script src="custom.js"></script>
  1470. <!-- removeIf(!light) -->
  1471. <script src="vendor/jquery.wheelcolorpicker-3.0.3.min.js"></script>
  1472. <!-- endRemoveIf(!light) -->
  1473. <!-- removeIf(!rfm69) -->
  1474. <script src="vendor/datatables-1.10.16.min.js"></script>
  1475. <!-- endRemoveIf(!rfm69) -->
  1476. <!-- endbuild -->
  1477. </html>