Can a Windows 10 Share file be accessed from the hub?

Anyone know how to execute a Windows 10 (Home version) shared file from the Hub, without running a PHP server on Windows? Tried execute() without success, it's blocked by the Hub.

i doubt HE has any libraries that would allow access to an SMB share.

Best way I have found when needing to reference is to share the file in OneDrive (or Drop box or whatever) and use the share link.

I can't use something like OneDrive, etc, because the VBS shared file must be executed on the Windows machine.

hmmm if you shared what you're doing i might be able to help devise a solution.

My guess is that you have a script that you want to do something different based on some condition in HE.

If so, I would re-write my script so that the VBS is local...but in the code, it pulls down a "config file" from a cloud service. (or something like this...i'm guessing! lol)

If you need the vbs script to run on that win10 machine, something on that machine must execute it. This will likely be a script/program or webservice that can execute local files like php. Eventghost might work, its been a while since I used it and can't remember if it can trigger from network/external events.

The smartUPS.VBS script works with the APC UPS backup, and apcupsd app used for graceful shutdown. It all works well, but I am unable to use the HE device's "Refresh" button without having the Hub initiate the script.

So i'm kinda confused then what you mean by execute.

I would just run the vbs as a scheduled task on your Windows 10 machine. This way every "1 minute" or whatever cadence you run the VBS script, it would send the status to Hubitat.

I have the Wamp server on my Win10 machine but use it intermittently for testing my web site. After installing the apcupsd app, I set the Windows machine to turn off the screen rather than sleep.

EventGhost gives me an idea. The Hub can send a Wake on LAN. Assuming the system reacts to it when the system is not sleeping, perhaps EventGhost can use this as a trigger to run the VBS?

Already have a scheduled task for it every 5 minutes triggered at system Startup. Want to run it on demand from the Hub.

Apologies for my terminology misuse, yes I want to Run the VBS

There's no real way to do this, you'd have to have a web server running on your box.

If you have wamp on it anyway, id probably setup a php page to handle incoming web requests and run the exec function from that to run the vbs. It will give you other options down the road to run on demand services on this box.

I have a php script on a virtual server that will take local ip addresses as an input variable, then ping all the ips and return their status. I have a custom driver in hubitat that hits the script and shows the results.

Here is my ping script as an example:

And the driver (pingLocalServers) that uses it on the hubitat side:

Eventghost

1 Like

I agree! I havent actually set this up myself yet but I've been planning to

it works great - set it up the other day just to see if it still works. It does. You can make your windows machine do a whole lot with this

1 Like

Will try EventGhost with Wake on Lan

I concur. After a lot of self flagellation attempting to use Wake On Lan, I'm choosing the lightweight EventGhost with WebServer plugin over the Wamp PHP server

The failed Wake On Lan plan

  1. Hub issues wake on Lan. Coded a simple Hubaction, it worked, Windows machine woke from sleep.

  2. Use Windows task scheduler to monitor the wake up event, then run the VBS script.

The result: When the windows machine is active, not sleeping, I could not find any trigger events in the logs.

Have the EvventGhost webserver plugin working, but need some help setting the parameters and cannot find any documentation.
Posted on eventghost forum, please reply there

You want to have HE check the status of the UPS and have your Win10 machine do some action based on what HE says?

Why not use something like WinNUT? I use that on a Win10 machine and works great. Thankfully I haven't had to test it in an outage scenario yet, but it does read my UPS from my NAS/Nut server

I'm sure WINnut is a good viable solution. However, I've lost too many follicles getting this version of hub graceful shutdown working with some VBS scripts and apcupsd.

The Refresh command is not required, just trying to make it 101% correct.

There is also IoT Link which is similar to eventghost but uses MQTT instead.

https://iotlink.gitlab.io/

3 Likes