INSTRUCCIONS FOR RASPBERRY
you need samba-common package
Code: Select all
sudo apt-get install samba-common
Code: Select all
nano /home/pi/domoticz/scripts/shutdown_PC.sh
Code: Select all
#!/bin/sh
#Shutdown Computer
# IP of computer and admin user needed
net rpc -S 192.168.1.xx -U USER%PWD shutdown -t 1 -f
+x script (execution permission)
Code: Select all
chmod +x /home/pi/domoticz/scripts/shutdown_PC.sh
synology
Code: Select all
nano /volume1/@appstore/domoticz/scripts/shutdown_PC.sh
Code: Select all
#!/bin/sh
#Shutdown Computer
# IP of computer and admin user needed
net rpc -S 192.168.1.xx -U USER%PWD shutdown -t 1 -f
+x script (execution permission)
Code: Select all
chmod +x /volume1/@appstore/domoticz/scripts/shutdown_PC.sh
To no disable windows UAC you can insert reg info to accept RPC commands
In windows create reg file. enablerpcshutdown.reg
Code: Select all
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system]
"LocalAccountTokenFilterPolicy"=dword:00000001
Enable remote registry service
- Execute CMD witch admin rights (search cmd in start button, right button in cmd.exe execute with admin rights)
Code: Select all
sc config RemoteRegistry start= auto
sc start RemoteRegistry
In Domoticz create virtual switch
Switch type: push off button
Assign to off action:
(RASPBERRY)
"script://home/pi/domoticz/scripts/shutdown_PC.sh"
(SYNOLOGY)
"script://volume1/@appstore/domoticz/scripts/shutdown_PC.sh"
Save