MQTT binding with espmilight mostly working, not getting updates in openhab when using remote

So I’ve transitioned from OH 2 to OH3 recently, I have had mlights set up since OH2 working good. Everything was working well in OH2, sending a command from OH to the lights as well as updates made from the remote showed in OH. Currently using OH 3.3.0

transitioned to OH3, everything works well, in terms of anything sent from openhab, such as turning on off lights, levels, color work well. Although it does not appear that any changes made with the remote are not showing in OH. in the past if I turned on a light with the remote the changes would be reflected in OH.

Nothing has changed in my espsetup:

MQTT topic pattern: milight/commands/:device_id/:device_type/:group_id
MQTT state topic pattern: milight/states/:device_id/:device_type/:group_id

Group state fields: state,level,hue,saturation,mode,color_temp,bulb_mode

MQTT for milight setup as this:

Things…

Bridge mqtt:broker:myBroker [ host=“localhost”, secure=false, password=“XXXXXXX”, qos=1, username=“XXXXXXX”]

Thing mqtt:rgb_cct:0x88E1 “Overhead” (mqtt:broker:myBroker) @ “MQTT”
Thing mqtt:rgb_cct:0x88E2 “Spot” (mqtt:broker:myBroker) @ “MQTT”
Thing mqtt:rgb_cct:0x88E3 “Wall” (mqtt:broker:myBroker) @ “MQTT”
Thing mqtt:rgb_cct:0x88E4 “Sink” (mqtt:broker:myBroker) @ “MQTT”

Thing mqtt:rgb_cct:0xAE91 “Ceiling” (mqtt:broker:myBroker) @ “MQTT”
Thing mqtt:rgb_cct:0xAE92 “Accent” (mqtt:broker:myBroker) @ “MQTT”
Thing mqtt:rgb_cct:0xAE93 “Bedside” (mqtt:broker:myBroker) @ “MQTT”
Thing mqtt:rgb_cct:0xAE94 “Stars” (mqtt:broker:myBroker) @ “MQTT”

items:

// Living Room 1 - Overhead lights
Switch Overhead_light_switch “Overhead Light Switch” {channel=“mqtt:rgb_cct:0x88E1:level”}
Dimmer Overhead_light_temp “Overhead Light Temperature” {channel=“mqtt:rgb_cct:0x88E1:colourTemperature”}
Color Overhead_light_hue “Overhead Light Hue” {channel=“mqtt:rgb_cct:0x88E1:colour”}
Dimmer Overhead_light_level “Overhead Light” {channel=“mqtt:rgb_cct:0x88E1:level”}

// Living Room 2 - Spot Lights
Switch spot_light_switch “Spot Light Switch” {channel=“mqtt:rgb_cct:0x88E2:level”}
Dimmer spot_light_temp “Spot Light Temperature” {channel=“mqtt:rgb_cct:0x88E2:colourTemperature”}
Color spot_light_hue “Spot Light Hue” {channel=“mqtt:rgb_cct:0x88E2:colour”}
Dimmer spot_light_level “Spot Light” {channel=“mqtt:rgb_cct:0x88E2:level”, ga=“light”}

// Living Room 3 - Wall lights
Switch wall_light_switch “Wall Light Switch” { channel=“mqtt:rgb_cct:0x88E3:level” }
Dimmer wall_light_temp “Wall Light Temperature” { channel=“mqtt:rgb_cct:0x88E3:colourTemperature” }
Color wall_light_hue “Wall Light Hue” { channel=“mqtt:rgb_cct:0x88E3:colour” }
Dimmer wall_light_level “Wall Light” { channel=“mqtt:rgb_cct:0x88E3:level”, ga=“light” }

// Living Room 4 - Sink lights
Switch sink_light_switch “Sink Light Switch” {channel=“mqtt:rgb_cct:0x88E4:level”}
Dimmer sink_light_temp “Sink Light Temperature” {channel=“mqtt:rgb_cct:0x88E4:colourTemperature”}
Color sink_light_hue “Sink Light Hue” {channel=“mqtt:rgb_cct:0x88E4:colour”}
Dimmer sink_light_level “Sink Light” {channel=“mqtt:rgb_cct:0x88E4:level”, ga=“light”}

