Jcarlier
(Carlier Jacques)
October 12, 2024, 8:50am
1
Good morning,
Currently when my smart samsung TV turns off, at a certain time in the evening (before going to sleep ), I have an automation that turns off all my lights and other things.
I would also like to turn off my mini PC (âproperlyâ) connected to my TV in this automation.
How can I do it?
THANK YOU
Jcarlier
(Carlier Jacques)
October 12, 2024, 2:20pm
3
windows 11
actually I could use a SwitchBot Smart Switch on the power button but I think itâs not recommendedâŠ???
Mikefila
(Mike Fila)
October 12, 2024, 7:29pm
4
I use this for win 10, it should work for win 11.
master
Remote Shutdown Manager is a windows application, which gives an ability to shutdown, suspend, hibernate PC or turn screen off using HTTP GET request. - karpach/remote-shutdown-pc
tom_l
October 13, 2024, 1:11am
5
I made a switch for my PC so I can turn it on or off (sleep):
switch:
- platform: wake_on_lan
mac: "<redacted>"
host: 10.1.1.2
name: PC
turn_off:
service: shell_command.turn_off_pc
shell_command:
turn_off_pc: 'curl -k http://10.1.1.2:8000/?action=System.Sleep'
To use that command you need to install this on your PC:
https://www.airytec.com/en/switch-off/
and if you want a full shutdown rather than sleep then change the shell command to use ?action=System.Shutdown
instead of ?action=System.Sleep'
Not sure if WoL works if the PC is shutdown though so there may be no point going to all the trouble of making the switch. Just use the shell command.
Jcarlier
(Carlier Jacques)
October 14, 2024, 8:42am
6
Does this shell command stop Windows properly and then power off the PC?
thanks
Jcarlier
(Carlier Jacques)
October 14, 2024, 8:48am
8
last version : 3.5.1 (26 janv. 2015) ??
os
Windows 2000
Windows XP
Windows 2003
Windows Vista
Windows 2008
Windows 2008 R2
Windows 7
Windows 8
Windows 8.1
Windows 2012
Windows 2012 R2
??
ok for win 11
thanks
tom_l
October 14, 2024, 8:49am
9
Iâd assume so. It works on W10.
Jcarlier
(Carlier Jacques)
October 14, 2024, 8:56am
10
ok i will try âŠ
What do you think about the solution https://github.com/hass-agent/HASS.Agent ?
thanks
Jcarlier
(Carlier Jacques)
October 14, 2024, 9:19am
11
I just tested âswitch offâ and it works perfectly.
but how to launch this task from ha ??
I donât see in the shell_command the call of the task âswitch offâ ??
thanks
tom_l
October 14, 2024, 9:24am
12
Huh. I already have that installed to monitor memory and CPU. Just tried the sleep button. It works. No need for Airytec SwitchOff. I can uninstall it.
tom_l
October 14, 2024, 9:25am
13
Dashboard button action or automation.
tom_l
October 14, 2024, 9:26am
14
It just the action, like I showed above:
Or in the new syntax:
action: shell_command.turn_off_pc
Jcarlier
(Carlier Jacques)
October 23, 2024, 1:36pm
15
i made your solution but âŠ
time out âŠ
action: shell_command.turn_off_pc
data: {}
Commande en cours dâexĂ©cution expired : curl -k http://192.168.0.243:8000/?action=System.Shutdown
, after : 60 secondes
configuration
shell_command:
turn_off_pc: âcurl -k http://192.168.0.243:8000/?action=System.Shutdown â
in task bar:
thanks for your support