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.

1613 lines
95 KiB

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