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.

1337 lines
80 KiB

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