// Bedroom Room 1 - Ceiling lights
Switch ceiling_light_switch “Ceiling Light Switch” {channel=“mqtt:rgb_cct:0xAE91:level”}
Dimmer ceiling_light_temp “Ceiling Light Temperature” {channel=“mqtt:rgb_cct:0xAE91:colourTemperature”}
Color ceiling_light_hue “Ceiling Light Hue” {channel=“mqtt:rgb_cct:0xAE91:colour”}
Dimmer ceiling_light_level “Ceiling Light” {channel=“mqtt:rgb_cct:0xAE91:level”, ga=“light”}

// Bedroom Room 2 - Accent Lights
Switch accent_light_switch “Accent Light Switch” {channel=“mqtt:rgb_cct:0xAE92:level”}
Dimmer accent_light_temp “Accent Light Temperature” {channel=“mqtt:rgb_cct:0xAE92:colourTemperature”}
Color accent_light_hue “Accent Light Hue” {channel=“mqtt:rgb_cct:0xAE92:colour”}
Dimmer accent_light_level “Accent Light” {channel=“mqtt:rgb_cct:0xAE92:level”, ga=“light”}

// Bedroom Room 3 - Bedside lights
Switch bed_light_switch “Bedside Light Switch” {channel=“mqtt:rgb_cct:0xAE93:level”}
Dimmer bed_light_temp “Bedside Light Temperature” {channel=“mqtt:rgb_cct:0xAE93:colourTemperature”}
Color bed_light_hue “Bedside Light Hue” {channel=“mqtt:rgb_cct:0xAE93:colour”}
Dimmer bed_light_level “Bedside Light” {channel=“mqtt:rgb_cct:0xAE93:level”, ga=“light”}

One thing I note, and not sure it matters, but the MQTT updates seem to be different depending on if I’m doing it with the remote or from openhab.

For example, when i turn a specific light off and on via openhab the MQTT topic looks like this: I get two specific lines:

milight/commands/0x88E/rgb_cct/2 {“state”:“OFF”,“level”:0}
milight/states/0x88E/rgb_cct/2 {“state”:“OFF”,“level”:0,“color_temp”:370,“bulb_mode”:“white”}
milight/commands/0x88E/rgb_cct/2 {“state”:“ON”,“level”:62}
milight/states/0x88E/rgb_cct/2 {“state”:“ON”,“level”:62,“color_temp”:370,“bulb_mode”:“white”}

but when doing it with the remote, I get this:

milight/states/0x88E/rgb_cct/2 {“state”:“ON”,“level”:62,“color_temp”:370,“bulb_mode”:“white”}
milight/states/0x88E/rgb_cct/2 {“state”:“OFF”,“level”:62,“color_temp”:370,“bulb_mode”:“white”}

near as I can tell, I have everything setup correctly, just not sure what I might be missing.

thanks for any help anyone might have++

What does the debug or trace logs show? Been a while since I did any tests but the V3 binding does support the updating of the controls when a remote is changed.

It’s the channel settings that are of interest here.

This is what TRACE shows when I use a switch in openhab

17:52:02.801 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“OFF”,“level”:0,“color_temp”:370,“bulb_mode”:“white”}
17:52:02.801 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“OFF”,“level”:0,“color_temp”:370,“bulb_mode”:“white”}
17:52:02.801 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“OFF”,“level”:0,“color_temp”:370,“bulb_mode”:“white”}
17:52:02.801 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“OFF”,“level”:0,“color_temp”:370,“bulb_mode”:“white”}
17:52:02.801 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“OFF”,“level”:0,“color_temp”:370,“bulb_mode”:“white”}
17:52:04.839 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“ON”,“level”:6,“color_temp”:370,“bulb_mode”:“white”}
17:52:04.839 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“ON”,“level”:6,“color_temp”:370,“bulb_mode”:“white”}
17:52:04.839 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“ON”,“level”:6,“color_temp”:370,“bulb_mode”:“white”}
17:52:04.839 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“ON”,“level”:6,“color_temp”:370,“bulb_mode”:“white”}
17:52:04.839 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“ON”,“level”:6,“color_temp”:370,“bulb_mode”:“white”}

and here is the remote

