Hi,
Following this post: https://www.domoticz.com/forum/viewtopic.php?t=22619
I’m able to use the Xiaomi Gateway as an audio sink for text to speech. You’ll need ffmpeg and miio (https://github.com/aholstenson/miio):
First, you need to download the speech (abusing Google Translate, sorry), convert it to AAC and place it on a web server where the gateway has access (openHAB’s). “Just testing” is the text to say, and en-GB is the locale:
I have never used this one myself but it is supposed to sync any token it learns automatically with the miio command store so it does the same thing as I said but in my case the user provides the token rather than its being discovered.
Not all tokens are discoverable through handshaking with the device.
Hi,
I’ve realized that you cand send raw commands to the Xiaomi Gateway using the Xiaomi Mi IO binding, so you don’t need to install miio or node.js to use it for TTS.
After you install the binding, add the gateway thing:
You can add it from Paper UI or from the things file. To add it from the things file you will need the deviceId and the token. To find them (I don’t know if there is a simpler way), you’ll need to add it from Paper UI (you could leave it like this but I prefer configuration in files):
In the Inbox you will find the gateway as a “Xiaomi Mi Device with token”. Add it, go to Configuration/Things and click the pencil to edit it. Click again on the pencil and on “Show more”. There you have the device id and the token
Once you have the device id and the token you can delete the thing from Paper UI and create it in a .things (if you want):
Thing miio:unsupported:gateway "Xiaomi Mi Smart Home Gateway Mi IO" [ host="YOUR_GATEWAY_IP_ADDRESS", token="YOUR_GATEWAY_TOKEN", deviceId="YOUR_GATEWAY_ID" ]
Then, create a item to send commands to the gateway:
sorry for reviving this old thread. A few weeks ago I started using my Xiaomi Gateway V3 as an audio interface in a very similar way. All worked fine until a few days ago when it suddenly stopped working. Whenever I try to execute:
Hi,
Sorry, but I have no idea what the -9 means. Also, do you get “___” as the id or have you removed the number?
Have you checked that the mp3 file from Google Translate is correctly generated? Some months ago it stopped working for me and I had to switch to Google Text-to-Speech.
Regards.
Hi,
thanks for the quick response!
I don’t get “___” I just removed the id because I thought it was not necessary as it seems to be just counting up?
I generated the aac files some weeks ago and reused them every time because it basically just has 5 sentences to say. So they were working just fine all the time and I am able to download and play them on my computer.
I would assume that the gateway is out of storage space. Mi Home sucks on iOS for this particular use, as iOS does not allow you to upload custom sounds, though you can upload voice recordings.
Mi Home → Tap on Gateway → 3 Dots Menu → Doorbell → Scroll to Bottom and Select Ring Doorbell → Doorbell → + Button
It will error if you have too much on there when trying to click the plus button.
You will not be able to use this method if you do not have a child device connected to the gateway, in that case, use an old android version.
Mi Home keeps drastically changing so the above instructions may not apply in the future.
In my case I have made pre-recorded messages via Googles TTS online demo and some notification tones in mp3 that are uploaded with an older version of the Mi Home app via Bluestacks on PC (Android). Quirky but works for my needs. Doesn’t help if you have dynamic sentences. But if it says the same 5 things, just upload 5 versions of the sentence (that’s effectively what I did).