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.

434 lines
23 KiB

8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>ESPurna 0.0.0</title>
  5. <meta charset="utf-8" />
  6. <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
  7. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8. <!-- build:css style.css -->
  9. <link rel="stylesheet" href="pure-min.css" />
  10. <link rel="stylesheet" href="side-menu.css" />
  11. <link rel="stylesheet" href="grids-responsive-min.css" />
  12. <link rel="stylesheet" href="checkboxes.css" />
  13. <link rel="stylesheet" href="custom.css" />
  14. <!-- endbuild -->
  15. </head>
  16. <body>
  17. <div id="layout">
  18. <a href="#menu" id="menuLink" class="menu-link">
  19. <span></span>
  20. </a>
  21. <div id="menu">
  22. <div class="pure-menu">
  23. <span class="pure-menu-heading">ESPurna 0.0.0</span>
  24. <ul class="pure-menu-list">
  25. <li class="pure-menu-item">
  26. <a href="#" class="pure-menu-link" data="panel-status">STATUS</a>
  27. </li>
  28. <li class="pure-menu-item">
  29. <a href="#" class="pure-menu-link" data="panel-general">GENERAL</a>
  30. </li>
  31. <li class="pure-menu-item">
  32. <a href="#" class="pure-menu-link" data="panel-security">SECURITY</a>
  33. </li>
  34. <li class="pure-menu-item">
  35. <a href="#" class="pure-menu-link" data="panel-wifi">WIFI</a>
  36. </li>
  37. <li class="pure-menu-item">
  38. <a href="#" class="pure-menu-link" data="panel-mqtt">MQTT</a>
  39. </li>
  40. <li class="pure-menu-item module module-dcz">
  41. <a href="#" class="pure-menu-link" data="panel-domoticz">DOMOTICZ</a>
  42. </li>
  43. <li class="pure-menu-item module module-pow">
  44. <a href="#" class="pure-menu-link" data="panel-power">POWER</a>
  45. </li>
  46. </ul>
  47. <div class="main-buttons">
  48. <button class="pure-button button-update">Update</button>
  49. <button class="pure-button button-reconnect">Reconnect</button>
  50. <button class="pure-button button-reset">Reset</button>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="content">
  55. <div class="panel" id="panel-status" style="display: block;">
  56. <div class="header">
  57. <h1>STATUS</h1>
  58. <h2>Current configuration</h2>
  59. </div>
  60. <div class="page">
  61. <form class="pure-form pure-form-aligned">
  62. <fieldset>
  63. <div class="pure-g">
  64. <label class="pure-u-1 pure-u-sm-1-4" for="manufacturer">Manufacturer</label>
  65. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="manufacturer" readonly />
  66. </div>
  67. <div class="pure-g">
  68. <label class="pure-u-1 pure-u-sm-1-4" for="device">Device</label>
  69. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="device" readonly />
  70. </div>
  71. <div class="pure-g">
  72. <label class="pure-u-1 pure-u-sm-1-4" for="chipid">Chip ID</label>
  73. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="chipid" readonly />
  74. </div>
  75. <div class="pure-g">
  76. <label class="pure-u-1 pure-u-sm-1-4" for="mac">MAC</label>
  77. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="mac" readonly />
  78. </div>
  79. <div class="pure-g">
  80. <label class="pure-u-1 pure-u-sm-1-4" for="network">Network</label>
  81. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="network" readonly />
  82. </div>
  83. <div class="pure-g">
  84. <label class="pure-u-1 pure-u-sm-1-4" for="ip">IP</label>
  85. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="ip" readonly />
  86. </div>
  87. <div class="pure-g">
  88. <label class="pure-u-1 pure-u-sm-1-4" for="mqtt">MQTT Status</label>
  89. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="mqttStatus" readonly />
  90. </div>
  91. <div class="pure-g module module-ds">
  92. <label class="pure-u-1 pure-u-sm-1-4" for="dsTmp">Temperature (ºC)</label>
  93. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="dsTmp" readonly />
  94. </div>
  95. <div class="pure-g module module-dht">
  96. <label class="pure-u-1 pure-u-sm-1-4" for="dhtTmp">Temperature (ºC)</label>
  97. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="dhtTmp" readonly />
  98. </div>
  99. <div class="pure-g module module-dht">
  100. <label class="pure-u-1 pure-u-sm-1-4" for="dhtHum">Humidity (%)</label>
  101. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="dhtHum" readonly />
  102. </div>
  103. <div class="pure-g module module-pow">
  104. <label class="pure-u-1 pure-u-sm-1-4" for="powActivePower">Power (W)</label>
  105. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="powActivePower" readonly />
  106. </div>
  107. <div id="relays">
  108. </div>
  109. <div id="relayTemplate" class="template">
  110. <div class="pure-g">
  111. <label class="pure-u-1 pure-u-sm-1-4">Relay<span class="relay_id"></span> Status</label>
  112. <div class="pure-u-1 pure-u-sm-1-4"><input type="checkbox" class="relayStatus" data="0" /></div>
  113. </div>
  114. </div>
  115. </fieldset>
  116. </form>
  117. </div>
  118. </div>
  119. <form id="formSave" class="pure-form" action="/" method="post">
  120. <div class="panel" id="panel-general">
  121. <div class="header">
  122. <h1>GENERAL</h1>
  123. <h2>General configuration values</h2>
  124. </div>
  125. <div class="page">
  126. <fieldset>
  127. <div class="pure-g">
  128. <label class="pure-u-1 pure-u-md-1-4" for="hostname">Hostname</label>
  129. <input name="hostname" class="pure-u-1 pure-u-md-3-4" type="text" tabindex="1" />
  130. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  131. <div class="pure-u-1 pure-u-md-3-4 hint">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.</div>
  132. </div>
  133. <div class="pure-g">
  134. <label class="pure-u-1 pure-u-md-1-4" for="relayMode">Relay boot mode</label>
  135. <div class="pure-u-1 pure-u-md-3-4">
  136. <select name="relayMode" class="pure-u-1-2" tabindex="2">
  137. <option value="0">Always OFF</a>
  138. <option value="1">Always ON</a>
  139. <option value="2">Same as before</a>
  140. </select>
  141. </div>
  142. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  143. <div class="pure-u-1 pure-u-md-3-4 hint">Here you can define what will be the status of the relay after a reboot.</div>
  144. </div>
  145. <div class="pure-g module module-multirelay">
  146. <label class="pure-u-1 pure-u-md-1-4" for="relaySync">Relay sync mode</label>
  147. <div class="pure-u-1 pure-u-md-3-4">
  148. <select name="relaySync" class="pure-u-1-2" tabindex="2">
  149. <option value="0">No synchonisation</a>
  150. <option value="1">Zero or one relays active</a>
  151. <option value="2">One and just one relay active</a>
  152. <option value="3">All synchonised</a>
  153. </select>
  154. </div>
  155. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  156. <div class="pure-u-1 pure-u-md-3-4 hint">Define how the different relays should be synchronized.</div>
  157. </div>
  158. <div class="pure-g module module-fauxmo">
  159. <div class="pure-u-1 pure-u-sm-1-4"><label for="fauxmoEnabled">Enable WeMo emulation</label></div>
  160. <div class="pure-u-1 pure-u-sm-1-4"><input type="checkbox" name="fauxmoEnabled" /></div>
  161. </div>
  162. </fieldset>
  163. </div>
  164. </div>
  165. <div class="panel" id="panel-security">
  166. <div class="header">
  167. <h1>SECURITY</h1>
  168. <h2>Device security settings</h2>
  169. </div>
  170. <div class="page">
  171. <fieldset>
  172. <div class="pure-g">
  173. <label class="pure-u-1 pure-u-md-1-4" for="adminPass1">Admin password</label>
  174. <input name="adminPass1" class="pure-u-1 pure-u-md-3-4" type="password" tabindex="3" />
  175. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  176. <div class="pure-u-1 pure-u-md-3-4 hint">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).</div>
  177. </div>
  178. <div class="pure-g">
  179. <label class="pure-u-1 pure-u-md-1-4" for="adminPass2">Admin password (repeat)</label>
  180. <input name="adminPass2" class="pure-u-1 pure-u-md-3-4" type="password" tabindex="3" />
  181. </div>
  182. <div class="pure-g">
  183. <div class="pure-u-1 pure-u-sm-1-4"><label for="apiEnabled">Enable HTTP API</label></div>
  184. <div class="pure-u-1 pure-u-sm-1-4"><input type="checkbox" name="apiEnabled" /></div>
  185. </div>
  186. <div class="pure-g">
  187. <label class="pure-u-1 pure-u-md-1-4" for="apiKey">HTTP API Key</label>
  188. <input name="apiKey" class="pure-u-3-4 pure-u-md-1-2" type="text" tabindex="4" />
  189. <div class=" pure-u-1-4 pure-u-md-1-4"><button class="pure-button button-apikey pure-u-23-24">Generate</button></div>
  190. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  191. <div class="pure-u-1 pure-u-md-3-4 hint">This is the key you will have to pass with every HTTP request to the API, either to get or write values.</div>
  192. </div>
  193. </fieldset>
  194. </div>
  195. </div>
  196. <div class="panel" id="panel-wifi">
  197. <div class="header">
  198. <h1>WIFI</h1>
  199. <h2>You can configure up to 3 different WiFi networks. The device will try to connect in order of signal strength.</h2>
  200. </div>
  201. <div class="page">
  202. <fieldset>
  203. <legend>First network</legend>
  204. <div class="pure-g">
  205. <div class="pure-u-1 pure-u-md-1-2">
  206. <label for="ssid">SSID</label>
  207. <input type="text" class="pure-u-23-24" tabindex="10" name="ssid" />
  208. </div>
  209. <div class="pure-u-1 pure-u-md-1-2">
  210. <label for="pass">Password</label>
  211. <input type="text" class="pure-u-23-24" tabindex="11" name="pass" />
  212. </div>
  213. </div>
  214. <legend>Second network</legend>
  215. <div class="pure-g">
  216. <div class="pure-u-1 pure-u-md-1-2">
  217. <label for="ssid">SSID</label>
  218. <input type="text" class="pure-u-23-24" tabindex="12" name="ssid" />
  219. </div>
  220. <div class="pure-u-1 pure-u-md-1-2">
  221. <label for="pass">Password</label>
  222. <input type="text" class="pure-u-23-24" tabindex="13" name="pass" />
  223. </div>
  224. </div>
  225. <legend>Third network</legend>
  226. <div class="pure-g">
  227. <div class="pure-u-1 pure-u-md-1-2">
  228. <label for="ssid">SSID</label>
  229. <input type="text" class="pure-u-23-24" tabindex="14" name="ssid" />
  230. </div>
  231. <div class="pure-u-1 pure-u-md-1-2">
  232. <label for="pass">Password</label>
  233. <input type="text" class="pure-u-23-24" tabindex="15" name="pass" />
  234. </div>
  235. </div>
  236. </fieldset>
  237. </div>
  238. </div>
  239. <div class="panel" id="panel-mqtt">
  240. <div class="header">
  241. <h1>MQTT</h1>
  242. <h2>Configure an <strong>MQTT broker</strong> in your network and you will be able to change the switch status via an MQTT message. Leave the server field empty to disable MQTT.</h2>
  243. </div>
  244. <div class="page">
  245. <fieldset>
  246. <div class="pure-g">
  247. <label class="pure-u-1 pure-u-md-1-4" for="mqttServer">MQTT Server</label>
  248. <input class="pure-u-1 pure-u-md-3-4" name="mqttServer" type="text" size="20" tabindex="10" placeholder="MQTT Server" />
  249. </div>
  250. <div class="pure-g">
  251. <label class="pure-u-1 pure-u-md-1-4" for="mqttPort">MQTT Port</label>
  252. <input class="pure-u-1 pure-u-md-3-4" name="mqttPort" type="text" size="6" tabindex="11" placeholder="1883" />
  253. </div>
  254. <div class="pure-g">
  255. <label class="pure-u-1 pure-u-md-1-4" for="mqttUser">MQTT User</label>
  256. <input class="pure-u-1 pure-u-md-3-4" name="mqttUser" type="text" size="20" tabindex="12" placeholder="Leave blank if no user/pass" />
  257. </div>
  258. <div class="pure-g">
  259. <label class="pure-u-1 pure-u-md-1-4" for="mqttPassword">MQTT Password</label>
  260. <input class="pure-u-1 pure-u-md-3-4" name="mqttPassword" type="text" size="20" tabindex="13" placeholder="Leave blank if no user/pass" />
  261. </div>
  262. <div class="pure-g">
  263. <label class="pure-u-1 pure-u-md-1-4" for="mqttTopic">MQTT Root Topic</label>
  264. <input class="pure-u-1 pure-u-md-3-4" name="mqttTopic" type="text" size="20" tabindex="14" />
  265. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  266. <div class="pure-u-1 pure-u-md-3-4 hint">This is the root topic for this device. The {identifier} placeholder will be replaces by the device hostname.<br />
  267. - <strong>&lt;root&gt;/relay/#</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 relay ID (starting from 0). If the board has only one relay it will be 0.<br />
  268. - <strong>&lt;root&gt;/led/#</strong> Send a 0 or a 1 as a payload to this topic to set the onboard LED to the given state, send a 3 to turn it back to WIFI indicator. Replace # with the LED ID (starting from 0). If the board has only one LED it will be 0.<br />
  269. - <strong>&lt;root&gt;/ip</strong> The device will report to this topic its IP.<br />
  270. - <strong>&lt;root&gt;/heartbeat</strong> The device will report to this topic every few minutes.<br />
  271. - <strong>&lt;root&gt;/version</strong> The device will report to this topic its firmware version on boot.<br />
  272. </div>
  273. </fieldset>
  274. </div>
  275. </div>
  276. <div class="panel" id="panel-domoticz">
  277. <div class="header">
  278. <h1>DOMOTICZ</h1>
  279. <h2>
  280. Configure the connection to your Domoticz server.
  281. </h2>
  282. </div>
  283. <div class="page">
  284. <fieldset>
  285. <div class="pure-g">
  286. <label class="pure-u-1 pure-u-md-1-4" for="dczTopicIn">Domoticz IN Topic</label>
  287. <input class="pure-u-1 pure-u-md-3-4" name="dczTopicIn" type="text" tabindex="41" placeholder="domoticz/in" />
  288. </div>
  289. <div class="pure-g">
  290. <label class="pure-u-1 pure-u-md-1-4" for="dczTopicOut">Domoticz OUT Topic</label>
  291. <input class="pure-u-1 pure-u-md-3-4" name="dczTopicOut" type="text" tabindex="42" placeholder="domoticz/out" />
  292. </div>
  293. <div id="idxs">
  294. </div>
  295. <div id="idxTemplate" class="template">
  296. <div class="pure-g">
  297. <label class="pure-u-1 pure-u-sm-1-4">Relay<span class="id"></span> IDX</label>
  298. <div class="pure-u-1 pure-u-sm-1-8"><input class="pure-u-sm-23-24 dczIdx" name="dczIdx" type="number" min="0" tabindex="0" data="0" /></div>
  299. <div class="pure-u-1 pure-u-sm-5-8 hint center">Set to 0 to disable notifications.</div>
  300. </div>
  301. </div>
  302. </fieldset>
  303. </div>
  304. </div>
  305. <div class="panel" id="panel-power">
  306. <div class="header">
  307. <h1>POWER</h1>
  308. <h2>
  309. Calibrate your power monitor device. Use a pure resistive load and introduce the expected values for active power, current and voltage. Use the nominal values or a multimeter to get the proper numbers. Set any field to 0 to leave the calibration value untouched.
  310. </h2>
  311. </div>
  312. <div class="page">
  313. <fieldset>
  314. <div class="pure-g">
  315. <label class="pure-u-1 pure-u-md-1-4" for="powExpectedPower">AC RMS Active Power</label>
  316. <input class="pure-u-1 pure-u-md-3-4 powExpected" name="powExpectedPower" type="text" size="8" tabindex="50" placeholder="0" />
  317. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  318. <div class="pure-u-1 pure-u-md-3-4 hint">If you are using a pure resistive load like a bulb this will be writen on it, otherwise use a socket multimeter to get this value.</div>
  319. </div>
  320. </fieldset>
  321. </div>
  322. </div>
  323. </form>
  324. </div> <!-- content -->
  325. </div> <!-- layout -->
  326. </body>
  327. <!-- build:js script.js -->
  328. <script src="jquery-1.12.3.min.js"></script>
  329. <script src="checkboxes.js"></script>
  330. <script src="custom.js"></script>
  331. <!-- endbuild -->
  332. </html>