Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MQTT] OH3 Error: DynamicStateDescriptionProvider implementations must never return the original state description. class org.openhab.binding.mqtt.generic.MqttChannelStateDescriptionProvider has to be fixed. #8845

Closed
LukasA83 opened this issue Oct 23, 2020 · 10 comments · Fixed by openhab/openhab-core#1817
Assignees
Labels
bug An unexpected problem or unintended behavior of an add-on ohc bug A problem or unintended behavior of openHAB Core

Comments

@LukasA83
Copy link
Contributor

LukasA83 commented Oct 23, 2020

Hi,

I'm sneak peeking into OH3 build #1980. Most my issues went away over the last builds, greatjob.

In my log I see ~ every minute this error:
[ERROR] [ernal.ChannelStateDescriptionProvider] - Dynamic state description matches original state description. DynamicStateDescriptionProvider implementations must never return the original state description. class org.openhab.binding.mqtt.generic.MqttChannelStateDescriptionProvider has to be fixed.

Is there anything wrong with my configuration or something wrong with the addon?

@LukasA83 LukasA83 added the bug An unexpected problem or unintended behavior of an add-on label Oct 23, 2020
@lolodomo
Copy link
Contributor

There is something badly implemented in the MQTT generic bonding which was cleverly detected by the core framework. It has to be fixed.

@jochen314
Copy link
Contributor

Can you please tell us more about this?
What exactly is the contract of the DynamicStateDescriptionProvider and why is the current implementation so bad?
A quick seach in the add-ons revealed multiple versions of teh DynamicStateDescriptionProvider, which are implemeneted the same way.

The (new) check in the core is:

if (stateDescription.equals(originalStateDescription))

What is so problematic about providing the equivalent stateDescription?
The whole point is, that the stateDescription is not know before. So why is it bad, if it turns out to be the same as the static one?
The only thing I see we san to do avoid this, is to move this exact test inside the MqttChannelStateDescriptionProvider or to the code feeding the stateDescription to this component.

But I still do not get the problem with this.

@tomeng
Copy link

tomeng commented Nov 3, 2020

Hi all,