17:53:32.374 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“OFF”,“level”:6,“color_temp”:370,“bulb_mode”:“white”}
17:53:32.374 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“OFF”,“level”:6,“color_temp”:370,“bulb_mode”:“white”}
17:53:32.374 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“OFF”,“level”:6,“color_temp”:370,“bulb_mode”:“white”}
17:53:32.374 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“OFF”,“level”:6,“color_temp”:370,“bulb_mode”:“white”}
17:53:32.374 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“OFF”,“level”:6,“color_temp”:370,“bulb_mode”:“white”}
17:53:38.289 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“ON”,“level”:6,“color_temp”:370,“bulb_mode”:“white”}
17:53:38.289 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“ON”,“level”:6,“color_temp”:370,“bulb_mode”:“white”}
17:53:38.289 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“ON”,“level”:6,“color_temp”:370,“bulb_mode”:“white”}
17:53:38.289 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“ON”,“level”:6,“color_temp”:370,“bulb_mode”:“white”}
17:53:38.289 [TRACE] [internal.handler.EspMilightHubHandler] - Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“ON”,“level”:6,“color_temp”:370,“bulb_mode”:“white”}

i will say that when i do it with the remote it doesn’t always show up. which is interesting, it seems a bit glitchy. that said, even when it does show up, it still seems to have no affect on the status of the item in openhab.

One thing I note, is that when I send via openhab the level changes. but via the remote the level remains the same when switching on or off. (TRACE)

via remote:

Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“OFF”,“level”:21,“color_temp”:370,“bulb_mode”:“white”}
Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“ON”,“level”:21,“color_temp”:370,“bulb_mode”:“white”}

via openhab:

Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“ON”,“level”:52,“color_temp”:370,“bulb_mode”:“white”}
Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“OFF”,“level”:0,“color_temp”:370,“bulb_mode”:“white”}

although playing with the remote and openhab dimmer, the levels seem to work properly. (although still nothing changes in openhab when I use the remote)

remote:

Recieved the following new Milight state:milight/states/0x88E/rgb_cct/3:{“state”:“ON”,“level”:34,“color_temp”:370,“bulb_mode”:“white”}
Recieved the following new Milight state:milight/states/0x88E/rgb_cct/4:{“state”:“ON”,“level”:79,“color_temp”:370,“bulb_mode”:“white”}

openhab:

Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“ON”,“level”:17,“color_temp”:370,“bulb_mode”:“white”}
Recieved the following new Milight state:milight/states/0x88E/rgb_cct/2:{“state”:“ON”,“level”:69,“color_temp”:370,“bulb_mode”:“white”}

really not sure if any of that matters, just trying to provide more info…

interesting, was just poking around a bit in openhab admin, noticed there are some things in my inbox, pointing to my milight remotes.

the seem to have the format: (for example)

mqtt:rgb_cct:my_Broker:0x88E1

might try removing my items and things and add them via OH admin, just to see what happens.

So I changed all my things and items to match the format:

mqtt:rgb_cct:myBroker:0x88E1 and it works for all m

although the documentation seems wrong? as I (originally) did my things/items exactly as the documentation.

As per the docs:

Bridge mqtt:broker:myBroker [ host="localhost", secure=false, password="*******", qos=1, username="user"]
Thing mqtt:rgb_cct:0xE6C4 "Hallway" (mqtt:broker:myBroker) @ "MQTT"
Dimmer Hallway_Level "Front Hall" {channel="mqtt:rgb_cct:0xE6C4:level"}

had to modify mine to:

Bridge mqtt:broker:myBroker [ host="localhost", secure=false, password="*******", qos=1, username="user"]
Thing mqtt:rgb_cct:myBroker:0xE6C4 "Hallway" (mqtt:broker:myBroker) @ "MQTT"

Dimmer Hallway_Level "Front Hall" {channel="mqtt:rgb_cct:myBroker:0xE6C4:level"}

everything seems to be working now…

Great thanks for faulting finding and reporting the issue, I agree this is a documentation issue and have made a PR here to fix it so thanks for taking the time to report this so the next person does not get caught.

[mqtt.espmilighthub] Fix wrong textual example formats in readme by Skinah · Pull Request #13742 · openhab/openhab-addons (github.com)

happy to be helpful in a small way+ thanks for your efforts+++