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.

407 lines
22 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-pow">
  41. <a href="#" class="pure-menu-link" data="panel-power">POWER</a>
  42. </li>
  43. </ul>
  44. <div class="main-buttons">
  45. <button class="pure-button button-update">Update</button>
  46. <button class="pure-button button-reconnect">Reconnect</button>
  47. <button class="pure-button button-reset">Reset</button>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="content">
  52. <div class="panel" id="panel-status" style="display: block;">
  53. <div class="header">
  54. <h1>STATUS</h1>
  55. <h2>Current configuration</h2>
  56. </div>
  57. <div class="page">
  58. <form class="pure-form pure-form-aligned">
  59. <fieldset>
  60. <div class="pure-g">
  61. <label class="pure-u-1 pure-u-sm-1-4" for="manufacturer">Manufacturer</label>
  62. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="manufacturer" readonly />
  63. </div>
  64. <div class="pure-g">
  65. <label class="pure-u-1 pure-u-sm-1-4" for="device">Device</label>
  66. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="device" readonly />
  67. </div>
  68. <div class="pure-g">
  69. <label class="pure-u-1 pure-u-sm-1-4" for="chipid">Chip ID</label>
  70. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="chipid" readonly />
  71. </div>
  72. <div class="pure-g">
  73. <label class="pure-u-1 pure-u-sm-1-4" for="mac">MAC</label>
  74. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="mac" readonly />
  75. </div>
  76. <div class="pure-g">
  77. <label class="pure-u-1 pure-u-sm-1-4" for="network">Network</label>
  78. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="network" readonly />
  79. </div>
  80. <div class="pure-g">
  81. <label class="pure-u-1 pure-u-sm-1-4" for="ip">IP</label>
  82. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="ip" readonly />
  83. </div>
  84. <div class="pure-g">
  85. <label class="pure-u-1 pure-u-sm-1-4" for="mqtt">MQTT Status</label>
  86. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="mqttStatus" readonly />
  87. </div>
  88. <div class="pure-g module module-ds">
  89. <label class="pure-u-1 pure-u-sm-1-4" for="dsTmp">Temperature (ºC)</label>
  90. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="dsTmp" readonly />
  91. </div>
  92. <div class="pure-g module module-dht">
  93. <label class="pure-u-1 pure-u-sm-1-4" for="dhtTmp">Temperature (ºC)</label>
  94. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="dhtTmp" readonly />
  95. </div>
  96. <div class="pure-g module module-dht">
  97. <label class="pure-u-1 pure-u-sm-1-4" for="dhtHum">Humidity (%)</label>
  98. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="dhtHum" readonly />
  99. </div>
  100. <div class="pure-g module module-pow">
  101. <label class="pure-u-1 pure-u-sm-1-4" for="powActivePower">Power (W)</label>
  102. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="powActivePower" readonly />
  103. </div>
  104. <div id="relays">
  105. </div>
  106. <div id="relayTemplate">
  107. <div class="pure-g">
  108. <div class="pure-u-1 pure-u-sm-1-4"><label >Relay<span class="relay_id"></span> Status</label></div>
  109. <div class="pure-u-1 pure-u-sm-1-4"><input type="checkbox" class="relayStatus" data="0" /></div>
  110. </div>
  111. </div>
  112. </fieldset>
  113. </form>
  114. </div>
  115. </div>
  116. <form id="formSave" class="pure-form" action="/" method="post">
  117. <div class="panel" id="panel-general">
  118. <div class="header">
  119. <h1>GENERAL</h1>
  120. <h2>General configuration values</h2>
  121. </div>
  122. <div class="page">
  123. <fieldset>
  124. <div class="pure-g">
  125. <label class="pure-u-1 pure-u-md-1-4" for="hostname">Hostname</label>
  126. <input name="hostname" class="pure-u-1 pure-u-md-3-4" type="text" tabindex="1" />
  127. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  128. <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>
  129. </div>
  130. <div class="pure-g">
  131. <label class="pure-u-1 pure-u-md-1-4" for="relayMode">Relay boot mode</label>
  132. <div class="pure-u-1 pure-u-md-3-4">
  133. <select name="relayMode" class="pure-u-1-2" tabindex="2">
  134. <option value="0">Always OFF</a>
  135. <option value="1">Always ON</a>
  136. <option value="2">Same as before</a>
  137. </select>
  138. </div>
  139. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  140. <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>
  141. </div>
  142. <div class="pure-g module module-multirelay">
  143. <label class="pure-u-1 pure-u-md-1-4" for="relaySync">Relay sync mode</label>
  144. <div class="pure-u-1 pure-u-md-3-4">
  145. <select name="relaySync" class="pure-u-1-2" tabindex="3">
  146. <option value="0">No synchonisation</a>
  147. <option value="1">Zero or one relays active</a>
  148. <option value="2">One and just one relay active</a>
  149. <option value="3">All synchonised</a>
  150. </select>
  151. </div>
  152. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  153. <div class="pure-u-1 pure-u-md-3-4 hint">Define how the different relays should be synchronized.</div>
  154. </div>
  155. <div class="pure-g">
  156. <label class="pure-u-1 pure-u-md-1-4" for="relayInch">Relay inching mode</label>
  157. <div class="pure-u-1 pure-u-md-3-4">
  158. <select name="relayInch" class="pure-u-1-2" tabindex="4">
  159. <option value="0">No inching</a>
  160. <option value="1">Normally OFF (stays on for a brief interval)</a>
  161. <option value="2">Normally ON (stays off for a brief interval)</a>
  162. </select>
  163. </div>
  164. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  165. <div class="pure-u-1 pure-u-md-3-4 hint">When inching enable the relay will automatically switch back to its normal state after the inching time (below).</div>
  166. </div>
  167. <div class="pure-g">
  168. <label class="pure-u-1 pure-u-md-1-4" for="relayInchTime">Relay inching time</label>
  169. <input name="relayInchTime" class="pure-u-1 pure-u-md-3-4" type="number" min="1" tabindex="5" />
  170. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  171. <div class="pure-u-1 pure-u-md-3-4 hint">Inching time in seconds.</div>
  172. </div>
  173. <div class="pure-g module module-fauxmo">
  174. <div class="pure-u-1 pure-u-sm-1-4"><label for="fauxmoEnabled">Enable WeMo emulation</label></div>
  175. <div class="pure-u-1 pure-u-sm-1-4"><input type="checkbox" name="fauxmoEnabled" tabindex="6" /></div>
  176. </div>
  177. </fieldset>
  178. </div>
  179. </div>
  180. <div class="panel" id="panel-security">
  181. <div class="header">
  182. <h1>SECURITY</h1>
  183. <h2>Device security settings</h2>
  184. </div>
  185. <div class="page">
  186. <fieldset>
  187. <div class="pure-g">
  188. <label class="pure-u-1 pure-u-md-1-4" for="adminPass1">Admin password</label>
  189. <input name="adminPass1" class="pure-u-1 pure-u-md-3-4" type="password" tabindex="3" />
  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">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>
  192. </div>
  193. <div class="pure-g">
  194. <label class="pure-u-1 pure-u-md-1-4" for="adminPass2">Admin password (repeat)</label>
  195. <input name="adminPass2" class="pure-u-1 pure-u-md-3-4" type="password" tabindex="3" />
  196. </div>
  197. <div class="pure-g">
  198. <div class="pure-u-1 pure-u-sm-1-4"><label for="apiEnabled">Enable HTTP API</label></div>
  199. <div class="pure-u-1 pure-u-sm-1-4"><input type="checkbox" name="apiEnabled" /></div>
  200. </div>
  201. <div class="pure-g">
  202. <label class="pure-u-1 pure-u-md-1-4" for="apiKey">HTTP API Key</label>
  203. <input name="apiKey" class="pure-u-3-4 pure-u-md-1-2" type="text" tabindex="4" />
  204. <div class=" pure-u-1-4 pure-u-md-1-4"><button class="pure-button button-apikey pure-u-23-24">Generate</button></div>
  205. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  206. <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>
  207. </div>
  208. </fieldset>
  209. </div>
  210. </div>
  211. <div class="panel" id="panel-wifi">
  212. <div class="header">
  213. <h1>WIFI</h1>
  214. <h2>You can configure up to 3 different WiFi networks. The device will try to connect in order of signal strength.</h2>
  215. </div>
  216. <div class="page">
  217. <fieldset>
  218. <legend>First network</legend>
  219. <div class="pure-g">
  220. <div class="pure-u-1 pure-u-md-1-2">
  221. <label for="ssid">SSID</label>
  222. <input type="text" class="pure-u-23-24" tabindex="10" name="ssid" />
  223. </div>
  224. <div class="pure-u-1 pure-u-md-1-2">
  225. <label for="pass">Password</label>
  226. <input type="text" class="pure-u-23-24" tabindex="11" name="pass" />
  227. </div>
  228. </div>
  229. <legend>Second network</legend>
  230. <div class="pure-g">
  231. <div class="pure-u-1 pure-u-md-1-2">
  232. <label for="ssid">SSID</label>
  233. <input type="text" class="pure-u-23-24" tabindex="12" name="ssid" />
  234. </div>
  235. <div class="pure-u-1 pure-u-md-1-2">
  236. <label for="pass">Password</label>
  237. <input type="text" class="pure-u-23-24" tabindex="13" name="pass" />
  238. </div>
  239. </div>
  240. <legend>Third network</legend>
  241. <div class="pure-g">
  242. <div class="pure-u-1 pure-u-md-1-2">
  243. <label for="ssid">SSID</label>
  244. <input type="text" class="pure-u-23-24" tabindex="14" name="ssid" />
  245. </div>
  246. <div class="pure-u-1 pure-u-md-1-2">
  247. <label for="pass">Password</label>
  248. <input type="text" class="pure-u-23-24" tabindex="15" name="pass" />
  249. </div>
  250. </div>
  251. </fieldset>
  252. </div>
  253. </div>
  254. <div class="panel" id="panel-mqtt">
  255. <div class="header">
  256. <h1>MQTT</h1>
  257. <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>
  258. </div>
  259. <div class="page">
  260. <fieldset>
  261. <div class="pure-g">
  262. <label class="pure-u-1 pure-u-md-1-4" for="mqttServer">MQTT Server</label>
  263. <input class="pure-u-1 pure-u-md-3-4" name="mqttServer" type="text" size="20" tabindex="10" placeholder="MQTT Server" />
  264. </div>
  265. <div class="pure-g">
  266. <label class="pure-u-1 pure-u-md-1-4" for="mqttPort">MQTT Port</label>
  267. <input class="pure-u-1 pure-u-md-3-4" name="mqttPort" type="text" size="6" tabindex="11" placeholder="1883" />
  268. </div>
  269. <div class="pure-g">
  270. <label class="pure-u-1 pure-u-md-1-4" for="mqttUser">MQTT User</label>
  271. <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" />
  272. </div>
  273. <div class="pure-g">
  274. <label class="pure-u-1 pure-u-md-1-4" for="mqttPassword">MQTT Password</label>
  275. <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" />
  276. </div>
  277. <div class="pure-g">
  278. <label class="pure-u-1 pure-u-md-1-4" for="mqttTopic">MQTT Topic</label>
  279. <input class="pure-u-1 pure-u-md-3-4" name="mqttTopic" type="text" size="20" tabindex="14" />
  280. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  281. <div class="pure-u-1 pure-u-md-3-4 hint">Send a 0 or a 1 as a payload to the provided topic below to switch it on or off. You can also send a 2 to toggle its current state. The switch will also report its current open/close status to the same topic and its IP address, hertbeat, firmware version and file system version to the topic you define plus "/ip", "/heartbeat", "/version" and "/fsversion" respectively. </div>
  282. </div>
  283. </fieldset>
  284. </div>
  285. </div>
  286. <div class="panel" id="panel-power">
  287. <div class="header">
  288. <h1>POWER</h1>
  289. <h2>
  290. 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.
  291. </h2>
  292. </div>
  293. <div class="page">
  294. <fieldset>
  295. <div class="pure-g">
  296. <label class="pure-u-1 pure-u-md-1-4" for="powExpectedPower">AC RMS Active Power</label>
  297. <input class="pure-u-1 pure-u-md-3-4 powExpected" name="powExpectedPower" type="text" size="8" tabindex="40" placeholder="0" />
  298. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  299. <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>
  300. </div>
  301. </fieldset>
  302. </div>
  303. </div>
  304. </form>
  305. </div> <!-- content -->
  306. </div> <!-- layout -->
  307. </body>
  308. <!-- build:js script.js -->
  309. <script src="jquery-1.12.3.min.js"></script>
  310. <script src="checkboxes.js"></script>
  311. <script src="custom.js"></script>
  312. <!-- endbuild -->
  313. </html>