Hi!
I’m trying to set up a doorbell notification sound on all my arylic devices using python and the API command GET /httpapi.asp?command=playPromptUrl:
Unfortunately, I can’t get it to work properly in multi-room groups. The notification sound plays on the host device but the slave devices stay silent. I tried addressing the host device to play the sound within the whole group as well as addressing the slave devices individually.
If I then remove all slave devices from the group, it’s still the same. The sound plays on the device that was the host device but the previous slave devices stay silent. I can get a prior slave device to play the notification sound by playing a song or sound and then requesting the notification.
I attached an overview of the commands I used.
How do I play the notification sound on all devices within a multi-room group?
This is a most important feature. I have the automation but must tear down master and slaves in order to play notifications. I use Hubitat and would love this feature to work on all speakers.
I have several devices around my house that I would love to play a doorbell sound like this. I just tested on my network and I still get the same result with the slave devices not joining in the group sound, nor do they play their own sound. Hope we can get an update to allow for this.
I did some playing and got a script working to ungroup and regroup any slaves. I noticed that the prompt play sound doesn’t play even if you manually ungroup the slave in the 4stream app. Changing the play source does a sort of reset on that slave unit and lets it play the prompt again. So in the script I hit any slave unit with a switchmode back to wifi and it does the same reset. I had to add a sleep before grouping the slaves back because too short and it would cut off the doorbell sound.
import requests
import time
import json
# List the IP addresses
device_ips = ["192.168.0.113", "192.168.0.112"] # Add more IPs as needed
device_list = []
for ip in device_ips:
device_list.append({"name": ip, "slaves": []})
# check for being a slave device and get slave lists
for device in device_list:
url = f"http://{device['name']}/httpapi.asp?command=multiroom:getSlaveList"
response = requests.get(url)
print(f"Status of {device['name']}: {response.text}")
try:
json_response = json.loads(response.text)
if json_response.get('slave_list'):
device['slaves'] = json_response['slave_list']
print(f"Found {len(device['slaves'])} slaves for {device['name']}")
ungroup_response = requests.get(f"http://{device['name']}/httpapi.asp?command=multiroom:Ungroup")
print(f"Ungroup response for {device['name']}: {ungroup_response.text}")
except json.JSONDecodeError as e:
print(f"Failed to parse JSON response from {device['name']}: {e}")
print(f"Response was: {response.text}")
except KeyError as e:
print(f"Missing expected key in response from {device['name']}: {e}")
# Reset each slave device with switchmode:wifi before playing prompt
print("Resetting slave devices...")
for device in device_list:
for slave in device['slaves']:
slave_ip = slave['ip']
reset_url = f"http://{slave_ip}/httpapi.asp?command=setPlayerCmd:switchmode:wifi"
reset_response = requests.get(reset_url)
print(f"Reset slave {slave['name']} ({slave_ip}): {reset_response.text}")
# send doorbell sound to all devices
print("Sending doorbell sound to all devices...")
for device in device_list:
url = f"http://{device['name']}/httpapi.asp?command=playPromptUrl:http://192.168.0.21/doorbell-1.mp3"
response = requests.get(url)
print(f"Sent to {device['name']}: {response.text}")
time.sleep(4)
# Reconnect slaves back to their masters
print("Reconnecting slaves to masters...")
for device in device_list:
master_ip = device['name']
for slave in device['slaves']:
slave_ip = slave['ip']
reconnect_url = f"http://{slave_ip}/httpapi.asp?command=ConnectMasterAp:JoinGroupMaster:eth{master_ip}:wifi0.0.0.0"
reconnect_response = requests.get(reconnect_url)
print(f"Reconnected slave {slave['name']} ({slave_ip}) to master {master_ip}: {reconnect_response.text}")
print("Doorbell sequence completed!")