pkrabben wrote:HansieNL wrote:Nothing special. I made only the background metal a lot darker and created some custom icons.
picture-017.jpg
tv.png
sleep.png
Nice Dashboard
I assume you do the desktop and notebook detection based on IP address / ping.
Can you share that code with me because I'm not able to get this working in my Domoticz.
Notebook PC and Desktop PC are dummy switches.
script_time_desktop_pc.lua
Code: Select all
commandArray = {}
ping_success=os.execute('ping -c1 192.168.2.123')
if ping_success then
commandArray['Desktop PC']='On'
print("Desktop PC is online")
else
commandArray['UpdateDevice']='222|0|0'
print("Desktop PC is offline")
end
return commandArray
shutdown_desktop_pc.sh
Code: Select all
#!/bin/sh
# Shutdown Desktop PC
net rpc shutdown -I 192.168.2.123 -U username%password
Desktop PC Off Action:
script:///home/pi/domoticz/scripts/shutdown_desktop_pc.sh
How to Remotely Shut Down Windows PC
Disable the UAC remote restrictions in the registry:
– In the registry editor, navigate to
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
– If needed, create the DWORD value LocalAccountTokenFilterPolicy
– Modify the value of LocalAccountTokenFilterPolicy by changing the Value data to 1
Configure a User Account to Log On Automatically on Windows 7:
– Start netplwiz
– In the User Accounts dialog box, click the account you want to automatically log on to.
– If it is available, clear the Users Must Enter A User Name And Password To Use This
Computer check box.
– In the Automatically Log On dialog box, enter the user’s password twice and click OK.
Once you’ve set up the computer, you can shut it down from a Linux system. This requires the
samba-common and samba-common-bin packages installed – you can install these with the
following command:
sudo apt-get install samba-common samba-common-bin
To shut down use the following command from a terminal:
net rpc shutdown -I ip.address -U username%password