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.

363 lines
19 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-wifi">WIFI</a>
  33. </li>
  34. <li class="pure-menu-item">
  35. <a href="#" class="pure-menu-link" data="panel-mqtt">MQTT</a>
  36. </li>
  37. <li class="pure-menu-item module module-pow">
  38. <a href="#" class="pure-menu-link" data="panel-power">POWER</a>
  39. </li>
  40. </ul>
  41. <div class="main-buttons">
  42. <button class="pure-button button-update">Update</button>
  43. <button class="pure-button button-reconnect">Reconnect</button>
  44. <button class="pure-button button-reset">Reset</button>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="content">
  49. <div class="panel" id="panel-status" style="display: block;">
  50. <div class="header">
  51. <h1>STATUS</h1>
  52. <h2>Current configuration</h2>
  53. </div>
  54. <div class="page">
  55. <form class="pure-form pure-form-aligned">
  56. <fieldset>
  57. <div class="pure-g">
  58. <label class="pure-u-1 pure-u-sm-1-4" for="manufacturer">Manufacturer</label>
  59. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="manufacturer" readonly />
  60. </div>
  61. <div class="pure-g">
  62. <label class="pure-u-1 pure-u-sm-1-4" for="device">Device</label>
  63. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="device" readonly />
  64. </div>
  65. <div class="pure-g">
  66. <label class="pure-u-1 pure-u-sm-1-4" for="chipid">Chip ID</label>
  67. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="chipid" readonly />
  68. </div>
  69. <div class="pure-g">
  70. <label class="pure-u-1 pure-u-sm-1-4" for="mac">MAC</label>
  71. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="mac" readonly />
  72. </div>
  73. <div class="pure-g">
  74. <label class="pure-u-1 pure-u-sm-1-4" for="network">Network</label>
  75. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="network" readonly />
  76. </div>
  77. <div class="pure-g">
  78. <label class="pure-u-1 pure-u-sm-1-4" for="ip">IP</label>
  79. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="ip" readonly />
  80. </div>
  81. <div class="pure-g">
  82. <label class="pure-u-1 pure-u-sm-1-4" for="mqtt">MQTT Status</label>
  83. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="mqttStatus" readonly />
  84. </div>
  85. <div class="pure-g module module-ds">
  86. <label class="pure-u-1 pure-u-sm-1-4" for="dsTmp">Temperature (ºC)</label>
  87. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="dsTmp" readonly />
  88. </div>
  89. <div class="pure-g module module-dht">
  90. <label class="pure-u-1 pure-u-sm-1-4" for="dhtTmp">Temperature (ºC)</label>
  91. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="dhtTmp" readonly />
  92. </div>
  93. <div class="pure-g module module-dht">
  94. <label class="pure-u-1 pure-u-sm-1-4" for="dhtHum">Humidity (%)</label>
  95. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="dhtHum" readonly />
  96. </div>
  97. <div class="pure-g module module-pow">
  98. <label class="pure-u-1 pure-u-sm-1-4" for="powActivePower">Power (W)</label>
  99. <input class="pure-u-1 pure-u-sm-3-4" type="text" name="powActivePower" readonly />
  100. </div>
  101. <div id="relays">
  102. </div>
  103. <div id="relayTemplate">
  104. <div class="pure-g">
  105. <div class="pure-u-1 pure-u-sm-1-4"><label >Relay<span class="relay_id"></span> Status</label></div>
  106. <div class="pure-u-1 pure-u-sm-1-4"><input type="checkbox" class="relayStatus" data="0" /></div>
  107. </div>
  108. </div>
  109. </fieldset>
  110. </form>
  111. </div>
  112. </div>
  113. <form id="formSave" class="pure-form" action="/" method="post">
  114. <div class="panel" id="panel-general">
  115. <div class="header">
  116. <h1>GENERAL</h1>
  117. <h2>General configuration values</h2>
  118. </div>
  119. <div class="page">
  120. <fieldset>
  121. <div class="pure-g">
  122. <label class="pure-u-1 pure-u-md-1-4" for="hostname">Hostname</label>
  123. <input name="hostname" class="pure-u-1 pure-u-md-3-4" type="text" tabindex="1" />
  124. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  125. <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>
  126. </div>
  127. <div class="pure-g">
  128. <label class="pure-u-1 pure-u-md-1-4" for="relayMode">Relay boot mode</label>
  129. <div class="pure-u-1 pure-u-md-3-4">
  130. <select name="relayMode" class="pure-u-1-2" tabindex="2">
  131. <option value="0">Always OFF</a>
  132. <option value="1">Always ON</a>
  133. <option value="2">Same as before</a>
  134. </select>
  135. </div>
  136. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  137. <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>
  138. </div>
  139. <div class="pure-g module module-multirelay">
  140. <label class="pure-u-1 pure-u-md-1-4" for="relaySync">Relay sync mode</label>
  141. <div class="pure-u-1 pure-u-md-3-4">
  142. <select name="relaySync" class="pure-u-1-2" tabindex="2">
  143. <option value="0">No synchonisation</a>
  144. <option value="1">Zero or one relays active</a>
  145. <option value="2">One and just one relay active</a>
  146. <option value="3">All synchonised</a>
  147. </select>
  148. </div>
  149. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  150. <div class="pure-u-1 pure-u-md-3-4 hint">Define how the different relays should be synchronized.</div>
  151. </div>
  152. <div class="pure-g">
  153. <label class="pure-u-1 pure-u-md-1-4" for="adminPass">Admin password</label>
  154. <input name="adminPass" class="pure-u-1 pure-u-md-3-4" type="text" tabindex="3" />
  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">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>
  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. <div class="pure-g">
  163. <div class="pure-u-1 pure-u-sm-1-4"><label for="apiEnabled">Enable HTTP API</label></div>
  164. <div class="pure-u-1 pure-u-sm-1-4"><input type="checkbox" name="apiEnabled" /></div>
  165. </div>
  166. <div class="pure-g">
  167. <label class="pure-u-1 pure-u-md-1-4" for="apiKey">HTTP API Key</label>
  168. <input name="apiKey" class="pure-u-3-4 pure-u-md-1-2" type="text" tabindex="4" />
  169. <div class=" pure-u-1-4 pure-u-md-1-4"><button class="pure-button button-apikey pure-u-23-24">Generate</button></div>
  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">This is the key you will have to pass with every HTTP request to the API, either to get or write values.</div>
  172. </div>
  173. </fieldset>
  174. </div>
  175. </div>
  176. <div class="panel" id="panel-wifi">
  177. <div class="header">
  178. <h1>WIFI</h1>
  179. <h2>You can configure up to 3 different WiFi networks. The device will try to connect in order of signal strength.</h2>
  180. </div>
  181. <div class="page">
  182. <fieldset>
  183. <legend>First network</legend>
  184. <div class="pure-g">
  185. <div class="pure-u-1 pure-u-md-1-2">
  186. <label for="ssid">SSID</label>
  187. <input type="text" class="pure-u-23-24" tabindex="10" name="ssid" />
  188. </div>
  189. <div class="pure-u-1 pure-u-md-1-2">
  190. <label for="pass">Password</label>
  191. <input type="text" class="pure-u-23-24" tabindex="11" name="pass" />
  192. </div>
  193. </div>
  194. <legend>Second network</legend>
  195. <div class="pure-g">
  196. <div class="pure-u-1 pure-u-md-1-2">
  197. <label for="ssid">SSID</label>
  198. <input type="text" class="pure-u-23-24" tabindex="12" name="ssid" />
  199. </div>
  200. <div class="pure-u-1 pure-u-md-1-2">
  201. <label for="pass">Password</label>
  202. <input type="text" class="pure-u-23-24" tabindex="13" name="pass" />
  203. </div>
  204. </div>
  205. <legend>Third network</legend>
  206. <div class="pure-g">
  207. <div class="pure-u-1 pure-u-md-1-2">
  208. <label for="ssid">SSID</label>
  209. <input type="text" class="pure-u-23-24" tabindex="14" name="ssid" />
  210. </div>
  211. <div class="pure-u-1 pure-u-md-1-2">
  212. <label for="pass">Password</label>
  213. <input type="text" class="pure-u-23-24" tabindex="15" name="pass" />
  214. </div>
  215. </div>
  216. </fieldset>
  217. </div>
  218. </div>
  219. <div class="panel" id="panel-mqtt">
  220. <div class="header">
  221. <h1>MQTT</h1>
  222. <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>
  223. </div>
  224. <div class="page">
  225. <fieldset>
  226. <div class="pure-g">
  227. <label class="pure-u-1 pure-u-md-1-4" for="mqttServer">MQTT Server</label>
  228. <input class="pure-u-1 pure-u-md-3-4" name="mqttServer" type="text" size="20" tabindex="10" placeholder="MQTT Server" />
  229. </div>
  230. <div class="pure-g">
  231. <label class="pure-u-1 pure-u-md-1-4" for="mqttPort">MQTT Port</label>
  232. <input class="pure-u-1 pure-u-md-3-4" name="mqttPort" type="text" size="6" tabindex="11" placeholder="1883" />
  233. </div>
  234. <div class="pure-g">
  235. <label class="pure-u-1 pure-u-md-1-4" for="mqttUser">MQTT User</label>
  236. <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" />
  237. </div>
  238. <div class="pure-g">
  239. <label class="pure-u-1 pure-u-md-1-4" for="mqttPassword">MQTT Password</label>
  240. <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" />
  241. </div>
  242. <div class="pure-g">
  243. <label class="pure-u-1 pure-u-md-1-4" for="mqttTopic">MQTT Topic</label>
  244. <input class="pure-u-1 pure-u-md-3-4" name="mqttTopic" type="text" size="20" tabindex="14" />
  245. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  246. <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>
  247. </div>
  248. </fieldset>
  249. </div>
  250. </div>
  251. <div class="panel" id="panel-power">
  252. <div class="header">
  253. <h1>POWER</h1>
  254. <h2>
  255. 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.
  256. </h2>
  257. </div>
  258. <div class="page">
  259. <fieldset>
  260. <div class="pure-g">
  261. <label class="pure-u-1 pure-u-md-1-4" for="powExpectedPower">AC RMS Active Power</label>
  262. <input class="pure-u-1 pure-u-md-3-4 powExpected" name="powExpectedPower" type="text" size="8" tabindex="40" placeholder="0" />
  263. <div class="pure-u-0 pure-u-md-1-4">&nbsp;</div>
  264. <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>
  265. </div>
  266. </fieldset>
  267. </div>
  268. </div>
  269. </form>
  270. </div> <!-- content -->
  271. </div> <!-- layout -->
  272. </body>
  273. <!-- build:js script.js -->
  274. <script src="jquery-1.12.3.min.js"></script>
  275. <script src="checkboxes.js"></script>
  276. <script src="custom.js"></script>
  277. <!-- endbuild -->
  278. </html>