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.

1716 lines
102 KiB

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