-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.html
executable file
·109 lines (99 loc) · 5.59 KB
/
options.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html>
<head>
<title>Charge Control Options</title>
</head>
<body style="font-size: medium">
<h3>Options:</h3>
<table>
<tr>
<td> Max Charge %</td>
<td>
<input type="number" name="" id="max-charge-percent">
</td>
</tr>
<tr>
<td> Minimum Charge %</td>
<td>
<input type="number" name="" id="min-charge-percent">
</td>
</tr>
<tr>
<td> <a href="https://ifttt.com/maker_webhooks/settings" target="_blank">Webhook API Key</a> </td>
<td>
<input type="password" name="" id="api-key" placeholder="key...">
</td>
</tr>
<tr>
<td>Show API Key</td>
<td><input type="checkbox" name="" id="show-api-key"></td>
</tr>
<tr>
<td> "Turn On" Event Name</a> </td>
<td>
<input type="text" name="" id="on-event-name" placeholder="event_name...">
</td>
</tr>
<tr>
<td> "Turn Off" Event Name</a> </td>
<td>
<input type="text" name="" id="off-event-name" placeholder="event_name...">
</td>
</tr>
<tr>
<td>
<button id="save">Save</button>
<button id="close">Close</button>
</td>
<td>
<button id="test-on">Test "Turn On"</button>
<button id="test-off">Test "Turn Off"</button>
</td>
</tr>
</table>
<div id="status"></div>
<h2>Setup Instructions</h2>
<h3><em>Note: As of the most recent update Gosund outlets have had their IFTT integration disabled, but any othe IFTT enabled outlet should still
work</em></h3>
<h3><a href="https://github.com/allen-n/charge-control-chrome-extension/wiki" target="_blank">Most up to date setup
instructions. </a> </h3>
<ol>
<li>Getting the smart outlets: I'm using <a
href="https://smile.amazon.com/gp/product/B079MFTYMV/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&psc=1">Smart
Plug, Gosund Mini WiFi Outlet</a>. But any smart plug that can interact with <a
href="https://ifttt.com/">IFTT</a> should work. The rest of this walkthrough will assume you're
using these outlets, but the steps should be easily transferrable if you aren't.</li>
<li><a href="https://ifttt.com/">Log in</a> or <a href="https://ifttt.com/join">create</a> an IFTT account.</li>
<li><a href="https://ifttt.com/create">Create your applet</a>. You should see "If <em>This</em> then
<em>that</em> on the screen.</li>
<li>Click <em>This</em> and search for "webhooks". Click it, then click "receive web
request". Then you'll want to give it a name, something like "outlet_off" will do. Just
don't put blank spaces like " " in the name! <img width="50%"
src="https://i.imgur.com/4WTPJX9.jpg" alt="Outlet Off Webhook Image"></li>
<li>Now select <em>that</em>. <img width="50%" src="https://i.imgur.com/sYcRqpY.jpg" alt="Select That Image">
</li>
<li>Search for your smart outlet developer. For GoSund, search for "smart life".<img width="50%"
src="https://i.imgur.com/O02XM9A.jpg" alt="Smart Life Logo"></li>
<li>Log in with your GoSund account, and select the off event (you'll do "on" for the second
event). <img width="50%" src="https://i.imgur.com/y0qSfew.jpg" alt="On/Off Events Image"></li>
<li>Select the outlet you want to control from the menu, create the event, uncheck "Receive notifications
when this applet runs, and click finish. <img width="50%" src="https://i.imgur.com/00r6r03.jpg"
alt="Select Outlet Image"></li>
<li>Repeat steps 3-6, but this time naming the event something along the lines of "outlet_on" in step
4, and selecting the off event in step 5. You now have your two event names!</li>
<li>Get your API key by clicking "documentation on <a href="https://ifttt.com/maker_webhooks">this
page</a>. <img width="50%" src="https://i.imgur.com/Jq08e2q.jpg" alt="Documentation Page"></li>
<li>The string at the top of your page after "Your key is:" is your key, record it!</li>
<li>Open the extension menu, click "options", and add the information as follows: webhook API key is
the key from step 8,
"Turn On" Event Name is the event name with "on" in it from the second time you did step
4, and "Turn Off" Event Name is the event name with "off" in it from the first time you
did step 4. <img width="50%" src="https://i.imgur.com/JZ0n8Na.jpg" alt="Options Menu Image"></li>
<li>Press save, and you're ready to roll! Test the outlet control by clicking "Test Turn On/Off",
which should turn your outlet on and off. If everything is working, you're set to go.</li>
<li>Don't forget to turn the extension off via the popup menu if you want to charge to 100% before a day out
on the town :) <img width="50%" src="https://i.imgur.com/gF0ooAd.jpg" alt="On/Off Button Popup Image"></li>
</ol>
<script src="scripts/options.js"></script>
</body>
</html>