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.

1425 lines
84 KiB

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