[RELEASE] PC Motion Sensor

Anyone actively using this project, or have a diff project to recommend? I'm looking to accomplish the same objective (keep lights on despite PIR sensor going inactive while at computer). I installed this project from github, seems to all be firing and talking ok, but the PC only reports back inactive to the virtual sensor.

Log for the scripts shows:
2021/11/26 12:14:02 INFO inactive, Last Activity 1218116.156 seconds ago

So it seems like it isn't successfully getting the status from my PC. I'm running windows 11. I see no errors or anything interesting in the windows event viewer. Ideas?

I still have it running on my Windows 10 PC. Haven't really kept an eye on how well it is still working. Let me take a look.

Mine still appears to be detecting my mouse and keyboard actions as activity. It does rely on some Windows-related calls from memory, so maybe those are different in Windows 11...

As an alternative, I also setup rules for an old Samsung button sitting on my desk that puts my Study into "work mode", which turns on my TV that I use as a monitor (via my Harmony Hub), sends a WOL command to my PC, turns the lights on and disables my motion lighting rule. May not work for everyone, but you may get something out of it.

I’m beyond my depth on this one, so I’ll probably take a diff approach like you did with the button. Thanks!

1 Like

bah...

image

Hmmm.... Have you just tried installing this now, or has this just started happening on an existing install?

Are you running Windows 10 or 11? Or another version?

It's also weird because there are only 3 lines in the vbs script.... Perhaps check the path to your PowerShell install?

new install.

I scewed up a file extension. oops :stuck_out_tongue:

but struggling to understand instructions here:

From here.....

...what do I put into here...

image

?

Looks like you got it right... Is it not working, or you were just unsure about the settings?

Can't get it working..

Did you add the motion sensor to the device list in Maker API?

Yup

Try running the URL in a browser to activate the device.... Let me get an example...

http:// < HE-Hub-IP > /apps/api/ < Maker-API-App-ID > /devices/ < Device-ID > /active?access_token= < Maker-API-Token >

Also, check the log file to see if there is anything in there...

both active and inactive work in your example. they both cause the device to change state.

1 Like

So it's not working from the scheduled task? Note the operation code of 2 is not the exit code, that is in the comment for the task completion activity.

scheduled task, if I change to 'display message', does do every minute.

so I've changed it back to this:

image

image

If the options are left as this:

...I get this pops up....

image

Now, adding:

arguments:
e:\Ha\pcvms\PC_VirtualMotionSensor.vbs

start in:
E:\HA\pcvms

...

image

etc to make the box look like this:

...bearing in mind the path is:

image

I can't see where I'm going wrong.

This is why I really want to do some more work on this to remove all this setup....

Give me a minute....

I've just manually set the motion sensor to inactive at 11:55

Try putting double quotes around the path to the VBS file in the arguments, making sure it includes the full path to the file for now. Also, for the moment, try setting the "Start in" folder to be the same location as the VBS file and other configuration files.

args is now:

"e:\Ha\pcvms\PC_VirtualMotionSensor.vbs"

image

Also make sure you are running the job as a user, ideally with admin rights, with highest privileges.