|
|
@@ -180,16 +180,11 @@ This will instruct the ESP to send messages to RGB+CCT bulbs with device ID `0x1
|
|
|
|
|
|
To enable passive listening, make sure that `listen_repeats` is set to something larger than 0 (the default value of 3 is a good choice).
|
|
|
|
|
|
-To publish data from intercepted packets to an MQTT topic, configure MQTT server settings, and set the `mqtt_update_topic_pattern` to something of your choice. As with `mqtt_topic_pattern`, the tokens `:device_id`, `:device_type`, and `:group_id` will be substituted with the values from the relevant packet.
|
|
|
+To publish data from intercepted packets to an MQTT topic, configure MQTT server settings, and set the `mqtt_update_topic_pattern` to something of your choice. As with `mqtt_topic_pattern`, the tokens `:device_id`, `:device_type`, and `:group_id` will be substituted with the values from the relevant packet. `:device_id` will always be substituted with the hexadecimal value of the ID. You can also use `:hex_device_id`, or `:dec_device_id` if you prefer decimal.
|
|
|
|
|
|
-The published message is a JSON blob containing the following keys:
|
|
|
+The published message is a JSON blob containing the state that was changed.
|
|
|
|
|
|
-* `device_id`
|
|
|
-* `device_type` (rgb_cct, rgbw, etc.)
|
|
|
-* `group_id`
|
|
|
-* Any number of: `status`, `level`, `hue`, `saturation`, `kelvin`
|
|
|
-
|
|
|
-As an example, if `mqtt_update_topic_pattern` is set to `milight/updates/:device_id/:device_type/:group_id`, and the group 1 on button of a Milight remote is pressed, the following update will be dispatched:
|
|
|
+As an example, if `mqtt_update_topic_pattern` is set to `milight/updates/:hex_device_id/:device_type/:group_id`, and the group 1 on button of a Milight remote is pressed, the following update will be dispatched:
|
|
|
|
|
|
```ruby
|
|
|
irb(main):005:0> client.subscribe('milight/updates/+/+/+')
|
|
|
@@ -198,6 +193,8 @@ irb(main):006:0> puts client.get.inspect
|
|
|
["lights/updates/0x1C8E/rgb_cct/1", "{\"device_id\":7310,\"group_id\":1,\"device_type\":\"rgb_cct\",\"status\":\"on\"}"]
|
|
|
```
|
|
|
|
|
|
+**Make sure that `mqtt_topic_pattern` and `matt_update_topic_pattern` are different!** If they are they same you can put your ESP in a loop where its own updates trigger an infinite command loop.
|
|
|
+
|
|
|
## UDP Gateways
|
|
|
|
|
|
You can add an arbitrary number of UDP gateways through the REST API or through the web UI. Each gateway server listens on a port and responds to the standard set of commands supported by the Milight protocol. This should allow you to use one of these with standard Milight integrations (SmartThings, Home Assistant, OpenHAB, etc.).
|