Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Idea: Add power/restart button on Roon Bridge screen.
#5
Hello,
I tried to stop the receivers when stopping the sender with the following script:

import requests

url1 = 'http://moodeclient1.local/command/system.php?cmd=poweroff'
url2 = 'http://moodeclient2.local/command/system.php?cmd=poweroff'

try:
# Stop reciever moodeclient1
requests.post(url1)
print("Shutdown moodeclient1")
except:
# On error
print("moodeclient1 is offline.")

try:
# Stop reciever moodeclient2
requests.post(url1)
print("Shutdown moodeclient2")
except:
# On error
print("moodeclient2 is offline.")

And with service reciever_shutdown.service:

[Unit]
Description=Run scrip at shutdown
DefaultDependencies=no
Before=shutdown.target

[Service]
Type=oneshot
ExecStart=/usr/bin/python3 /opt/reciever_shutdown/reciever_shutdown.py
RemainAfterExit=true

[Install]
WantedBy=shutdown.target

But it does not work, I do not find how to configure the service so that it executes the script reciever_shutdown.py during a shuddown of the sender and before the network is stopped by the shutdown.
Maybe you should look with this method ...
Reply


Messages In This Thread
RE: Add power/restart button on Roon Bridge screen. - by AllezOM06 - 05-19-2025, 04:37 PM

Forum Jump: