forked from uncdubdiver/hubitat-govee-led-lights
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·221 lines (201 loc) · 9.7 KB
/
index.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Expires" content="Fri, Jan 01 1900 00:00:00 GMT">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Lang" content="en">
<meta name="author" content="Dean Berman - DB Development">
<meta http-equiv="Reply-to" content="[email protected]">
<meta name="generator" content="PhpED 8.0">
<meta name="description" content="Govee LED Lights device configuration page">
<meta name="keywords" content="">
<meta name="creation-date" content="11/09/2020">
<meta name="revisit-after" content="15 days">
<title>Govee LED Lights - Device Configuration</title>
<!-- Latest available jQuery v3.5.1 -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#config-btn').bind('click', function() {
var apikey = $('#apikey').val();
if(apikey == '') {
alert('Missing API Key. Please enter it in and try again.');
return false;
}
$('#config-results').html('Loading, please wait...');
$.ajax({
url: 'https://www.deanberman.com/govee/hubitat/_devices.php',
type: 'GET',
data: {
'Govee-API-Key': apikey
},
success: function(data) {
var resp = '';
data = JSON.parse(data);
if(data.code != '200' || data.message != 'Success') {
alert('There was a problem getting your Govee devices. Please confirm your Govee API Key and try again.');
return false;
}
if((data.data.devices).length == 0) {
alert('You have no accessible devices setup within your Govee account at this time.');
return false;
}
resp += '<div class="row"><div class="col-xs-12"> </div></div>';
resp += '<div class="row">';
resp += '<div class="col-xs-3"><strong>Device Name</strong></div>';
resp += '<div class="col-xs-2"><strong>Model</strong></div>';
resp += '<div class="col-xs-7"><strong>Device ID</strong></div>';
// Now to loop throught the devices and print accordingly...
for(var a = 0; a < (data.data.devices).length; a++) {
resp += '<div class="col-xs-3">' + data.data.devices[a].deviceName + '</div>';
resp += '<div class="col-xs-2">' + data.data.devices[a].model + '</div>';
resp += '<div class="col-xs-7">' + data.data.devices[a].device + '</div>';
}
resp += '</div>';
resp += '<div class="row"><div class="col-xs-12"> </div></div>';
resp += '<div class="row">';
resp += '<div class="col-xs-12">Please use the list below to populate the Hubitat Device preferences page (see setup steps for <strong>Device</strong>).</div>';
resp += '</div>';
$('#config-results').html(resp);
},
error: function(xhr, ajaxOptions, thrownError) {
alert('There was an error with your Govee API Key. Please confirm and try again.');
return false;
}
});
});
});
</script>
</head>
<body>
<div class="container" style="padding-top:25px;">
<h2>Govee LED Lights - Device Configuration</h2>
<h4>DB Development - Dean Berman</h4>
<h6>Created/Last Updated: 2020-11-09</h6>
<br />
<div class="alert alert-danger">IMPORTANT: This is not sponsered or paid for or supported by Govee, this was generated to help anyone else [other than just myself] to get the amazing WiFi Govee LED Lights into Hubitat for integration, automation, smart panels, ActionTiles, SharpTools, etc.</div>
<br />
<ul class="nav nav-tabs" role="tablist">
<li role="presentation" class="active"><a href="#home" role="tab" data-toggle="tab">Home</a></li>
<li role="presentation"><a href="#config" role="tab" data-toggle="tab">Configuration</a></li>
<li role="presentation"><a href="https://github.com/uncdubdiver/hubitat-govee-led-lights" target="_blank">GitHub</a></li>
</ul>
<div class="tab-content">
<div id="home" class="tab-pane fade active in">
<div class="panel panel-default">
<div class="panel-body">
The Govee LED Lights Hubitat Device Type was generated to fill a need with accessing the WiFi connected Govee LED Lights.
<br /><br />
The Device Type Handler is built to handle any of the existing WiFi connected Govee LED Lights that are accesible through their API.
<br /><br />
The following list of model numbers are currently supported:
<ul>
<li>H6160</li>
<li>H6163</li>
<li>H6104</li>
<li>H6109</li>
<li>H6110</li>
<li>H6117</li>
<li>H6159</li>
<li>H7021</li>
<li>H7022</li>
<li>H6086</li>
<li>H6089</li>
<li>H6182</li>
<li>H6085</li>
<li>H7014</li>
<li>H5081</li>
<li>H6188</li>
<li>H6135</li>
<li>H6137</li>
<li>H6141</li>
<li>H6142</li>
<li>H6195</li>
<li>H6196</li>
<li>H7005</li>
<li>H6083</li>
<li>H6002</li>
<li>H6003</li>
<li>H6148</li>
</ul>
<br />
To get your Govee LED Lights device setup properly within Hubitat, please follow the steps below.
<br />
<h4>Govee API Key</h4>
<ol>
<li>Open the Govee Home app on your mobile device.</li>
<li>In the navigation, go to the <em>user/profile</em> page by clicking on the user icon.</li>
<li>In the <em>My Profile</em> page, select <em>About Us</em>.</li>
<li>In the <em>About Us</em> page, select <em>Apply for API Key</em>.</li>
<li>Fill in the form on the <em>Apply for API Key</em> page to retrieve a unique API key for your Govee user account.</li>
<li>
Click [Submit] to apply.
<br />
<em>You will receive an email from Govee soon with your unique API key.</em>
</li>
</ol>
<h4>Drivers Code</h4>
<ol>
<li>Login to the Hubitat local hub.</li>
<li>In the <em>Hubitat IDE</em>, navigate to <em>Drivers Code</em> link/page.</li>
<li>In the <em>Drivers Code</em> page, click the [+ New Driver] button.</li>
<li>In the <em>New Driver</em> page, from the DB Development Govee LED Strips GitHub page, copy-and-paste in the code for the Driver Code content in this form/page.</li>
<li>Click [Save] to save and continue.</li>
</ol>
<h4>Device</h4>
<ol>
<li>Login to the Hubitat local hub.</li>
<li>In the <em>Hubitat IDE</em>, navigate to <em>Devices</em> link/page.</li>
<li>In the <em>Devices</em> page, click the [+ Add VirtualDevice] button.</li>
<li>
In the <em>New Device</em> page, setup the following settings:
<ul>
<li>Device Name: Govee LED Lights</li>
<li>Device Label: Govee LED Lights</li>
<li>Zigbee Id: <blank>sd</li>
<li>Event history size: <blank></li>
<li>State history size: <blank></li>
<li>Device Network Id: <unchanged></li>
<li>Type: Govee LED Strips</li>
<li>Hub mesh enabled: <unchanged></li>
</ul>
Once completed, click [Save Device].
</li>
<li>Once the page reloads, scroll to the <em>Preferences</em> section and set the following:</li>
<li>
<ul>
<li><strong>Govee API Key - Designated Govee API Key for accessing their system</strong> - this value is given to you by Govee from their app (should be found on the Configuration tab)</li>
<li><strong>Govee KED Device ID - Device ID for the Govee LED Lights</strong> - can be found on the Configuration tab</li>
<li><strong>Govee LED Model - Model number of the Govee LED Lights</strong> - can be found on the Configuration tab</li>
</ul>
</li>
<li>Once completed, click [Save Preferences].</li>
</ol>
</div>
</div>
</div>
<div id="config" class="tab-pane fade">
<div class="panel panel-default">
<div class="panel-body">
The following form/details below will allow you to confirm your Hubitat Device preferences accordingly.
<br /><br />
<label>Govee API Key:</label> <input type="text" name="apikey" id="apikey" class="form-control">
<small><em>Designated Govee API Key for accessing their system</em></small>
<br /><br />
<button name="config-btn" id="config-btn" class="btn btn-sm btn-info">Get Configuration</button>
<div id="config-results"></div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>