hueget 0.6.0 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -3
- package/README.md +55 -22
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,9 +4,10 @@ See the [Readme file](https://github.com/jsiegenthaler/hueget/blob/master/README
|
|
|
4
4
|
|
|
5
5
|
# Bug Fixes and Improvements
|
|
6
6
|
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
## 0.6.3 (2023-11-26)
|
|
8
|
+
* Added some README.md improvements
|
|
9
|
+
* Bumped dependencies: "axios": "^1.6.2"
|
|
10
|
+
* Bumped dependencies: "node": "^20.10.0"
|
|
10
11
|
|
|
11
12
|
## 0.6.0 (2023-01-04)
|
|
12
13
|
* Fixed some more documentation errors in the README.md
|
package/README.md
CHANGED
|
@@ -77,14 +77,18 @@ The same again, but using port `1234`:
|
|
|
77
77
|
```
|
|
78
78
|
$ node /usr/local/lib/node_modules/hueget/hueget.js -i 192.168.0.101 -u UBxWZChHseyjeFwAkwgbdQ08x9XASWpanZZVg-mj -p 1234
|
|
79
79
|
```
|
|
80
|
-
A successful start of hueget will show:
|
|
80
|
+
A successful start of hueget (using the above command to specify ip address 192.168.0.100 and port 1234) will show:
|
|
81
81
|
```
|
|
82
|
-
hueget v0.6.
|
|
82
|
+
hueget v0.6.2
|
|
83
83
|
commands will be sent to 192.168.0.101 with username UBxWZChHseyjeFwAkwgbdQ08x9XASWpanZZVg-mj
|
|
84
84
|
listening on port 1234
|
|
85
85
|
```
|
|
86
86
|
# Starting hueget as a Service
|
|
87
87
|
Ideally hueget will run all the time. You need a tool to start hueget when your system restarts. On my raspberry pi, I use [pm2](https://github.com/Unitech/pm2) (Process Management Module).
|
|
88
|
+
|
|
89
|
+
To startup pm2 running so it auto-starts on pi reboot, use this command and follow the instructions from pm2:
|
|
90
|
+
$ pm2 startup
|
|
91
|
+
|
|
88
92
|
To start hueget with pm2, and have it daemonized, monitored and kept alive forever:
|
|
89
93
|
```
|
|
90
94
|
$ pm2 start /usr/local/lib/node_modules/hueget/hueget.js -- -i 192.168.0.101 -u UBxWZChHseyjeFwAkwgbdQ08x9XASWpanZZVg-mj -p 3000
|
|
@@ -98,7 +102,7 @@ Save the pm2 config so that hueget automatically loads when the server restarts:
|
|
|
98
102
|
$ pm2 save
|
|
99
103
|
```
|
|
100
104
|
|
|
101
|
-
Managing hueget in pm2 is
|
|
105
|
+
Managing hueget in pm2 is straightforward:
|
|
102
106
|
```
|
|
103
107
|
$ pm2 status
|
|
104
108
|
$ pm2 start /usr/local/lib/node_modules/hueget/hueget.js -- -i 192.168.0.101 -u UBxWZChHseyjeFwAkwgbdQ08x9XASWpanZZVg-mj -p 3000
|
|
@@ -132,6 +136,7 @@ Examples:
|
|
|
132
136
|
Enter a URL (in the format shown below) into your browser and press Enter. The ip address is the ip address of the device running hueget, eg: a raspberry pi.
|
|
133
137
|
Examples:
|
|
134
138
|
## Lights
|
|
139
|
+
### Light 31 (example)
|
|
135
140
|
* Turn light 31 on: http://192.168.0.101:3000/api/yourPhilipsHueBridgeUsername/lights/31/state?on=true
|
|
136
141
|
* Turn light 31 off: http://192.168.0.101:3000/api/yourPhilipsHueBridgeUsername/lights/31/state?on=false
|
|
137
142
|
* Turn light 31 on at 50% brightness: http://192.168.0.101:3000/api/yourPhilipsHueBridgeUsername/lights/31/state?on=true&bri=50
|
|
@@ -141,8 +146,15 @@ Examples:
|
|
|
141
146
|
* Identify light 31 with 15 seconds of blinking: http://192.168.0.101:3000/api/yourPhilipsHueBridgeUsername/lights/31/state?alert=lselect
|
|
142
147
|
|
|
143
148
|
## Groups
|
|
149
|
+
### Group 0 (a special group for all lights in your home)
|
|
150
|
+
* Turn group 0 on: http://192.168.0.101:3000/api/yourPhilipsHueBridgeUsername/groups/0/action?on=true
|
|
151
|
+
* Turn group 0 off: http://192.168.0.101:3000/api/yourPhilipsHueBridgeUsername/groups/0/action?on=false
|
|
152
|
+
* Identify group 0 with 15 seconds of blinking: http://192.168.0.101:3000/api/yourPhilipsHueBridgeUsername/groups/0/action?alert=lselect
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
### Group 2 (example)
|
|
144
156
|
* Turn group 2 on: http://192.168.0.101:3000/api/yourPhilipsHueBridgeUsername/groups/2/action?on=true
|
|
145
|
-
* Turn group 2
|
|
157
|
+
* Turn group 2 off: http://192.168.0.101:3000/api/yourPhilipsHueBridgeUsername/groups/2/action?on=false
|
|
146
158
|
* Turn group 2 on at 50% brightness: http://192.168.0.101:3000/api/yourPhilipsHueBridgeUsername/groups/2/action?on=true&bri=50
|
|
147
159
|
* Turn group 2 on at 100% brightness: http://192.168.0.101:3000/api/yourPhilipsHueBridgeUsername/groups/2/action?on=true&bri=100
|
|
148
160
|
* Turn group 2 on at 100% brightness, 0.5,0.6 xy: http://192.168.0.101:3000/api/yourPhilipsHueBridgeUsername/groups/2/state?on=true&bri=100&xy=[0.5%2c0.6]
|
|
@@ -156,43 +168,41 @@ The API is transparent to all Philips Hue keywords. It expects all name=value pa
|
|
|
156
168
|
|
|
157
169
|
The full JSON response for a light looks like this:
|
|
158
170
|
```
|
|
159
|
-
{"1":{"state":{"on":false,"bri":198,"hue":5360,"sat":192,"effect":"none","xy":[0.5330,0.3870],"ct":500,"alert":"select","colormode":"xy","mode":"homeautomation","reachable":true},"swupdate":{"state":"noupdates","lastinstall":"2021-08-21T01:50:00"},"type":"Extended color light","name":"Standard Lamp","modelid":"LCA001","manufacturername":"Signify Netherlands B.V.","productname":"Hue color lamp","capabilities":{"certified":true,"control":{"mindimlevel":200,"maxlumen":800,"colorgamuttype":"C","colorgamut":[[0.6915,0.3083],[0.1700,0.7000],[0.1532,0.0475]],"ct":{"min":153,"max":500}},"streaming":{"renderer":true,"proxy":true}},"config":{"archetype":"floorshade","function":"mixed","direction":"omnidirectional","startup":{"mode":"safety","configured":true}},"uniqueid":"00:17:88:01:08:ff:ff:ff-0b","swversion":"1.90.1","swconfigid":"35F80D40","productid":"Philips-LCA001-4-A19ECLv6"}
|
|
171
|
+
{"1":{"state":{"on":false,"bri":198,"hue":5360,"sat":192,"effect":"none","xy":[0.5330,0.3870],"ct":500,"alert":"select","colormode":"xy","mode":"homeautomation","reachable":true},"swupdate":{"state":"noupdates","lastinstall":"2021-08-21T01:50:00"},"type":"Extended color light","name":"Standard Lamp","modelid":"LCA001","manufacturername":"Signify Netherlands B.V.","productname":"Hue color lamp","capabilities":{"certified":true,"control":{"mindimlevel":200,"maxlumen":800,"colorgamuttype":"C","colorgamut":[[0.6915,0.3083],[0.1700,0.7000],[0.1532,0.0475]],"ct":{"min":153,"max":500}},"streaming":{"renderer":true,"proxy":true}},"config":{"archetype":"floorshade","function":"mixed","direction":"omnidirectional","startup":{"mode":"safety","configured":true}},"uniqueid":"00:17:88:01:08:ff:ff:ff-0b","swversion":"1.90.1","swconfigid":"35F80D40","productid":"Philips-LCA001-4-A19ECLv6"}}
|
|
160
172
|
```
|
|
161
173
|
|
|
162
174
|
The full JSON response for a group looks like this:
|
|
163
175
|
```
|
|
164
176
|
{"name":"Lounge","lights":["9","1","2"],"sensors":[],"type":"Room","state":{"all_on":false,"any_on":false},"recycle":false,"class":"Lounge","action":{"on":false,"bri":0,"hue":7800,"sat":138,"effect":"none","xy":[0.5302,0.392],"ct":153,"alert":"select","colormode":"xy"}}
|
|
165
177
|
```
|
|
166
|
-
The
|
|
178
|
+
The most common action keywords for state or group are:
|
|
167
179
|
on, bri, hue, sat, effect, xy, ct, alert, colormode, mode (lights only)
|
|
180
|
+
More keywords exist, see the [API documentation](#api-documentation).
|
|
168
181
|
|
|
169
|
-
## on
|
|
182
|
+
## on (get and set)
|
|
170
183
|
Turn a light on or off. On=true, Off=false.
|
|
171
184
|
Valid for light or group.
|
|
172
185
|
|
|
173
|
-
## bri
|
|
186
|
+
## bri (get and set)
|
|
174
187
|
The brightness value to set the light to. Brightness is a scale from 1 (the minimum the light is capable of) to 254 (the maximum).
|
|
175
188
|
|
|
176
|
-
## hue
|
|
189
|
+
## hue (get and set)
|
|
177
190
|
The hue value to set the light to. The hue value is a wrapping value between 0 and 65535. Both 0 and 65535 are red, 25500 is green and 46920 is blue.
|
|
178
191
|
|
|
179
|
-
## sat
|
|
192
|
+
## sat (get and set)
|
|
180
193
|
Saturation of the light. 254 is the most saturated (colored) and 0 is the least saturated (white).
|
|
181
194
|
|
|
182
|
-
##
|
|
183
|
-
The dynamic effect of the light. “none” and “colorloop” are supported. Other values will generate an error of type 7. Setting the effect to colorloop will cycle through all hues using the current brightness and saturation settings.
|
|
184
|
-
|
|
185
|
-
## xy
|
|
195
|
+
## xy (get and set)
|
|
186
196
|
The xy values represent x and y coordinates of a color in CIE color space. The first value is the x coordinate and the second value is the y coordinate. Both x and y must be between 0 and 1, and will be rounded to 4 decimal places by the Hue bridge, eg: 0.666666 becomes 0.6667.
|
|
187
197
|
If the specified coordinates are not in the CIE color space, the closest color to the coordinates will be chosen.
|
|
188
198
|
|
|
189
199
|
When sending the xy array, you **must** url encode the comma to %2c (or %2C). Here is an example for "xy":\[0.25,0.52\] :
|
|
190
200
|
* Set light 31 to xy of \[0.25,0.52\]: http://192.168.0.101:3000/api/yourPhilipsHueBridgeUsername/lights/31/state?xy=[0.25%2c0.52]
|
|
191
201
|
|
|
192
|
-
## ct
|
|
202
|
+
## ct (get and set)
|
|
193
203
|
The [Mired](https://en.wikipedia.org/wiki/Mired) (micro reciprocal degree) color temperature of the light. Ranges from 153 (6500K) to 500 (2000K). To calculate the mired, use the formula mired = 1000000/K, where K is the desired color temperature. Example: 6500K = 153 mired, calculation 1000000/6500 = 153.8
|
|
194
204
|
|
|
195
|
-
## alert
|
|
205
|
+
## alert (get and set)
|
|
196
206
|
The alert effect, this is a temporary change to the bulb’s state, and has one of the following values:
|
|
197
207
|
* “none” – The light is not performing an alert effect.
|
|
198
208
|
* “select” – The light is performing one breathe cycle.
|
|
@@ -200,15 +210,38 @@ The alert effect, this is a temporary change to the bulb’s state, and has one
|
|
|
200
210
|
|
|
201
211
|
Note that this contains the last alert sent to the light and not its current state. i.e. After the breathe cycle has finished the bridge does not reset the alert to “none“.
|
|
202
212
|
|
|
203
|
-
##
|
|
204
|
-
|
|
213
|
+
## effect (get and set)
|
|
214
|
+
The dynamic effect of the light. Supported values:
|
|
215
|
+
* “none” - No effect
|
|
216
|
+
* “colorloop” - Cycles through all hues using the current brightness and saturation settings.
|
|
217
|
+
|
|
218
|
+
## colormode (get only)
|
|
219
|
+
Indicates the color mode in which the light is working, this is the last command type it received. Values are “hs” for Hue and Saturation, “xy” for XY and “ct” for Color Temperature. This parameter is only present when the light supports at least one of the values.
|
|
220
|
+
|
|
221
|
+
## reachable (get only)
|
|
222
|
+
Indicates if a light can be reached by the bridge.
|
|
223
|
+
|
|
224
|
+
## transitiontime (set only)
|
|
225
|
+
The duration of the transition from the light’s current state to the new state. This is given as a multiple of 100ms and defaults to 4 (400ms).
|
|
226
|
+
|
|
227
|
+
## bri_inc (set only)
|
|
228
|
+
Increments or decrements the value of the brightness. bri_inc is ignored if the bri attribute is provided. Any ongoing bri transition is stopped. Setting a value of 0 also stops any ongoing transition. The bridge will return the bri value after the increment is performed. Range -254 to 254.
|
|
229
|
+
|
|
230
|
+
## sat_inc (set only)
|
|
231
|
+
Increments or decrements the value of the sat. sat_inc is ignored if the sat attribute is provided. Any ongoing sat transition is stopped. Setting a value of 0 also stops any ongoing transition. The bridge will return the sat value after the increment is performed. Range -254 to 254.
|
|
232
|
+
|
|
233
|
+
## hue_inc (set only)
|
|
234
|
+
Increments or decrements the value of the ct. ct_inc is ignored if the ct attribute is provided. Any ongoing color transition is stopped. Setting a value of 0 also stops any ongoing transition. The bridge will return the ct value after the increment is performed. Range -65534 to 65534.
|
|
235
|
+
|
|
236
|
+
## xy_inc (set only)
|
|
237
|
+
Increments or decrements the value of the xy. xy_inc is ignored if the xy attribute is provided. Any ongoing color transition is stopped. Setting a value of 0 also stops any ongoing transition. Will stop at it’s gamut boundaries. The bridge will return the xy value after the increment is performed. List of xy values. Max value [0.5, 0.5].
|
|
205
238
|
|
|
206
|
-
## mode
|
|
207
|
-
Exact use unknown. Looks like it
|
|
239
|
+
## mode (get only)
|
|
240
|
+
Exact use unknown. Looks like it reflects an operating mode. Observed values are: homeautomation
|
|
208
241
|
|
|
209
242
|
|
|
210
243
|
## Further commands
|
|
211
|
-
See the API documentation
|
|
244
|
+
See the [API documentation](#api-documentation).
|
|
212
245
|
|
|
213
246
|
## API Documentation
|
|
214
247
|
For full details of the control capabilities, please see the [official Philips Hue API reference](https://developers.meethue.com/develop/hue-api/).
|
|
@@ -230,6 +263,6 @@ Go backwards in the text until you find the keyword **state**, this is at the st
|
|
|
230
263
|
... ,"31":{"state":{"on":true,"bri":100,"hue":65396 ...
|
|
231
264
|
```
|
|
232
265
|
|
|
233
|
-
Use the same method for groups to find the group id of the room you wish to control.
|
|
266
|
+
Use the same method for groups to find the group id of the room you wish to control. Note that group id 0 is a special group containing all lights in the system, and is not returned by the ‘get all groups’ command. Group 0 is not visible, and cannot be created, modified or deleted using the API.
|
|
234
267
|
|
|
235
268
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hueget",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "A simple API that converts the Philips Hue API PUT to GET requests, allowing control of Philips Hue lights via http GET requests",
|
|
5
5
|
"main": "hueget.js",
|
|
6
6
|
"scripts": {
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"author": "Jochen Siegenthaler (https://github.com/jsiegenthaler)",
|
|
26
26
|
"license": "ISC",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"axios": "^1.
|
|
28
|
+
"axios": "^1.6.2",
|
|
29
29
|
"express": "^4.18.2",
|
|
30
30
|
"stdio": "^2.1.1"
|
|
31
31
|
},
|
|
32
32
|
"engines": {
|
|
33
|
-
"node": "^
|
|
33
|
+
"node": "^20.10.0"
|
|
34
34
|
}
|
|
35
35
|
}
|