Rule-based interpreter (rulehli): any way to return an answer to the Chat or the app?

My defaultHLI is rulehli. The mic in the Android app ends up setting my VoiceCommand item and my own rules take it from there. That works well, also for a language the built-in interpreter doesn’t support.

What’s missing is the answer back. The docs say the interpretation result “is always a null string with the rule-based Interpreter (rulehli)”, and that is exactly what I see: the Chat in Main UI shows my sentence with nothing underneath it, and the app shows “Recognized command:” followed by what I said. Since 5.2 the Chat does show replies, but only with an LLM-based interpreter as the default one.

It matters for commands whose result you cannot observe. “Add this track to playlist X” either worked or it didn’t, and nothing in the room tells you which.

Is there a way for the rule that handled the command to supply the text that is returned? A String item that is read back as the interpretation result, or an action the rule can call before it returns, would be enough.

If that doesn’t exist today, would it be a reasonable addition, and would it belong in core or in the UI?

This seems like a very reasonable addition, because without a reply channel the user cannot tell whether a rule actually succeeded, especially for actions with no visible effect. As a workaround today, I would have the rule update a dedicated String item or send a notification, and show that item in the interface, although that still does not put the answer back into the Chat itself. Your idea of a String item read back as the interpretation result, or an action the rule can call before it returns, would be a clean way to close that gap, and it would make sense to propose it as a core feature so every client can use it consistently.

I used Alexa for this two-way communication.

I wrote a custom skill that sent the voice request, as text, to an openHAB item. This item, in turn, triggered a rule. Within that rule, I used the Alexa binding and the “say” action to send the response back to Alexa.

Essentially, 99% of my Alexa interactions followed the pattern: “Computer, tell the house… .” And occasionally, “Computer, wake me up at…” :wink: In addition, the Alexa device has sent the location in order to narrow down the possible actions. Not perfect, but it worked for 9 years. In total I had 8 alexa devices at home.

In the future, I try to replace alexa completely with a custom voice assistant.

Create a feature request [voice] Allow the rule-based interpreter to return an answer · Issue #5951 · openhab/openhab-core · GitHub