TTS to Raspbery / Windows (via MQTT and Python)


I wanted to come up with a cheap speaker solution without using a cloud based system. I couldn't find anything so I have written my own driver to use my Raspberry as a TTS speaker.

The hubitat driver creates the TTS mp3 and then puts the url on a MQTT topic. My raspberry is running a MQTT broker to receive the information from hubitat. The python script picks up the MQTT message and plays the mp3 on the speaker.

It will work on any linux / windows system with python installed, the MQTT broker does not need to be running on the same machine as the python script. Or you could have a few Raspberry Zeros as speakers with the MQTT running on a Raspberry4

This is the hubitat driver: (scroll down for the python script)

And this is the python script:


This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.