Using REST-API: logfile entry only on item change

I’m updating some items via REST-API and the logfile is now spammed with entries like:

2020-05-25 12:40:19.777 [ome.event.ItemCommandEvent] - Item 'WeatherBinder_softwaretype' received command EasyWeatherV1.4.9
2020-05-25 12:40:19.785 [ome.event.ItemCommandEvent] - Item 'WeatherBinder_action' received command updateraw
2020-05-25 12:40:19.793 [ome.event.ItemCommandEvent] - Item 'WeatherBinder_realtime' received command 1
2020-05-25 12:40:19.800 [ome.event.ItemCommandEvent] - Item 'WeatherBinder_rtfreq' received command 5
2020-05-25 12:40:19.717 [vent.ItemStateChangedEvent] - WeatherBinder_absbaro changed from 976.58 hPa to 976.48 hPa
2020-05-25 12:40:19.718 [ome.event.ItemCommandEvent] - Item 'WeatherBinder_rain' received command 0
2020-05-25 12:40:19.732 [ome.event.ItemCommandEvent] - Item 'WeatherBinder_dailyrain' received command 0
2020-05-25 12:40:19.735 [GroupItemStateChangedEvent] - gWeatherPressure changed from 1004.93 to 1004.88 through WeatherBinder_baro
2020-05-25 12:40:19.737 [ome.event.ItemCommandEvent] - Item 'WeatherBinder_weeklyrain' received command 0.03

Can I do something to avoid the “received command” entries, which send the same value as the item already has? Updating via (legacy v1) mqqt-eventbus only sends the “item changed from to”-entries…

You could stop sending commands? Commands are different to state updates. Commands like UP can be sent to a roller - which will never have state UP, only a numeric percentage. Commands can be acted upon by bindings etc. and result in activity, regardless of Item state. Perhaps that is something that you need to happen, if you want some device to follow your “update”.

If you want just to update the Item, then just post a state update.

Because, like most bindings, “incoming data” is dealt with as a state update.

1 Like

ok. Thanks. the Docs (https://www.openhab.org/docs/configuration/restdocs.html#openhab-rest-api) weren’t that specific, so I used the “POST”-example at first.
After switching to “PUT” and adding “/state” it now works. The items get updated, and there’s only the “change” information in the logs as intended.

1 Like