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.

1244 lines
73 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
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
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-relay">
  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-idb">
  88. <a href="#" class="pure-menu-link" data="panel-idb">INFLUXDB</a>
  89. </li>
  90. <li class="pure-menu-item module module-tspk">
  91. <a href="#" class="pure-menu-link" data="panel-thingspeak">THINGSPEAK</a>
  92. </li>
  93. <li class="pure-menu-item module module-rfb">
  94. <a href="#" class="pure-menu-link" data="panel-rfb">RFBRIDGE</a>
  95. </li>
  96. <li class="pure-menu-item">
  97. <a href="#" class="pure-menu-link" data="panel-admin">ADMIN</a>
  98. </li>
  99. </ul>
  100. <div class="main-buttons">
  101. <button class="pure-button button-update">Save</button>
  102. <button class="pure-button button-reconnect">Reconnect</button>
  103. <button class="pure-button button-reboot">Reboot</button>
  104. </div>
  105. <div class="footer">
  106. &copy; 2016-2018<br />
  107. Xose Pérez<br/>
  108. <a href="http://tinkerman.cat" target="_blank">http://tinkerman.cat</a><br/>
  109. <a href="https://github.com/xoseperez/espurna" target="_blank">ESPurna @ GitHub</a><br/>
  110. GPLv3 license<br/>
  111. </div>
  112. </div>
  113. </div>
  114. <div class="content">
  115. <div class="panel block" id="panel-status">
  116. <div class="header">
  117. <h1>STATUS</h1>
  118. <h2>Current configuration</h2>
  119. </div>
  120. <div class="page">
  121. <form class="pure-form pure-form-aligned">
  122. <fieldset>
  123. <div id="relays"></div>
  124. <div id="colors"></div>
  125. <div id="channels"></div>
  126. <div id="magnitudes"></div>
  127. <div class="pure-u-1 state">
  128. <div class="pure-u-1-2 pure-u-lg-1-4">Manufacturer</div>
  129. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="manufacturer"></span></div>
  130. <div class="pure-u-1-2 pure-u-lg-1-4">Device</div>
  131. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="device"></span></div>
  132. <div class="pure-u-1-2 pure-u-lg-1-4">Chip ID</div>
  133. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="chipid"></span></div>
  134. <div class="pure-u-1-2 pure-u-lg-1-4">MAC</div>
  135. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="mac"></span></div>
  136. <div class="pure-u-1-2 pure-u-lg-1-4">Network</div>
  137. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="network"></span></div>
  138. <div class="pure-u-1-2 pure-u-lg-1-4">BSSID</div>
  139. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="bssid"></span></div>
  140. <div class="pure-u-1-2 pure-u-lg-1-4">Channel</div>
  141. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="channel"></span></div>
  142. <div class="pure-u-1-2 pure-u-lg-1-4">RSSI</div>
  143. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="rssi"></span> (<span name="distance" post="m"></span>)</div>
  144. <div class="pure-u-1-2 pure-u-lg-1-4">IP</div>
  145. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="deviceip"></span></div>
  146. <div class="pure-u-1-2 pure-u-lg-1-4">Firmware name</div>
  147. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="app_name"></span></div>
  148. <div class="pure-u-1-2 pure-u-lg-1-4">Firmware version</div>
  149. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="app_version"></span></div>
  150. <div class="pure-u-1-2 pure-u-lg-1-4">Firmware build</div>
  151. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="app_build"></span></div>
  152. <div class="pure-u-1-2 pure-u-lg-1-4">Current time</div>
  153. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="now"></span></div>
  154. <div class="pure-u-1-2 pure-u-lg-1-4">Uptime</div>
  155. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="uptime"></span></div>
  156. <div class="pure-u-1-2 pure-u-lg-1-4">Free heap</div>
  157. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="heap" post=" bytes"></span></div>
  158. <div class="pure-u-1-2 pure-u-lg-1-4">Firmware size</div>
  159. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="sketch_size" post=" bytes"></span></div>
  160. <div class="pure-u-1-2 pure-u-lg-1-4">Free space</div>
  161. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="free_size" post=" bytes"></span></div>
  162. <div class="pure-u-1-2 pure-u-lg-1-4">MQTT Status</div>
  163. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="mqttStatus">NOT AVAILABLE</span></div>
  164. <div class="pure-u-1-2 pure-u-lg-1-4">NTP Status</div>
  165. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="ntpStatus">NOT AVAILABLE</span></div>
  166. <div class="pure-u-1-2 pure-u-lg-1-4">Last update</div>
  167. <div class="pure-u-11-24 pure-u-lg-17-24"><span class="right" name="ago">?</span><span> seconds ago</span></div>
  168. </div>
  169. </fieldset>
  170. </form>
  171. </div>
  172. </div>
  173. <form id="formSave" class="pure-form" action="/" method="post" enctype="multipart/form-data">
  174. <div class="panel" id="panel-general">
  175. <div class="header">
  176. <h1>GENERAL</h1>
  177. <h2>General configuration values</h2>
  178. </div>
  179. <div class="page">
  180. <fieldset>
  181. <div class="pure-g">
  182. <label class="pure-u-1 pure-u-lg-1-4">Hostname</label>
  183. <input name="hostname" class="pure-u-1 pure-u-lg-1-4" maxlength="14" type="text" action="reboot" tabindex="1" />
  184. <div class="pure-u-0 pure-u-lg-1-2"></div>
  185. <div class="pure-u-0 pure-u-lg-1-4"></div>
  186. <div class="pure-u-1 pure-u-lg-3-4 hint">
  187. 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 clicking the "Reconnect" button.
  188. </div>
  189. </div>
  190. <div class="pure-g">
  191. <label class="pure-u-1 pure-u-lg-1-4">Double click delay</label>
  192. <input name="btnDelay" class="pure-u-1 pure-u-lg-1-4" type="number" action="reboot" min="0" step="100" max="1000" tabindex="6" />
  193. <div class="pure-u-0 pure-u-lg-1-2"></div>
  194. <div class="pure-u-0 pure-u-lg-1-4"></div>
  195. <div class="pure-u-1 pure-u-lg-3-4 hint">
  196. Delay in milliseconds to detect a double click (from 0 to 1000ms).<br />
  197. The lower this number the faster the device will respond to button clicks but the harder it will be to get a double click.
  198. Increase this number if you are having trouble to double click the button.
  199. 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 />
  200. You will have to <strong>reboot the device</strong> after updating for this setting to apply.
  201. </div>
  202. </div>
  203. <div class="pure-g module module-led">
  204. <label class="pure-u-1 pure-u-lg-1-4">LED mode</label>
  205. <select name="ledMode0" class="pure-u-1 pure-u-lg-1-4" tabindex="7">
  206. <option value="1">WiFi status</option>
  207. <option value="0">MQTT managed</option>
  208. <option value="4">Find me</option>
  209. <option value="5">Mixed</option>
  210. <option value="6">Always ON</option>
  211. <option value="7">Always OFF</option>
  212. </select>
  213. <div class="pure-u-0 pure-u-lg-1-2"></div>
  214. <div class="pure-u-0 pure-u-lg-1-4"></div>
  215. <div class="pure-u-1 pure-u-lg-3-4 hint">
  216. This setting defines the behaviour of the main LED in the board.<br />
  217. When in "WiFi status" it will blink at 1Hz when trying to connecting. If successfully connected if will briefly lit every 5 seconds if in STA mode or every second if in AP mode.<br />
  218. 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 />
  219. When in "Find me" mode the LED will be ON when all relays are OFF. This is meant to locate switches at night.<br />
  220. When in "Mixed" mode 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 />
  221. "Always ON" and "Always OFF" modes are self-explanatory.
  222. </div>
  223. </div>
  224. <div class="pure-g module module-alexa">
  225. <label class="pure-u-1 pure-u-lg-1-4">Alexa integration</label>
  226. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="alexaEnabled" tabindex="13" /></div>
  227. </div>
  228. <div class="pure-g module module-ha">
  229. <label class="pure-u-1 pure-u-lg-1-4">Home Assistant</label>
  230. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="haEnabled" tabindex="14" /></div>
  231. <div class="pure-u-0 pure-u-lg-1-2"></div>
  232. <div class="pure-u-0 pure-u-lg-1-4"></div>
  233. <div class="pure-u-1 pure-u-lg-3-4 hint">
  234. Home Assistant auto-discovery feature. Enable and save to add the device to your HA console.
  235. When using a colour light you might want to disable CSS style so Home Assistant can parse the color.
  236. </div>
  237. </div>
  238. <div class="pure-g module module-ha">
  239. <label class="pure-u-1 pure-u-lg-1-4">Home Assistant Prefix</label>
  240. <input class="pure-u-1 pure-u-lg-1-4" name="haPrefix" type="text" tabindex="15" />
  241. </div>
  242. </fieldset>
  243. </div>
  244. </div>
  245. <div class="panel" id="panel-relay">
  246. <div class="header">
  247. <h1>SWITCHES</h1>
  248. <h2>Switch / relay configuration</h2>
  249. </div>
  250. <div class="page">
  251. <fieldset>
  252. <legend class="module module-multirelay">General</legend>
  253. <div class="pure-g module module-multirelay">
  254. <label class="pure-u-1 pure-u-lg-1-4">Switch sync mode</label>
  255. <select name="relaySync" class="pure-u-1 pure-u-lg-3-4" tabindex="3">
  256. <option value="0">No synchronisation</option>
  257. <option value="1">Zero or one switches active</option>
  258. <option value="2">One and just one switch active</option>
  259. <option value="3">All synchronised</option>
  260. </select>
  261. <div class="pure-u-0 pure-u-lg-1-4"></div>
  262. <div class="pure-u-1 pure-u-lg-3-4 hint">Define how the different switches should be synchronized.</div>
  263. </div>
  264. <div id="relayConfig"></div>
  265. </fieldset>
  266. </div>
  267. </div>
  268. <div class="panel" id="panel-color">
  269. <div class="header">
  270. <h1>LIGHTS</h1>
  271. <h2>Lights configuration</h2>
  272. </div>
  273. <div class="page">
  274. <fieldset>
  275. <div class="pure-g">
  276. <label class="pure-u-1 pure-u-lg-1-4">Use colorpicker</label>
  277. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useColor" action="reload" tabindex="8" /></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 color picker for the first 3 channels as RGB.<br />Will only work if the device has at least 3 dimmable channels.<br />Reload the page to update the web interface.</div>
  281. </div>
  282. <div class="pure-g">
  283. <label class="pure-u-1 pure-u-lg-1-4">Use RGB picker</label>
  284. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useRGB" action="reload" tabindex="11" /></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 RGB color picker if enabled (plus brightness), otherwise use HSV (hue-saturation-value) style</div>
  288. </div>
  289. <div class="pure-g">
  290. <label class="pure-u-1 pure-u-lg-1-4">Use white channel</label>
  291. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useWhite" action="reload" tabindex="9" /></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 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>
  295. </div>
  296. <div class="pure-g">
  297. <label class="pure-u-1 pure-u-lg-1-4">Use gamma correction</label>
  298. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useGamma" tabindex="10" /></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 gamma correction for RGB channels.<br />Will only work if "use colorpicker" above is also ON.</div>
  302. </div>
  303. <div class="pure-g">
  304. <label class="pure-u-1 pure-u-lg-1-4">Use CSS style</label>
  305. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useCSS" tabindex="11" /></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">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>
  309. </div>
  310. <div class="pure-g">
  311. <label class="pure-u-1 pure-u-lg-1-4">Color transitions</label>
  312. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="useTransitions" tabindex="12" /></div>
  313. <div class="pure-u-0 pure-u-lg-1-2"></div>
  314. <div class="pure-u-0 pure-u-lg-1-4"></div>
  315. <div class="pure-u-1 pure-u-lg-3-4 hint">If enabled color changes will be smoothed.</div>
  316. </div>
  317. <div class="pure-g">
  318. <div class="pure-u-1 pure-u-lg-1-4"><label>MQTT group</label></div>
  319. <div class="pure-u-1 pure-u-lg-3-4"><input name="mqttGroupColor" class="pure-u-1" tabindex="13" action="reconnect" /></div>
  320. <div class="pure-u-0 pure-u-lg-1-4"></div>
  321. <div class="pure-u-1 pure-u-lg-3-4 hint">Sync color between different lights.</div>
  322. </div>
  323. </fieldset>
  324. </div>
  325. </div>
  326. <div class="panel" id="panel-admin">
  327. <div class="header">
  328. <h1>ADMINISTRATION</h1>
  329. <h2>Device administration and security settings</h2>
  330. </div>
  331. <div class="page">
  332. <fieldset>
  333. <div class="pure-g">
  334. <label class="pure-u-1 pure-u-lg-1-4">Admin password</label>
  335. <input name="adminPass" class="pure-u-1 pure-u-lg-3-4" type="password" action="reboot" tabindex="11" autocomplete="false" />
  336. <div class="pure-u-0 pure-u-lg-1-4"></div>
  337. <div class="pure-u-1 pure-u-lg-3-4 hint">
  338. 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 />
  339. 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>
  340. </div>
  341. <div class="pure-g">
  342. <label class="pure-u-1 pure-u-lg-1-4">Repeat password</label>
  343. <input name="adminPass" class="pure-u-1 pure-u-lg-3-4" type="password" action="reboot" tabindex="12" autocomplete="false" />
  344. </div>
  345. <div class="pure-g">
  346. <label class="pure-u-1 pure-u-lg-1-4">HTTP port</label>
  347. <input name="webPort" class="pure-u-1 pure-u-lg-1-4" type="text" action="reboot" tabindex="13" />
  348. <div class="pure-u-0 pure-u-lg-1-2"></div>
  349. <div class="pure-u-0 pure-u-lg-1-4"></div>
  350. <div class="pure-u-1 pure-u-lg-3-4 hint">
  351. This is the port for the web interface and API requests.
  352. If different than 80 (standard HTTP port) you will have to add it explicitly to your requests: http://myip:myport/
  353. </div>
  354. </div>
  355. <div class="pure-g">
  356. <label class="pure-u-1 pure-u-lg-1-4">Enable HTTP API</label>
  357. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="apiEnabled" /></div>
  358. </div>
  359. <div class="pure-g">
  360. <label class="pure-u-1 pure-u-lg-1-4">Real time API</label>
  361. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="apiRealTime" /></div>
  362. <div class="pure-u-0 pure-u-lg-1-2"></div>
  363. <div class="pure-u-0 pure-u-lg-1-4"></div>
  364. <div class="pure-u-1 pure-u-lg-3-4 hint">
  365. By default, some magnitudes are being preprocessed and filtered to avoid spurious values.
  366. If you want to get real-time values (not preprocessed) in the API turn on this setting.
  367. </div>
  368. </div>
  369. <div class="pure-g">
  370. <label class="pure-u-1 pure-u-lg-1-4">HTTP API Key</label>
  371. <input name="apiKey" class="pure-u-3-4 pure-u-lg-1-2" type="text" tabindex="14" />
  372. <div class=" pure-u-1-4 pure-u-lg-1-4"><button class="pure-button button-apikey pure-u-23-24">Auto</button></div>
  373. <div class="pure-u-0 pure-u-lg-1-4"></div>
  374. <div class="pure-u-1 pure-u-lg-3-4 hint">
  375. This is the key you will have to pass with every HTTP request to the API, either to get or write values.
  376. All API calls must contain the <strong>apikey</strong> parameter with the value above.
  377. To know what APIs are enabled do a call to <strong>/apis</strong>.
  378. </div>
  379. </div>
  380. <div class="pure-g module module-telnet">
  381. <label class="pure-u-1 pure-u-lg-1-4">Enable TELNET</label>
  382. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="telnetSTA" /></div>
  383. <div class="pure-u-0 pure-u-lg-1-2"></div>
  384. <div class="pure-u-0 pure-u-lg-1-4"></div>
  385. <div class="pure-u-1 pure-u-lg-3-4 hint">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>
  386. </div>
  387. <div class="pure-g module module-nofuss">
  388. <label class="pure-u-1 pure-u-lg-1-4">Automatic remote updates (NoFUSS)</label>
  389. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="nofussEnabled" /></div>
  390. </div>
  391. <div class="pure-g module module-nofuss">
  392. <label class="pure-u-1 pure-u-lg-1-4">NoFUSS server</label>
  393. <input name="nofussServer" class="pure-u-1 pure-u-lg-3-4" type="text" tabindex="15" />
  394. <div class="pure-u-0 pure-u-lg-1-4"></div>
  395. <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>
  396. </div>
  397. <div class="pure-g">
  398. <label class="pure-u-1 pure-u-lg-1-4">Settings</label>
  399. <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>
  400. <div class="pure-u-1-2 pure-u-lg-1-8"><button class="pure-button button-settings-restore pure-u-1">Restore</button></div>
  401. </div>
  402. <div class="pure-g">
  403. <label class="pure-u-1 pure-u-lg-1-4">Upgrade</label>
  404. <input class="pure-u-1-2 pure-u-lg-1-2" name="filename" type="text" readonly />
  405. <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>
  406. <div class=" pure-u-1-4 pure-u-lg-1-8"><button class="pure-button button-upgrade pure-u-23-24">Upgrade</button></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 terminal" 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. A trailing slash will be added if not preset. 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;/color/set</strong> Set the color using this topic, your can either send an "#RRGGBB" value or "RRR,GGG,BBB".<br /></span>
  534. <span class="module module-color">- <strong>&lt;root&gt;/brightness/set</strong> Set the brighness using a value from 0 to 255.<br /></span>
  535. <span class="module module-color">- <strong>&lt;root&gt;/channel/#/set</strong> Set the value for a single color channel (from 0 to 255). Replace # with the channel ID (starting from 0 and up to 4 for RGBWC lights).<br /></span>
  536. <span class="module module-color">- <strong>&lt;root&gt;/mired/set</strong> Set the temperature color in mired.<br /></span>
  537. - <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 />
  538. - 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>.
  539. </div>
  540. </div>
  541. <div class="pure-g">
  542. <label class="pure-u-1 pure-u-lg-1-4">Use JSON payload</label>
  543. <div class="pure-u-1 pure-u-lg-3-4"><input type="checkbox" name="mqttUseJson" tabindex="32" /></div>
  544. <div class="pure-u-1 pure-u-lg-1-4"></div>
  545. <div class="pure-u-1 pure-u-lg-3-4 hint">
  546. All messages (except the device status) will be included in a JSON payload along with the timestamp and hostname
  547. and sent under the <strong>&lt;root&gt;/data</strong> topic.<br />
  548. Messages will be queued and sent after 100ms, so different messages could be merged into a single payload.<br />
  549. Subscribtions will still be done to single topics.
  550. </div>
  551. </div>
  552. </fieldset>
  553. </div>
  554. </div>
  555. <div class="panel" id="panel-ntp">
  556. <div class="header">
  557. <h1>NTP</h1>
  558. <h2>Configure your NTP (Network Time Protocol) servers and local configuration to keep your device time up to the second for your location.</h2>
  559. </div>
  560. <div class="page">
  561. <fieldset>
  562. <div class="pure-g">
  563. <label class="pure-u-1 pure-u-lg-1-4">Device Current Time</label>
  564. <input class="pure-u-1 pure-u-lg-3-4" name="now" type="text" readonly />
  565. </div>
  566. <div class="pure-g">
  567. <label class="pure-u-1 pure-u-lg-1-4">NTP Server</label>
  568. <input class="pure-u-1 pure-u-lg-3-4" name="ntpServer" type="text" tabindex="41" />
  569. </div>
  570. <div class="pure-g">
  571. <label class="pure-u-1 pure-u-lg-1-4">Time Zone</label>
  572. <select class="pure-u-1 pure-u-lg-1-4" name="ntpOffset" tabindex="42"></select>
  573. </div>
  574. <div class="pure-g">
  575. <label class="pure-u-1 pure-u-lg-1-4">Enable DST</label>
  576. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="ntpDST" /></div>
  577. </div>
  578. </fieldset>
  579. </div>
  580. </div>
  581. <div class="panel" id="panel-domoticz">
  582. <div class="header">
  583. <h1>DOMOTICZ</h1>
  584. <h2>
  585. Configure the connection to your Domoticz server.
  586. </h2>
  587. </div>
  588. <div class="page">
  589. <fieldset>
  590. <legend>General</legend>
  591. <div class="pure-g">
  592. <label class="pure-u-1 pure-u-lg-1-4">Enable Domoticz</label>
  593. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="dczEnabled" tabindex="30" /></div>
  594. </div>
  595. <div class="pure-g">
  596. <label class="pure-u-1 pure-u-lg-1-4">Domoticz IN Topic</label>
  597. <input class="pure-u-1 pure-u-lg-3-4" name="dczTopicIn" type="text" tabindex="31" />
  598. </div>
  599. <div class="pure-g">
  600. <label class="pure-u-1 pure-u-lg-1-4">Domoticz OUT Topic</label>
  601. <input class="pure-u-1 pure-u-lg-3-4" name="dczTopicOut" type="text" action="reconnect" tabindex="32" />
  602. </div>
  603. <legend>Sensors &amp; actuators</legend>
  604. <div class="pure-g">
  605. <div class="pure-u-1 hint">Set IDX to 0 to disable notifications from that component.</div>
  606. </div>
  607. <div id="dczRelays"></div>
  608. <div id="dczMagnitudes"></div>
  609. </fieldset>
  610. </div>
  611. </div>
  612. <div class="panel" id="panel-thingspeak">
  613. <div class="header">
  614. <h1>THINGSPEAK</h1>
  615. <h2>
  616. Send your sensors data to Thingspeak.
  617. </h2>
  618. </div>
  619. <div class="page">
  620. <fieldset>
  621. <legend>General</legend>
  622. <div class="pure-g">
  623. <label class="pure-u-1 pure-u-lg-1-4">Enable Thingspeak</label>
  624. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="tspkEnabled" tabindex="30" /></div>
  625. </div>
  626. <div class="pure-g">
  627. <label class="pure-u-1 pure-u-lg-1-4">Thingspeak API Key</label>
  628. <input class="pure-u-1 pure-u-lg-3-4" name="tspkKey" type="text" tabindex="31" />
  629. </div>
  630. <legend>Sensors &amp; actuators</legend>
  631. <div class="pure-g">
  632. <div class="pure-u-1 hint">Enter the field number to send each data to, 0 disable notifications from that component.</div>
  633. </div>
  634. <div id="tspkRelays"></div>
  635. <div id="tspkMagnitudes"></div>
  636. </fieldset>
  637. </div>
  638. </div>
  639. <div class="panel" id="panel-idb">
  640. <div class="header">
  641. <h1>INFLUXDB</h1>
  642. <h2>
  643. Configure the connection to your InfluxDB server. Leave the host field empty to disable InfluxDB connection.
  644. </h2>
  645. </div>
  646. <div class="page">
  647. <fieldset>
  648. <div class="pure-g">
  649. <label class="pure-u-1 pure-u-lg-1-4">Enable InfluxDB</label>
  650. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="idbEnabled" tabindex="40" /></div>
  651. </div>
  652. <div class="pure-g">
  653. <label class="pure-u-1 pure-u-lg-1-4">Host</label>
  654. <input class="pure-u-1 pure-u-lg-3-4" name="idbHost" type="text" tabindex="41" />
  655. </div>
  656. <div class="pure-g">
  657. <label class="pure-u-1 pure-u-lg-1-4">Port</label>
  658. <input class="pure-u-1 pure-u-lg-3-4" name="idbPort" type="text" tabindex="42" />
  659. </div>
  660. <div class="pure-g">
  661. <label class="pure-u-1 pure-u-lg-1-4">Database</label>
  662. <input class="pure-u-1 pure-u-lg-3-4" name="idbDatabase" type="text" tabindex="43" />
  663. </div>
  664. <div class="pure-g">
  665. <label class="pure-u-1 pure-u-lg-1-4">Username</label>
  666. <input class="pure-u-1 pure-u-lg-3-4" name="idbUsername" type="text" tabindex="44" autocomplete="false" />
  667. </div>
  668. <div class="pure-g">
  669. <label class="pure-u-1 pure-u-lg-1-4">Password</label>
  670. <input class="pure-u-1 pure-u-lg-3-4" name="idbPassword" type="password" tabindex="45" autocomplete="false" />
  671. </div>
  672. </fieldset>
  673. </div>
  674. </div>
  675. <div class="panel" id="panel-sensors">
  676. <div class="header">
  677. <h1>SENSOR CONFIGURATION</h1>
  678. <h2>
  679. Configure and calibrate your device sensors.
  680. </h2>
  681. </div>
  682. <div class="page">
  683. <fieldset>
  684. <legend>General</legend>
  685. <div class="pure-g">
  686. <label class="pure-u-1 pure-u-lg-1-4">Read interval</label>
  687. <select class="pure-u-1 pure-u-lg-1-4" name="snsRead">
  688. <option value="6">6 seconds</option>
  689. <option value="10">10 seconds</option>
  690. <option value="15">15 seconds</option>
  691. <option value="30">30 seconds</option>
  692. <option value="60">1 minute</option>
  693. <option value="300">5 minutes</option>
  694. </select>
  695. <div class="pure-u-0 pure-u-lg-1-2"></div>
  696. <div class="pure-u-0 pure-u-lg-1-4"></div>
  697. <div class="pure-u-1 pure-u-lg-3-4 hint">
  698. Select the interval between readings. These will be filtered and averaged for the report. The default and recommended value is 6 seconds.
  699. </div>
  700. </div>
  701. <div class="pure-g">
  702. <label class="pure-u-1 pure-u-lg-1-4">Report every</label>
  703. <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>
  704. <div class="pure-u-0 pure-u-lg-1-2"></div>
  705. <div class="pure-u-0 pure-u-lg-1-4"></div>
  706. <div class="pure-u-1 pure-u-lg-3-4 hint">
  707. Select the number of readings to average and report
  708. </div>
  709. </div>
  710. <div class="pure-g module module-temperature">
  711. <label class="pure-u-1 pure-u-lg-1-4">Temperature units</label>
  712. <select name="tmpUnits" tabindex="16" class="pure-u-1 pure-u-lg-1-4">
  713. <option value="0">Celsius (&deg;C)</option>
  714. <option value="1">Fahrenheit (&deg;F)</option>
  715. </select>
  716. </div>
  717. <div class="pure-g module module-temperature">
  718. <label class="pure-u-1 pure-u-lg-1-4">Temperature correction</label>
  719. <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" />
  720. <div class="pure-u-0 pure-u-lg-1-2"></div>
  721. <div class="pure-u-0 pure-u-lg-1-4"></div>
  722. <div class="pure-u-1 pure-u-lg-3-4 hint">
  723. Temperature correction value is added to the measured value which may be inaccurate due to many factors. The value can be negative.
  724. </div>
  725. </div>
  726. <legend class="module module-hlw module-emon">Energy monitor</legend>
  727. <div class="pure-g module module-emon">
  728. <label class="pure-u-1 pure-u-lg-1-4">Voltage</label>
  729. <input class="pure-u-1 pure-u-lg-3-4" name="pwrVoltage" type="text" tabindex="51" />
  730. <div class="pure-u-0 pure-u-lg-1-4"></div>
  731. <div class="pure-u-1 pure-u-lg-3-4 hint">Mains voltage in your system (in V).</div>
  732. </div>
  733. <div class="pure-g module module-hlw">
  734. <label class="pure-u-1 pure-u-lg-1-4">Expected Current</label>
  735. <input class="pure-u-1 pure-u-lg-3-4 pwrExpected" name="pwrExpectedC" type="text" tabindex="52" placeholder="0" />
  736. <div class="pure-u-0 pure-u-lg-1-4"></div>
  737. <div class="pure-u-1 pure-u-lg-3-4 hint">In Ampers (A). If you are using a pure resistive load like a bulb this will the ratio between the two previous values, i.e. power / voltage. You can also use a current clamp around one fo the power wires to get this value.</div>
  738. </div>
  739. <div class="pure-g module module-hlw">
  740. <label class="pure-u-1 pure-u-lg-1-4">Expected Voltage</label>
  741. <input class="pure-u-1 pure-u-lg-3-4 pwrExpected" name="pwrExpectedV" type="text" tabindex="53" placeholder="0" />
  742. <div class="pure-u-0 pure-u-lg-1-4"></div>
  743. <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>
  744. </div>
  745. <div class="pure-g module module-hlw module-emon">
  746. <label class="pure-u-1 pure-u-lg-1-4">Expected Power</label>
  747. <input class="pure-u-1 pure-u-lg-3-4 pwrExpected" name="pwrExpectedP" type="text" tabindex="54" placeholder="0" />
  748. <div class="pure-u-0 pure-u-lg-1-4"></div>
  749. <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>
  750. </div>
  751. <div class="pure-g module module-hlw module-emon">
  752. <label class="pure-u-1 pure-u-lg-1-4">Reset calibration</label>
  753. <div class="pure-u-1 pure-u-lg-1-4"><input type="checkbox" name="pwrResetCalibration" tabindex="55" /></div>
  754. <div class="pure-u-0 pure-u-lg-1-2"></div>
  755. <div class="pure-u-0 pure-u-lg-1-4"></div>
  756. <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>
  757. </div>
  758. </fieldset>
  759. </div>
  760. </div>
  761. <div class="panel" id="panel-rfb">
  762. <div class="header">
  763. <h1>RFBRIDGE</h1>
  764. <h2>
  765. Sonoff 433 RF Bridge Configuration<br /><br />
  766. To learn a new code click <strong>LEARN</strong>, the Sonoff RFBridge will beep, then press a button on the remote, the RFBridge will then double beep and the new code should show up. If the device double beeps but the code does not update it has not been properly learnt. Keep trying.<br /><br />
  767. Modify or create new codes manually (18 characters) 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 />
  768. Delete any code clicking the <strong>FORGET</strong> button.
  769. <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>
  770. </h2>
  771. </div>
  772. <div class="page">
  773. <fieldset>
  774. <div id="rfbNodes"></div>
  775. </fieldset>
  776. </div>
  777. </div>
  778. </form>
  779. </div> <!-- content -->
  780. </div> <!-- layout -->
  781. <!-- Templates -->
  782. <div id="rfbNodeTemplate" class="template">
  783. <legend>Switch #<span></span></legend>
  784. <div class="pure-g">
  785. <div class="pure-u-1 pure-u-lg-1-4"><label>Switch ON</label></div>
  786. <input class="pure-u-1 pure-u-lg-1-3" type="text" maxlength="18" name="rfbcode" data-id="1" data-status="1" />
  787. <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>
  788. <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>
  789. <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>
  790. </div>
  791. <div class="pure-g">
  792. <div class="pure-u-1 pure-u-lg-1-4"><label>Switch OFF</label></div>
  793. <input class="pure-u-1 pure-u-lg-1-3" type="text" maxlength="18" name="rfbcode" data-id="1" data-status="0" />
  794. <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>
  795. <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>
  796. <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>
  797. </div>
  798. </div>
  799. <div id="networkTemplate" class="template">
  800. <div class="pure-g">
  801. <label class="pure-u-1 pure-u-lg-1-4">Network SSID</label>
  802. <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>
  803. <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>
  804. <label class="pure-u-1 pure-u-lg-1-4 more">Password</label>
  805. <input class="pure-u-1 pure-u-lg-3-4 more" name="pass" type="password" action="reconnect" value="" tabindex="0" autocomplete="false" />
  806. <label class="pure-u-1 pure-u-lg-1-4 more">Static IP</label>
  807. <input class="pure-u-1 pure-u-lg-3-4 more" name="ip" type="text" action="reconnect" value="" maxlength="15" tabindex="0" autocomplete="false" />
  808. <div class="pure-u-0 pure-u-lg-1-4 more"></div>
  809. <div class="pure-u-1 pure-u-lg-3-4 hint more">Leave empty for DNS negotiation</div>
  810. <label class="pure-u-1 pure-u-lg-1-4 more">Gateway IP</label>
  811. <input class="pure-u-1 pure-u-lg-3-4 more" name="gw" type="text" action="reconnect" value="" maxlength="15" tabindex="0" autocomplete="false" />
  812. <div class="pure-u-0 pure-u-lg-1-4 more"></div>
  813. <div class="pure-u-1 pure-u-lg-3-4 hint more">Set when using a static IP</div>
  814. <label class="pure-u-1 pure-u-lg-1-4 more">Network Mask</label>
  815. <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" />
  816. <div class="pure-u-0 pure-u-lg-1-4 more"></div>
  817. <div class="pure-u-1 pure-u-lg-3-4 hint more">Usually 255.255.255.0 for /24 networks</div>
  818. <label class="pure-u-1 pure-u-lg-1-4 more">DNS IP</label>
  819. <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" />
  820. <div class="pure-u-0 pure-u-lg-1-4 more"></div>
  821. <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>
  822. <div class="pure-u-0 pure-u-lg-1-4 more"></div>
  823. <button class="pure-button button-del-network more" type="button">Delete network</button>
  824. </div>
  825. </div>
  826. <div id="scheduleTemplate" class="template">
  827. <div class="pure-g">
  828. <label class="pure-u-1 pure-u-lg-1-4">When time is</label>
  829. <div class="pure-u-1-4 pure-u-lg-1-5">
  830. <input class="pure-u-2-3" name="schHour" type="number" min="0" step="1" max="23" />
  831. <div class="pure-u-1-4 hint center">&nbsp;h</div>
  832. </div>
  833. <div class="pure-u-1-4 pure-u-lg-1-5">
  834. <input class="pure-u-2-3" name="schMinute" type="number" min="0" step="1" max="59" />
  835. <div class="pure-u-1-4 hint center">&nbsp;m</div>
  836. </div>
  837. <div class="pure-u-0 pure-u-lg-1-3"></div>
  838. <label class="pure-u-1 pure-u-lg-1-4">And weekday is one of</label>
  839. <div class="pure-u-2-5 pure-u-lg-1-5">
  840. <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" />
  841. </div>
  842. <div class="pure-u-3-5 pure-u-lg-1-2 hint center">&nbsp;1 for Monday, 2 for Tuesday...</div>
  843. <label class="pure-u-1 pure-u-lg-1-4">Action</label>
  844. <div class="pure-u-1 pure-u-lg-1-5">
  845. <select class="pure-u-1 pure-u-lg-23-24" name="schAction">
  846. <option value="0">Turn OFF</option>
  847. <option value="1">Turn ON</option>
  848. <option value="2">Toggle</option>
  849. </select>
  850. </div>
  851. <select class="pure-u-1 pure-u-lg-1-5 isrelay" name="schSwitch"></select>
  852. <div class="pure-u-0 pure-u-lg-1-5"></div>
  853. <label class="pure-u-1 pure-u-lg-1-4">Enabled</label>
  854. <div class="pure-u-1 pure-u-lg-3-4"><input type="checkbox" name="schEnabled" /></div>
  855. <div class="pure-u-0 pure-u-lg-1-4"></div>
  856. <button class="pure-button button-del-schedule" type="button">Delete schedule</button>
  857. </div>
  858. </div>
  859. <div id="relayTemplate" class="template">
  860. <div class="pure-g">
  861. <label class="pure-u-1 pure-u-lg-1-4">Switch #<span class="id"></span></label>
  862. <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>
  863. </div>
  864. </div>
  865. <div id="relayConfigTemplate" class="template">
  866. <legend>Switch #<span class="id"></span> (GPIO<span class="gpio"></span>)</legend>
  867. <div class="pure-g">
  868. <div class="pure-u-1 pure-u-lg-1-4"><label>Boot mode</label></div>
  869. <select class="pure-u-1 pure-u-lg-3-4" name="relayBoot">
  870. <option value="0">Always OFF</option>
  871. <option value="1">Always ON</option>
  872. <option value="2">Same as before</option>
  873. <option value="3">Toggle before</option>
  874. </select>
  875. </div>
  876. <div class="pure-g">
  877. <div class="pure-u-1 pure-u-lg-1-4"><label>Pulse mode</label></div>
  878. <select class="pure-u-1 pure-u-lg-3-4" name="relayPulse">
  879. <option value="0">Don't pulse</option>
  880. <option value="1">Normally OFF</option>
  881. <option value="2">Normally ON</option>
  882. </select>
  883. </div>
  884. <div class="pure-g">
  885. <div class="pure-u-1 pure-u-lg-1-4"><label>Pulse time (s)</label></div>
  886. <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>
  887. </div>
  888. <div class="pure-g module module-mqtt">
  889. <div class="pure-u-1 pure-u-lg-1-4"><label>MQTT group</label></div>
  890. <div class="pure-u-1 pure-u-lg-3-4"><input name="mqttGroup" class="pure-u-1" tabindex="0" data="0" action="reconnect" /></div>
  891. </div>
  892. <div class="pure-g module module-mqtt">
  893. <div class="pure-u-1 pure-u-lg-1-4"><label>MQTT group sync</label></div>
  894. <select class="pure-u-1 pure-u-lg-3-4" name="mqttGroupInv">
  895. <option value="0">Same</option>
  896. <option value="1">Inverse</option>
  897. </select>
  898. </div>
  899. </div>
  900. <div id="dczRelayTemplate" class="template">
  901. <div class="pure-g">
  902. <label class="pure-u-1 pure-u-lg-1-4">Switch</label>
  903. <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>
  904. </div>
  905. </div>
  906. <div id="dczMagnitudeTemplate" class="template">
  907. <div class="pure-g">
  908. <label class="pure-u-1 pure-u-lg-1-4">Magnitude</label>
  909. <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>
  910. <div class="pure-u-1 pure-u-lg-1-2 hint center"></div>
  911. </div>
  912. </div>
  913. <div id="tspkRelayTemplate" class="template">
  914. <div class="pure-g">
  915. <label class="pure-u-1 pure-u-lg-1-4">Switch</label>
  916. <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>
  917. </div>
  918. </div>
  919. <div id="tspkMagnitudeTemplate" class="template">
  920. <div class="pure-g">
  921. <label class="pure-u-1 pure-u-lg-1-4">Magnitude</label>
  922. <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>
  923. <div class="pure-u-1 pure-u-lg-1-2 hint center"></div>
  924. </div>
  925. </div>
  926. <div id="colorRGBTemplate" class="template">
  927. <div class="pure-g">
  928. <label class="pure-u-1 pure-u-lg-1-4">Color</label>
  929. <input class="pure-u-1 pure-u-lg-1-4" data-wcp-layout="block" name="color" readonly />
  930. </div>
  931. <div class="pure-g">
  932. <label class="pure-u-1 pure-u-lg-1-4">Brightness</label>
  933. <input type="range" min="0" max="255" class="slider pure-u-lg-1-4" id="brightness">
  934. <span class="slider brightness pure-u-lg-1-4"></span>
  935. </div>
  936. </div>
  937. <div id="colorHSVTemplate" class="template">
  938. <div class="pure-g">
  939. <label class="pure-u-1 pure-u-lg-1-4">Color</label>
  940. <input class="pure-u-1 pure-u-lg-1-4" data-wcp-layout="block" name="color" readonly />
  941. </div>
  942. </div>
  943. <div id="channelTemplate" class="template">
  944. <div class="pure-g">
  945. <label class="pure-u-1 pure-u-lg-1-4">Channel #</label>
  946. <input type="range" min="0" max="255" class="slider channels pure-u-lg-1-4" data="99">
  947. <span class="slider pure-u-lg-1-4"></span>
  948. </div>
  949. </div>
  950. <div id="magnitudeTemplate" class="template">
  951. <div class="pure-g">
  952. <label class="pure-u-1 pure-u-lg-1-4"></label>
  953. <div class="pure-u-1 pure-u-lg-1-4">
  954. <input class="pure-u-1 pure-u-lg-23-24 center" type="text" name="magnitude" data="256" readonly />
  955. </div>
  956. <div class="pure-u-1 pure-u-lg-1-2 hint center"></div>
  957. </div>
  958. </div>
  959. <iframe id="downloader"></iframe>
  960. <input id="uploader" type="file" />
  961. </body>
  962. <!-- build:js script.js -->
  963. <script src="vendor/jquery-3.2.1.min.js"></script>
  964. <script src="custom.js"></script>
  965. <script src="vendor/checkboxes.js"></script>
  966. <script src="vendor/jquery.wheelcolorpicker-3.0.3.min.js"></script>
  967. <!-- endbuild -->
  968. </html>