I can second this issue (3.0.0 #2004).

It does occur whenever I command something to a player item (no matter what UI I use; linked to string mqtt thing) and this subsequently leads to the command not being send out to the mqtt broker.

To help with debug I have added the following on command rule -

var Log = Java.type("org.openhab.core.model.script.actions.Log");
Log.logInfo("event","--- MQTT Debug Start ---");
Log.logInfo("event",event.itemName);
Log.logInfo("event",event.itemState);
Log.logInfo("event",event.oldItemState);
Log.logInfo("event",event.command);
Log.logInfo("event",items[event.itemName]);
Log.logInfo("event","--- MQTT Debug End ---");

And I'm getting this log output

**==> /var/log/openhab2/events.log <==**
2020-11-03 13:00:56.252 [INFO ] [smarthome.event.ItemCommandEvent    ] - Item 'Roon_AZHQ_Player' received command PLAY
2020-11-03 13:00:56.254 [INFO ] [rthome.event.ItemStatePredictedEvent] - Item 'Roon_AZHQ_Player' predicted to become PLAY
2020-11-03 13:00:56.256 [INFO ] [smarthome.event.RuleStatusInfoEvent ] - 9f01e27507 updated: RUNNING
2020-11-03 13:00:56.256 [INFO ] [marthome.event.ItemStateChangedEvent] - Item 'Roon_AZHQ_Player' changed from PAUSE to PLAY
2020-11-03 13:00:56.272 [INFO ] [smarthome.event.RuleStatusInfoEvent ] - 9f01e27507 updated: IDLE

**==> /var/log/openhab2/openhab.log <==**
2020-11-03 13:00:56.253 [ERROR] [rnal.ChannelStateDescriptionProvider] - Dynamic state description matches original state description. DynamicStateDescriptionProvider implementations must never return the original state description. class org.openhab.binding.mqtt.generic.MqttChannelStateDescriptionProvider has to be fixed.

2020-11-03 13:00:56.254 [ERROR] [rnal.ChannelStateDescriptionProvider] - Dynamic state description matches original state description. DynamicStateDescriptionProvider implementations must never return the original state description. class org.openhab.binding.mqtt.generic.MqttChannelStateDescriptionProvider has to be fixed.

2020-11-03 13:00:56.254 [ERROR] [rnal.ChannelStateDescriptionProvider] - Dynamic state description matches original state description. DynamicStateDescriptionProvider implementations must never return the original state description. class org.openhab.binding.mqtt.generic.MqttChannelStateDescriptionProvider has to be fixed.

2020-11-03 13:00:56.254 [ERROR] [rnal.ChannelStateDescriptionProvider] - Dynamic state description matches original state description. DynamicStateDescriptionProvider implementations must never return the original state description. class org.openhab.binding.mqtt.generic.MqttChannelStateDescriptionProvider has to be fixed.

2020-11-03 13:00:56.255 [ERROR] [rnal.ChannelStateDescriptionProvider] - Dynamic state description matches original state description. DynamicStateDescriptionProvider implementations must never return the original state description. class org.openhab.binding.mqtt.generic.MqttChannelStateDescriptionProvider has to be fixed.

2020-11-03 13:00:56.255 [ERROR] [rnal.ChannelStateDescriptionProvider] - Dynamic state description matches original state description. DynamicStateDescriptionProvider implementations must never return the original state description. class org.openhab.binding.mqtt.generic.MqttChannelStateDescriptionProvider has to be fixed.

2020-11-03 13:00:56.255 [ERROR] [rnal.ChannelStateDescriptionProvider] - Dynamic state description matches original state description. DynamicStateDescriptionProvider implementations must never return the original state description. class org.openhab.binding.mqtt.generic.MqttChannelStateDescriptionProvider has to be fixed.

2020-11-03 13:00:56.256 [ERROR] [rnal.ChannelStateDescriptionProvider] - Dynamic state description matches original state description. DynamicStateDescriptionProvider implementations must never return the original state description. class org.openhab.binding.mqtt.generic.MqttChannelStateDescriptionProvider has to be fixed.

2020-11-03 13:00:56.266 [INFO ] [org.openhab.core.model.script.event ] - --- MQTT Debug Start ---

2020-11-03 13:00:56.267 [INFO ] [org.openhab.core.model.script.event ] - Roon_AZHQ_Player

2020-11-03 13:00:56.268 [INFO ] [org.openhab.core.model.script.event ] - undefined

2020-11-03 13:00:56.269 [INFO ] [org.openhab.core.model.script.event ] - undefined

2020-11-03 13:00:56.270 [INFO ] [org.openhab.core.model.script.event ] - undefined

2020-11-03 13:00:56.271 [INFO ] [org.openhab.core.model.script.event ] - PLAY

2020-11-03 13:00:56.272 [INFO ] [org.openhab.core.model.script.event ] - --- MQTT Debug End ---

Happy to help and provide further input if someone tells me what's needed :-)

Thanks for all your work, it's really appreciated!

@lolodomo
Copy link
Contributor

lolodomo commented Nov 3, 2020

Can you please tell us more about this?

@cweitkamp : could you please explain why it is a bug to do that in a binding ?
I don't want to provide an approximative explanation.

@cweitkamp
Copy link
Contributor

See e.g. #3619.

The problem is that any dynamic state description state provider should return null when the requested channel is not handled by the binding. If it does not, it resets options for other bindings!

@morph166955
Copy link
Contributor

I just installed OH3 on a separate system to give it a test. I get this same error on both the Sonos and Sony Projector bindings.

2020-11-08 18:54:37.158 [ERROR] [rnal.ChannelStateDescriptionProvider] - Dynamic state description matches original state description. DynamicStateDescriptionProvider implementations must never return the original state description. class org.openhab.binding.sonos.internal.SonosStateDescriptionOptionProvider has to be fixed.
2020-11-08 18:54:37.169 [ERROR] [rnal.ChannelStateDescriptionProvider] - Dynamic state description matches original state description. DynamicStateDescriptionProvider implementations must never return the original state description. class org.openhab.binding.sonyprojector.internal.SonyProjectorStateDescriptionOptionProvider has to be fixed.

@lolodomo
Copy link
Contributor

lolodomo commented Nov 9, 2020

@cweitkamp : maybe a problem with the log in the core framework because I see no implementation problem in the sonos and SonyProjector bindings.

@morph166955
Copy link
Contributor

Something interesting to note on this. I have a bug open right now in relation to the Neeo binding #8984

When I uninstalled and then installed the neeo transport, it caused all of the errors above to flood into the log. I'm not sure if it's possible that Neeo is causing this, but the installation of the transport triggers it.

@J-N-K
Copy link
Member

J-N-K commented Nov 12, 2020

@morph166955 This is unrelated. The NEEO IO requests the channels descriptions, that's why the errors occur, but it has nothing to do with the CNFE in #8984

@cweitkamp
Copy link
Contributor

@lolodomo I rather tend to say this is an error in the BaseDynamicStateDescriptionProvider. It returns null if the pattern and the state options are null. I guess in the above mentioned case the state options list is empty too, which will lead to equal original state description and new state description returned by the provider. It additionally should return null if the state options list is empty.

@cweitkamp cweitkamp added the ohc bug A problem or unintended behavior of openHAB Core label Nov 13, 2020
@cweitkamp cweitkamp self-assigned this Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on ohc bug A problem or unintended behavior of openHAB Core
Projects
None yet
7 participants