Reason to use this script:
This is a notification script that uses the gTTS module to speak Domoticz notifications to a Samsung Multiroom Speaker Group.
As we play a lot of music in the house as well use the Chromecast and Google Home/mini devices for other things I created this script to avoid disruption of Chromecast devices.
Hardeware and software requirements:
- Samsung wireless speakers - I'm using two R1 speakers
- Domoticz sever running on a local network
- Python and a couple of python modules installed
Key features:
- Script creates a multiroom group on the fly and ungroups speakers after message is played
- Waits for the notification.mp3 file to be created and then calcultes play time length and waits for the file to be played before ungrouping speakers
- Cleans up files after notification is played by deleting the notification.mp3 file
How to use:
- Place the Samsung_notify.pyw script in the scripts/python directory in Domoticz.
- Add a notification to a device in Domoticz
- In Domoticz settings -> notifications change the URL/Action field under the Custom HTTP/Actions settings to the following: script://scripts\python\Samsung_notify.pyw #MESSAGE (this path works on Windows 10 - paths for other operating systems may be different)
The script is well documented in the script's comments so take a look at the comments if you are not sure about settings or what the script is doing.
Enjoy