Onewire1 binding provides status updates even if value not changed

I’ve installed openhab 2.3 on docker and rebuilding my configuration.
Therefore i use knx2 and onewire1 bindings.

It seems that the post_only_changed_values is not working coz i get status updates on each onewireread even if the value has not changed.

onewire.cfg

# only changed values are posted to the event-bus, (optional, defaults to true - values true or false)
post_only_changed_values=true

Event-Log

06:13:01.355 [INFO ] [smarthome.event.ItemStateEvent       ] - Window_EG_Buero_Tilt updated to CLOSED                
06:13:02.347 [INFO ] [smarthome.event.ItemStateEvent       ] - Window_EG_Buero_Tilt updated to CLOSED                
06:13:03.355 [INFO ] [smarthome.event.ItemStateEvent       ] - Window_EG_Buero_Tilt updated to CLOSED                
06:13:04.347 [INFO ] [smarthome.event.ItemStateEvent       ] - Window_EG_Buero_Tilt updated to CLOSED                
06:13:05.356 [INFO ] [smarthome.event.ItemStateEvent       ] - Window_EG_Buero_Tilt updated to CLOSED                
06:13:06.349 [INFO ] [smarthome.event.ItemStateEvent       ] - Window_EG_Buero_Tilt updated to CLOSED                
06:13:07.357 [INFO ] [smarthome.event.ItemStateEvent       ] - Window_EG_Buero_Tilt updated to CLOSED                
06:13:08.350 [INFO ] [smarthome.event.ItemStateEvent       ] - Window_EG_Buero_Tilt updated to CLOSED

Item-Config

Contact Window_EG_Buero_Tilt            "Fenster Büro (gekippt)"                (Group_Window_Contact,Fenster_Tilted)	{ onewire="deviceId=uncached/s_buero;propertyName=sensed.B;refreshinterval=1;invert", channel="knx:device:bridge:onewire:egWindowBueroTilt" }

As u see i need to send those values to my knx bus which is currently flooded by the onewire event.

onewire DEBUG log

2018-09-19 08:25:15.181 [DEBUG] [nal.scheduler.OneWireUpdateScheduler] - Autorefresh: Adding 1 item(s) with refresh time 1 to reader queue.
2018-09-19 08:25:15.182 [DEBUG] [nal.scheduler.OneWireUpdateScheduler] - Update Task isAlive: true
2018-09-19 08:25:15.183 [DEBUG] [nal.scheduler.OneWireUpdateScheduler] - add item Window_EG_Essen_Sued_Open to updateQueue
2018-09-19 08:25:15.184 [DEBUG] [internal.scheduler.OneWireUpdateTask] - Autorefresh: got new item Window_EG_Essen_Sued_Open in update queue
2018-09-19 08:25:15.185 [DEBUG] [internal.scheduler.OneWireUpdateTask] - Autorefresh: Trying to update Item: Window_EG_Essen_Sued_Open
2018-09-19 08:25:15.186 [DEBUG] [ding.onewire.internal.OneWireBinding] - Item Window_EG_Essen_Sued_Open wants update!
2018-09-19 08:25:15.187 [DEBUG] [nternal.connection.OneWireConnection] - trying to read from 'uncached/s_essen/sensed.A', read attempt=1
2018-09-19 08:25:15.193 [DEBUG] [nternal.connection.OneWireConnection] - check if device exists 'uncached': 
2018-09-19 08:25:15.373 [DEBUG] [nternal.connection.OneWireConnection] - Read value '1' from uncached/s_essen/sensed.A, read attempt=1
2018-09-19 08:25:15.374 [DEBUG] [ctOneWireDevicePropertyBindingConfig] - type of uncached/s_essen/sensed.A before modifier:Invert OpenCloseType modifier for OnOffType type=OPEN
2018-09-19 08:25:15.375 [DEBUG] [ctOneWireDevicePropertyBindingConfig] - type of uncached/s_essen/sensed.A after modifier:Invert OpenCloseType modifier for OnOffType type=CLOSED
2018-09-19 08:25:15.378 [DEBUG] [internal.scheduler.OneWireUpdateTask] - Autorefresh: Waiting for new item in update queue

Any suggestions?

Either the ItemState unequals each time or ivPostOnlyChangedValues is false for whatever reason.
both is impossible regarding the code… can someone help plz?

OneWireBinding.java:

 private void postUpdate(Item pvItem, Type pvNewType) {
        synchronized (pvItem) {
            State lvNewState = (State) pvNewType;
            State lvCachedState = ivCacheItemStates.get(pvItem.getName());
            if (!ivPostOnlyChangedValues || !lvNewState.equals(lvCachedState)) {
                ivCacheItemStates.remove(pvItem.getName());
                ivCacheItemStates.put(pvItem.getName(), lvNewState);
                eventPublisher.postUpdate(pvItem.getName(), lvNewState);
            } else {
                logger.debug("didn't post update to eventPublisher, because state did not change for item {}",
                        pvItem.getName());
            }
        }
    }

i found a bug in

OneWireBinding.java:

@Override
    public void updated(Dictionary<String, ?> pvConfig) throws ConfigurationException {
        if (pvConfig != null) {
            // Basic config
            String lvPostOnlyChangedValues = Objects.toString(pvConfig.get("post_only_changed_values"), null);
            if (StringUtils.isNotBlank(lvPostOnlyChangedValues)) {
                ivPostOnlyChangedValues = Boolean.getBoolean(lvPostOnlyChangedValues);
            }

            // Connection config
            OneWireConnection.updated(pvConfig);
        }

        for (OneWireBindingProvider lvProvider : providers) {
            scheduleAllBindings(lvProvider);
        }

    }

Boolean.getBoolean() should be Boolean.valueOf() :wink: