You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+56-21Lines changed: 56 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,26 +116,6 @@ If it does not work as expected see [Troubleshooting](https://github.com/sidoh/e
116
116
117
117
If you need to pair some bulbs, how to do this is [described in the wiki](https://github.com/sidoh/esp8266_milight_hub/wiki/Pairing-new-bulbs).
118
118
119
-
## LED Status
120
-
121
-
Some ESP boards have a built-in LED, on pin #2. This LED will flash to indicate the current status of the hub:
122
-
123
-
* Wifi not configured: Fast flash (on/off once per second). See [Configure Wifi](#configure-wifi) to configure the hub.
124
-
* Wifi connected and ready: Occasional blips of light (a flicker of light every 1.5 seconds).
125
-
* Packets sending/receiving: Rapid blips of light for brief periods (three rapid flashes).
126
-
* Wifi failed to configure: Solid light.
127
-
128
-
In the setup UI, you can turn on "enable_solid_led" to change the LED behavior to:
129
-
130
-
* Wifi connected and ready: Solid LED light
131
-
* Wifi failed to configure: Light off
132
-
133
-
Note that you must restart the hub to affect the change in "enable_solid_led".
134
-
135
-
You can configure the LED pin from the web console. Note that pin means the GPIO number, not the D number ... for example, D2 is actually GPIO4 and therefore its pin 4. If you specify the pin as a negative number, it will invert the LED signal (the built-in LED on pin 2 is inverted, so the default is -2).
136
-
137
-
If you want to wire up your own LED on a pin, such as on D2/GPIO4, put a wire from D2 to one side of a 220 ohm resister. On the other side, connect it to the positive side (the longer wire) of a 3.3V LED. Then connect the negative side of the LED (the shorter wire) to ground. If you use a different voltage LED, or a high current LED, you will need to add a driver circuit.
138
-
139
119
## Device Aliases
140
120
141
121
You can configure aliases or labels for a given _(Device Type, Device ID, Group ID)_ tuple. For example, you might want to call the RGB+CCT remote with the ID `0x1111` and the Group ID `1` to be called `living_room`. Aliases are useful in a couple of different ways:
@@ -150,7 +130,7 @@ The REST API is specified using
150
130
151
131
[openapi.yaml](openapi.yaml) contains the raw spec, created using [OpenAPI v3](https://swagger.io/docs/specification/about/).
152
132
153
-
[You can view generated documentation for the master branch here.](https://sidoh.github.io/esp8266_milight_hub/master)
133
+
[You can view generated documentation for the master branch here.](https://sidoh.github.io/esp8266_milight_hub/branches/latest)
154
134
155
135
[Docs for other branches can be found here](https://sidoh.github.io/esp8266_milight_hub)
156
136
@@ -244,6 +224,61 @@ You can add an arbitrary number of UDP gateways through the REST API or through
244
224
245
225
You can select between versions 5 and 6 of the UDP protocol (documented [here](http://www.limitlessled.com/dev/)). Version 6 has support for the newer RGB+CCT bulbs and also includes response packets, which can theoretically improve reliability. Version 5 has much smaller packets and is probably lower latency.
246
226
227
+
## Transitions
228
+
229
+
Transitions between two given states are supported. Depending on how transition commands are being issued, the duration and smoothness of the transition are both configurable. There are a few ways to use transitions:
230
+
231
+
#### RESTful `/transitions` routes
232
+
233
+
These routes are fully documented in the [REST API documentation](https://sidoh.github.io/esp8266_milight_hub/branches/latest/#tag/Transitions).
234
+
235
+
#### `transition` field when issuing commands
236
+
237
+
When you issue a command to a bulb either via REST or MQTT, you can include a `transition` field. The value of this field specifies the duration of the transition, in seconds (non-integer values are supported).
238
+
239
+
For example, the command:
240
+
241
+
```json
242
+
{"brightness":255,"transition":60}
243
+
```
244
+
245
+
will transition from whatever the current brightness is to `brightness=255` over 60 seconds.
246
+
247
+
#### Notes on transitions
248
+
249
+
* espMH's transitions should work seamlessly with [HomeAssistant's transition functionality](https://www.home-assistant.io/components/light/).
250
+
* You can issue commands specifying transitions between many fields at once. For example:
251
+
```json
252
+
{"brightness":255,"kelvin":0,"transition":10.5}
253
+
```
254
+
will transition from current values for brightness and kelvin to the specified values -- 255 and 0 respectively -- over 10.5 seconds.
255
+
* Color transitions are supported. Under the hood, this is treated as a transition between current values for r, g, and b to the r, g, b values for the specified color. Because milight uses hue-sat colors, this might not behave exactly as you'd expect for all colors.
256
+
* You can transition to a given `status` or `state`. For example,
257
+
```json
258
+
{"status":"ON","transition":10}
259
+
```
260
+
will turn the bulb on, immediately set the brightness to 0, and then transition to brightness=255 over 10 seconds. If you specify a brightness value, the transition will stop there instead of 255.
261
+
262
+
## LED Status
263
+
264
+
Some ESP boards have a built-in LED, on pin #2. This LED will flash to indicate the current status of the hub:
265
+
266
+
* Wifi not configured: Fast flash (on/off once per second). See [Configure Wifi](#configure-wifi) to configure the hub.
267
+
* Wifi connected and ready: Occasional blips of light (a flicker of light every 1.5 seconds).
268
+
* Packets sending/receiving: Rapid blips of light for brief periods (three rapid flashes).
269
+
* Wifi failed to configure: Solid light.
270
+
271
+
In the setup UI, you can turn on "enable_solid_led" to change the LED behavior to:
272
+
273
+
* Wifi connected and ready: Solid LED light
274
+
* Wifi failed to configure: Light off
275
+
276
+
Note that you must restart the hub to affect the change in "enable_solid_led".
277
+
278
+
You can configure the LED pin from the web console. Note that pin means the GPIO number, not the D number ... for example, D2 is actually GPIO4 and therefore its pin 4. If you specify the pin as a negative number, it will invert the LED signal (the built-in LED on pin 2 is inverted, so the default is -2).
279
+
280
+
If you want to wire up your own LED on a pin, such as on D2/GPIO4, put a wire from D2 to one side of a 220 ohm resister. On the other side, connect it to the positive side (the longer wire) of a 3.3V LED. Then connect the negative side of the LED (the shorter wire) to ground. If you use a different voltage LED, or a high current LED, you will need to add a driver circuit.
281
+
247
282
## Development
248
283
249
284
This project is developed and built using [PlatformIO](https://platformio.org/).
Copy file name to clipboardExpand all lines: docs/openapi.yaml
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -771,6 +771,7 @@ components:
771
771
- group_id
772
772
- device_type
773
773
- oh_color
774
+
- hex_color
774
775
description: >
775
776
Defines a field which is a part of state for a particular light device. Most fields are self-explanatory, but documentation for each follows:
776
777
@@ -786,6 +787,8 @@ components:
786
787
787
788
* `oh_color` - same as `color` with a format compatible with [OpenHAB's colorRGB channel type](https://www.openhab.org/addons/bindings/mqtt.generic/#channel-type-colorrgb-colorhsb).
788
789
790
+
* `hex_color` - same as `color` except in hex color (e.g., `#FF0000` for red).
791
+
789
792
* `device_id` / `device_type` / `group_id` - this information is in the MQTT topic or REST route, but can be included in the payload in the case that processing the topic or route is more difficult.
0 commit comments