RPC-Shutdown - noobquestion

Hello, first post here ever.
Set up my HA 2 days ago and now I want to start and shutdown my pc via HA.
Starting works fine.
For the shutdown, I wanna use the RPC Shutdown Addon.

Installed it. My config logs like this:

computers:

- address: [192.168.0.137](https://192.168.0.137/)

alias: Kobito-PC

credentials: 3434%xxxxx

delay: 0

message: >-

Home Assistant is shutting down this PC. This cannot be canceled. Please

save your work!

The RPC Shutdown tries to shut down my pc at 192.168.0.137. Logs say:

[13:42:15] INFO: Read alias: Kobito-PC
[13:42:16] INFO: Shutdown Kobito-PC -> 192.168.0.137
Could not connect to server 192.168.0.137
Connection failed: NT_STATUS_IO_TIMEOUT
Could not connect to server 192.168.0.137
Connection failed: NT_STATUS_IO_TIMEOUT
[13:42:26] ERROR: Shutdown fails ->

What I already did:

  1. doublecheck the ip adress in router
  2. run → services.msc → Remote Registry → Start
  3. Allow an App through windowsfirewall → Windows Managment Instrumentation (WMI) → private check
  4. windowsregistry → Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
    → add “LocalAccountTokenFilterPolicy”=dword:00000001

ty in advance: Kobito

Your config looks funny.
Not sure if it the website or something at your end that makes it look like that, but try to insert it again then mark it and click the </> to make sure it stays correct.

computers:
  - address: 192.168.0.137
    alias: Kobito-PC
    credentials: 3434%xxxx
    delay: 0
    message: >-
      Home Assistant is shutting down this PC. This cannot be canceled. Please
      save your work!

sorry for the messed up code

any ideas what i can do ?

Looks like you have opened the wrong service in the firewall.
Remote Service Management (NP-In) is the one you need.

You might also need the Samba addon, if RPC Shutdown does not include the protocols to connect.

Also read this page to get a way to check if it works from just a command line on Linux/Home assistent.

2 Likes

ty for the tips, will try them now.

ps. you didnt link anything. which page do you mean ?

corrected :slight_smile:

soo if i disable the firewall, I get

The username or password was not correct.
Connection failed: NT_STATUS_LOGON_FAILURE
[18:55:27] ERROR: Shutdown fails -> 

so i can access it.

donno how i can put my credentials in there thou

I log in via the microsoftaccount, so it is my fore and family name, so there is a space inbetween

EDIT: Should i just create a new User for this ?

If your password really has a % in it, or any other special characters - you are best advised to ensure the password is surrounded by " eg:

computers:
  - address: 192.168.0.137
    alias: Kobito-PC
    credentials: "3434%xxxx"
    delay: 0
    message: >-
      Home Assistant is shutting down this PC. This cannot be canceled. Please
      save your work!

ty, so

"3434 34234%xxxx"

should work ?

ps: now get through the firewall, was missing one checkbox to let it through

EDIT using " " just get removed after saving and restarting the app

I see now reading the documentation and other threads, that the % is used to separate the user and password eg: asjmcguire%mysupersecretpassword There should not be any spaces, and the username will not be your full name, look in c:\users you will see that all the users are only one word. My username for example despite signing in with my full @outlook.com microsoft account, is only the first 5 letters of my email address. So for me it is asjmc%mysupersecretpassword

So here is my solution.
Ty for all the great tips
AND OF COURSE IT was a noob mistake.

So first of all like @WallyR stated, i checked the wrong service in the firewall.
After that I got a new error msg that my credentials were wrong.

Turns out they were… So if I just log out of my computer, the windows just shows my fullname but this is not my username

The username can be found under C://Users

Everything works good now

I have installed rpc on rpi4 and have it working on local network but I want to be able to shutdown computers on a different vlan

Rpi4: 192.168.1.10
Vlan to be controlled: 192.168.10.16

actually the right way to get your username is to open a command prompt and type whoami

You need to set routing of RPC packages between the two VLANs.

Here you can see the RPC service ports.

So I have to forward ports from my main lan 192.168.1.1 to 192.168.10.1 correct.

Not sure how to do that can you explain.

I think the RPC protocol is a 2-way communication setup, so you probably need to set it the other way too.
Since the same ports are used for Windows Sharing and a lot of other stuff, then its really puncturing the whole separation idea with segmented networks.

I think another way of doing this would be preferable.
I bet there is made services to achieve the same thing with just a TCP or UDP package.

Hi there,

I had the rpc shutdown working, but google assistant had problems with understanding the computer name. I changed my windows computer name, and also changed the config file in the addon window, to match the new name.

However, after restarting everything, when i give the command to shutdown, google assistant says ok and does it, but my pc is not going off. When i checked the log file from rpc addon, it shows : read alias: “kevin-pc” and that is the old name…

Has anyone an idea if there are other config files i need to config for rpc addon? In my config yaml, i also added the correct (new) computer name, but somehow there is something that still refers to the old name.

Can anyone help me out with this?

Thanks!

Firstly, if you run a script directly from HA does it shut off the PC correctly? If not, then it’s nothing tondo with Google Assistant.

How are you triggering it? I use Alexa rather than Google home, but my control method below should work…

Create a virtual switch for the PC.
Create an automation when the switch turns off, run the rpc shutdown script
Then in Alexa set a custom routine that when you say Alexa wake PC, it flicks the switch off.
I do the same for WOL.

Hi, I’m with the same problem.
I have a question. The password is the one from Microsoft account? The pin code? Or the password from the "local"account in users.

Thanks!