#Turn off Linux PC

1 messages · Page 1 of 1 (latest)

misty sluice
#

I want to create a script that turns of my linux pc.

I tried searching the community but what I found involves a windows application that integrates to home assistant so that isn't an option on linux...

undone lion
#

How about running an ssh command with command_line integration?

misty sluice
#

so basicly i would have to setup passworless ssh by using a key

and then something like this in my configuration.yaml would work?

shell_command:
  bazzite_turn_off: ssh -i /config/ssh/id_rsa -o 'StrictHostKeyChecking=no' zany130@************ 'systemctl poweroff'

script:
 turn_off_bazzite:
   alias: turn off bazzite
   sequence:
     service: shell_command.bazzite_turn_off
undone lion
#

something like that. the script is a bit redundant if it only has one service call (could just call that instead of the script)

misty sluice
#

ihow would I do that? ideally I would it would be a toogable swtich in the dash.

though maybe having it as a script is also usefull for calling it in a scene? (im a little confused when you would use scripts)

pseudo aspen
undone lion
#

You can't call scripts in a scene.

misty sluice
#

ahh i already have wol switch . I just need to turn it off

misty sluice
misty sluice
#

hmm well need to figure out why system bridge doesnt want to work so in the mean time back to using ssh though if i can't automate it then not much point i guess...

misty sluice
undone lion
#

you need to make a switch entity like command_line switch or wol switch.

#

you can put that switch into a scene