Skinah / EspMilightHub

openHAB Binding for the esp8266milighthub
Eclipse Public License 2.0
0 stars 0 forks source link

Group 0 don't receives updates from MQTT #7

Closed Xento closed 4 years ago

Xento commented 4 years ago

I use alexa to control my milight bulbs. So I exposed the dimmer to alexa to be able to dim the lights.

The problem is, that when I turn the light on and dim them to 50% and turn them off. The next time I turn on the light via alexa they turn n to 50% but openhab says it's at 100%.

The same problem is when the bulbs are on at 50% and I say alexa it should turn on the bulbs. The bulbs do nothing as they are alreadyon but openhab sets the dimmer to 100%.

This is what gets logged when I "turn on" a bulb that is already turned on at 56%. The dimmer item in openhab says its on at 100%.

12:37:38.207 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - MQTT message just sent, there are now 0 more messages in the queue 12:37:38.208 [DEBUG] [ub.handler.EspMilightHubBridgeHandler] - Started timer because it was null. 12:37:38.474 [DEBUG] [ub.handler.EspMilightHubBridgeHandler] - * Recieved the following new Milight state:milight/states/0x5927/rgbw/0 : {"state":"ON","level":56,"hue":61,"bulb_mode":"color"} 12:37:38.488 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - Processing new incoming MQTT message to update Openhab's controls. 12:37:38.491 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - Message ={"state":"ON","level":56,"hue":61,"bulb_mode":"color"} 12:37:38.494 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - globeType =rgbw 12:37:38.497 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - remoteCode =0x5927 12:37:38.500 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - remoteGroupID =1 12:37:38.504 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - Chan Prefix =espmilighthub:rgbw:001:0x59271: 12:37:38.507 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - bulbState =ON 12:37:38.510 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - bulbLevel =56 12:37:38.513 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - Processing new incoming MQTT message to update Openhab's controls. 12:37:38.516 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - Message ={"state":"ON","level":56,"hue":61,"bulb_mode":"color"} 12:37:38.518 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - globeType =rgbw 12:37:38.521 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - remoteCode =0x5927 12:37:38.523 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - remoteGroupID =2 12:37:38.526 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - Chan Prefix =espmilighthub:rgbw:001:0x59272: 12:37:38.528 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - bulbState =ON 12:37:38.531 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - bulbLevel =56 12:37:38.534 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - Processing new incoming MQTT message to update Openhab's controls. 12:37:38.536 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - Message ={"state":"ON","level":56,"hue":61,"bulb_mode":"color"} 12:37:38.539 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - globeType =rgbw 12:37:38.541 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - remoteCode =0x5927 12:37:38.544 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - remoteGroupID =3 12:37:38.546 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - Chan Prefix =espmilighthub:rgbw:001:0x59273: 12:37:38.549 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - bulbState =ON 12:37:38.551 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - bulbLevel =56 12:37:38.554 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - Processing new incoming MQTT message to update Openhab's controls. 12:37:38.557 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - Message ={"state":"ON","level":56,"hue":61,"bulb_mode":"color"} 12:37:38.560 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - globeType =rgbw 12:37:38.563 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - remoteCode =0x5927 12:37:38.567 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - remoteGroupID =4 12:37:38.569 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - Chan Prefix =espmilighthub:rgbw:001:0x59274: 12:37:38.572 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - bulbState =ON 12:37:38.574 [TRACE] [ub.handler.EspMilightHubBridgeHandler] - bulbLevel =56

Skinah commented 4 years ago

I recommend u expose the colour channel not a dimmer as that can do more and is well tested.

Xento commented 4 years ago

It's the same problem with the color. When I set color to 50% and then turn color on, than it is at 100% on openhab but the bulbs are only 50% on. I think this is because the feedback isn't working. When I change a bulb over the webinterface of the hub, openhab don't updates the items.

Xento commented 4 years ago

I think it's the same problem as in this post: https://community.openhab.org/t/espmilighthub-new-binding-for-milight-limitlessled-and-easybulb/39720/344

Skinah commented 4 years ago

Does this post explain it? https://community.openhab.org/t/espmilighthub-new-binding-for-milight-limitlessled-and-easybulb/39720/288

Xento commented 4 years ago

No.

I just noticed where the bug is ...

I have defined this thing:

Bridge espmilighthub:esp8266Bridge:001 [ADDR="tcp://localhost:1883", MQTT_USERNAME="", MQTT_PASSWORD="", 1TRIGGERS_NIGHT_MODE=true, DELAY_BETWEEN_MQTT=40, POWERFAILS_TO_MINDIM=true, AUTOCTEMP_MAXDIMMED_TEMPERATURE=350, FAVOURITE_WHITE=200, HUB_IP="192.168.158.30"] {
Thing rgbw 0x59270 "Wohnzimmer" Thing rgbw 0x12870 "Büro" }

So I control group 0 (all bulbs from this remote).

Now the following MQTT Message is send back: [ub.handler.EspMilightHubBridgeHandler] - * Recieved the following new Milight state:milight/states/0x5927/rgbw/0 : {"state":"ON","level":56,"hue":61,"bulb_mode":"color"}

As you can see in my first post the channels 0x59271 to 4 receive the update but NOT channel 0x59270. So my item for all bulbs of this remote isn't updated.

Xento commented 4 years ago

It should be fixed with this pr https://github.com/Skinah/EspMilightHub/pull/8

Xento commented 4 years ago

Fixed with https://github.com/Skinah/EspMilightHub/pull/8