Read the statement by Michael Teeuw here.
Voice Assistant
-
@jairojosy
Use already existing module like MMM-GoogleAssistant.
Your python app is not compatible with MM. At least you need to hook the output response then transmit to MM, and also you need to build a receiver module to get and display conversation. I will not say it is impossible, but not so quite simple. Why are you reinventing wheel again? -
@mmrize I would like to use self-made assistant
-
@jairojosy
Ok.
I assume you are using Google Assistant Service SDK with Python library.
You may get the response from Assistant Server asAssistResponse
. You can find some member data of that response likeaudio_out
orscreen_out
, orDialogStateOut.supplemental_display_text
or whatever you need.Once you extract the data you need, the next thing you need to do is emit that data into MM. A usual way might be REST-like requesting/responsing. You need to build MM module which can handle HTTP request/response, like
GET http://localhost:8080/MMM-MyGoogleAssistant/message?...
I think you can make your python app to request your data through that REST-like URL.Another way might be using MQTT, or websocket messaging. Or if you have some experience, you can execute your python app inside your node module then get the
stdout
as an input stream.I recommend implementing with native MM module by nodeJS instead of external Python thing. but decision is yours.
-
@jairojosy
This would be unnecessary worrying, but I have to point these things;- Implementing Google Assistant in a device doesn’t mean you can handle that device with voice commands. The two things are less related.
- For native commanding MM with voice, you need to host
Custom Device Actions
by yourself. (Or you can depend on IFTTT, but somewhat limited features) - To get the benefit of native flawless conversation, you might need
dyanmic or local fulfillment
, but in that case Certificated server is needed.
However, whole the experience will probably be interesting and funny. Good luck to you.
-
@jairojosy as @MMRIZE mentions, mm is JavaScript, so your only real choice is to execute your assistant outside mm, and collect it’s output, and pass that to a mm module that understands what the output message means.
not that hard really. PythonPrint shows a simple stdout approach.
getting the mic to work for input has always been the hardest. none of the good voice reco engines are free anymore, but not expensive. google charged me 51 cents for last months reco usage.