Error during trainer initialization

@ysc Any idea what would cause this error?

I tried a restart of the habot bundle, which didn’t resolve the problem. I haven’t done a restart of OH yet.

Here’s a screen snip from the browser console.

BTW, not sure if relevant, but the response to rest/items?metadata=semantics is about 625K. :open_mouth:

Hmm, hard to say, do you have an exception stack trace in the server logs? Sometimes the cause appears there but here the UI doesn’t seem to have picked it up :confused:

Or maybe on the Network tab in the dev tools, click the failed “send” request in red and check the response.

There were no exceptions in the log. I had the binding in debug mode. All I saw in the log when the problem occurred was this, which looks completely benign.

2018-11-06 12:25:44.005 [DEBUG] [.dashboard.internal.HABotHttpContext] - Requesting resource web/dist/pwa-mat/statics/avatar.png

Not much, but a little more info.

error: {message: "Error during trainer initialization: null", http-code: 500,…}
exception: {class: "org.eclipse.smarthome.core.voice.text.InterpretationException",…}
cause: "java.lang.ArrayIndexOutOfBoundsException"
class: "org.eclipse.smarthome.core.voice.text.InterpretationException"
localized-message: "Error during trainer initialization: null"
message: "Error during trainer initialization: null"
http-code: 500
message: "Error during trainer initialization: null"

Very weird.
Without the complete stack trace I can only guess - I’m supposing it’s when it tries to get all item attributes from tags and synonyms. Maybe you have an empty synonyms list somewhere?

Did it work before and you changed your items and now it doesn’t work anymore? If so can you perhaps go back to an earlier revision when it was working?

I’l check for that.

Yes. I’m looking at the most recent changes.

I’ll walk back my changes and see if I can track down the cause.

1 Like

It was this line.

Group gCeilingFan "Ceiling Fans" ["Equipment"] { synonyms="Ceiling Fan" }

If I remove the ["Equipment"] { synonyms="Ceiling Fan" } from the line, the error no longer occurs.

If I add it back, I get the error.

That group is used on the following items.

Switch Porch_FanPower                   "Fan Power"             <fan>               (gO_Porch,gCeilingFan)              { channel="bigassfan:fan:20F85EF18A40:fan-power" }
Dimmer Porch_FanSpeed                   "Fan Speed"             <fan>               (gO_Porch,gCeilingFan)              { channel="bigassfan:fan:20F85EF18A40:fan-speed" }
Switch Porch_FanLightPower              "Fan Light Power"       <dimmablelight>     (gO_Porch,gCeilingFan,gLight)       { channel="bigassfan:fan:20F85EF18A40:light-power" }
Dimmer Porch_FanLightLevel              "Fan Light Brightness"  <dimmablelight>     (gO_Porch,gCeilingFan,gLight)       { channel="bigassfan:fan:20F85EF18A40:light-level" }

I’ll do some additional analysis by adjusting the groups in those item definitions.

Oh, OK I see.
Then I suppose it’s because those main classes don’t have any synonym defined. It makes sense to want to use them as tags though.
I’d suggest finding a more specialized tag for the group (for instance HVAC) and it should work. Maybe “ventilation”/“fan”/“fans” should be added as synonyms to the HVAC tag - they are in French/German/Dutch but not in English :persevere:.

So, does that mean that other tags that don’t have synonyms, like Indoor and Outdoor, will have problems?

I’ll try that now.

Nevermind. I see Equipment is a Type, not a Tag.

Changing Equipment to HVAC resolved the problem.

Indeed. Still they lead to a bug when used as tags, which is bad… Thanks for your time debugging this issue!