Zigbee OSRAM Flex RGBW state not in sync

Since switching from a hue bridge to an ember zigbee stick (Bitron video) I’m having problems keeping the internal OpenHAB state of my OSRAM Flex RGBW LED strip in sync with the actual device.

When using “sendCommand” in a rule the light does change, but the internal state of OpenHAB does not. Even “postUpdate” does not change the state. This does just occur when using rules (I’m using JSR223 Python, if this should make a difference). When switching via sitemap by hand both the actual light as well as the internal state change.

I also have a DateTime item with profile=“timestamp-update” and it only changes every couple of hours. I have two “OSRAM Plug 01” and those work flawlessly and the timestamp-update items update immediately after changing their state.

The problem existed since I switched over from the Hue bridge with OpenHAB 2.5.0. I just updated to 2.5.2 and nothing has changed.

Another strange thing is that often the dynamic item of the sitemap and the switch next to it show different states. E.g. the item shows that the light is on, but the switch is off. I can then click the switch and the state of the switch changes. When I click it again the switch as well as the dynamic item turn off.

Even if the Zigbee device should not report back with its status shouldn’t it be possible to use “postUpdate” to change the internal OpenHAB state? Can I do something else to keep the actual device and the OpenHAB state in sync? I only change the light via OpenHAB, so I don’t have to worry about external changes to the light.

I also noticed that the state of the device in the Karaf console is listed as “UNKNOWN” when using “zigbee nodes”.

I also miss from that the dimmer and the switch for the light are in sync (I turn the switch off, but the dimmer value is still > 0 and vice versa). But maybe that is just a sideeffect of OpenHAB not knowing the correct state.

It would likely help to get a debug log so I can see what is going on. Please get the log from the binding startup.

In general, bulbs should report their state, but this maybe isn’t configured for some reason.

I don’t understand what these items show - normally there is only 1 item for a switch and it shows the current state - not one for the sitemap and one to show the real state.

OK, maybe this was my fault. When replying I discovered that I had mixed up the names for the dimmer and color control items. I will report back if this fixes the problem.

OK. It’s definitely better now, but the different items are not in sync with each other when using different items to control the same channel.

These are the item definitions for the switch, the dimmer and the last-updated-time:

Switch          WZ_LEDStrip_Switch              "WZ LED Strip Switch"                                                   <switch>        (Wohnzimmer,Eventbus)           {channel="zigbee:device:0137F4FF:8418260000dab9bc:8418260000DAB9BC_3_color"}
DateTime        WZ_LEDStrip_LastUpdate          "WZ LED Strip Letztes Update [%1$td.%1$tm.%1$tY %1$tH:%1$tM:%1$tS]"     <clock> (Wohnzimmer,Eventbus)           {channel="zigbee:device:0137F4FF:8418260000dab9bc:8418260000DAB9BC_3_color" [profile="timestamp-update"]}
Dimmer          WZ_LEDStrip_Dimmer              "WZ LED Strip Dimmer"                                                    <slider>        (Wohnzimmer,Eventbus)           {channel="zigbee:device:0137F4FF:8418260000dab9bc:8418260000DAB9BC_3_color"}

When I use the switch to turn off the light the dimmer value stays the same and does not change to 0. I was used to this from the Hue binding although the Hue binding was exporting two channels for the dimmer and the switch controls.

I have created a rule now that does this (kind of) manually. Only “kind of” because it does not know the correct value for the dimmer when turning the light on via the switch. The light itself turns on to the last set brightness, but the dimmer status does not reflect this.

@rule("WZ LEDStrip update", description="LEDStrip Status synchronisieren.", tags=['Wohnzimmer'])
@when("Item WZ_LEDStrip_Switch received command")
@when("Item WZ_LEDStrip_Dimmer received command")
def ledstrip_switch_update(event):
    me = ledstrip_switch_update

    if event.itemName == 'WZ_LEDStrip_Switch':
        if event.itemCommand == ON:
            me.log.info("Strip == ON")
            events.postUpdate("WZ_LEDStrip_Dimmer", "30") # "Guess" 30% as the last value
            events.postUpdate("WZ_LEDStrip_Dimmer", "0")
    elif event.itemName == 'WZ_LEDStrip_Dimmer':
        if event.itemCommand.intValue() > 0:
            events.postUpdate("WZ_LEDStrip_Switch", "ON")
            events.postUpdate("WZ_LEDStrip_Switch", "OFF")

Is there a way that this could happen automatically like in the Hue binding? Or is there a way to get the current brightness of the light without relying on the state of the Dimmer item.

BTW, the same problem also exists when using a Color item with the same channel. It also does not sync with the Switch and the Dimmer item.

I just noticed another probably related issue:
The OSRAM LED strip does not report back often, but when it does all states are set to UNDEF.

These are the last times the WZ_LEDStrip_LastUpdate item was updated:
2020-02-24 23:19:21
2020-02-25 01:30:51
2020-02-25 14:39:54
2020-02-25 16:51:24
2020-02-25 19:02:55
2020-02-25 21:14:26

Every time WZ_LEDStrip_Switch, WZ_LEDStrip_Dimmer (and also the color item) where set to UNDEF.

I have attached the openhab.log around the last time this has happened.
openhab.log (55.3 KB)

I have the following Zigbee devices in my network:

openhab> zigbee nodes                                                                                                                    
Network  Addr  IEEE Address      Logical Type  State      EP   Profile                    Device Type                Manufacturer     Model          
      0  0000  000D6F000D3AF569  COORDINATOR   UNKNOWN  
  19416  4BD8  00158D00053D2C46  END_DEVICE    UNKNOWN     1  ZIGBEE_HOME_AUTOMATION     THERMOSTAT                 Eurotronic       SPZB0001       
  33462  82B6  7CB03EAA0A08699F  ROUTER        UNKNOWN     3  ZIGBEE_LIGHT_LINK          DATA_COLLECTION_UNIT       OSRAM            Plug 01        
  41705  A2E9  7CB03EAA0A086EAF  ROUTER        UNKNOWN     3  ZIGBEE_LIGHT_LINK          DATA_COLLECTION_UNIT       OSRAM            Plug 01        
  63512  F818  8418260000DAB9BC  ROUTER        UNKNOWN     3  ZIGBEE_LIGHT_LINK          0210                       OSRAM            Flex RGBW

Is there anything I can do to get plausible states for the LED light?

I’m having similar status issues (but slightly different). I have a ZemiSmart KS-811 which has 3 switch buttons controlling different devices. The physical buttons on the switch appear to not made a difference to the OpenHAB item each is attached to in regards to status updates. Physically pushing the switch will turn the fixture attached to it on, but the status of the item simply stays off. I’ve kept the item on to see if it ever eventually syncs up, but it never does. However, if I use either a sitemap or the paperUI to change the state of any of the onboard switches, the physical device attached turns on and the status of the item updates. The physical switch finally snaps back to sync with OpenHAB, but I may have to toggle the on/off switch item for that to happen.

I also have “UNKNOWN” state items, however those are limited to END_DEVICEs. The ROUTERS all appear “ONLINE”. I’ll try removing and re-adding them to see if that makes a difference.

I’d be happy to provide logs, but I since I have 12 devices on my Zigbee network, the logs can be quite chatty.

EDIT: I was able to resolve my “UNKNOWN” items by removing and re-adding them.