[RELEASE] PC Controller - Send and receive commands to/from your windows PC (EventGhost)

This App allows you to create automation that includes your pcs.
It connects to an automation software on windows called EventGhost

Here are some examples of things that you can do with the app:

  1. Turn on the computer, unmute and play your favorite playlist when a motion detector detects that you entered the room
  2. Turn on a specific scene when launching an app on your computer
  3. Make the light in your room change color according to the percentage of battery left on your laptop
  4. Change your monitor brightness level according to the data from your light sensor
  5. Change the volume of your pc using a dimmer switch
  6. Use hotkeys on a PC to control devices in Hubitat

Cool ha?! :grinning:

Before You Begin:

  1. Make sure your Hubitat is upgraded to the latest version

  2. Set a static IP for your computer: https://pureinfotech.com/set-static-ip-address-windows-10/

  3. [OPTIONAL] Enable "Wake on LAN" on your PC. Read how to do this here: How to Enable Wake-on-LAN in Windows 10

Installation:

  1. Download and install EventGhost on your PC (Get the latest Windows 10 Beta version)

  2. Download the Latest Hubitat plugin for EventGhost and unzip to \Program Files (x86)\EventGhost\plugins

  3. Install The APP via HPM (Recommended)
    OR
    Download and add the APP and driver to your Hubitat hub

How to Install Custom Apps
How to Install Custom Drivers

How To Use (Including examples with rule machine):

HE APP Change Log:
1.0.4
check EG plugin version

1.0.2

  1. Hide useless state variables
  2. Auto-connect on hub restart
  3. Improved UI

EG Plugin Change Log:
1.0.3

  1. informs if the plugin is outdated
  2. bug fix - can now init the plugin without making changes to the config
  3. actions are now categorized

1.0.2
Sends plugin version to the hub

1.0.1

  1. fixed issues with command condition
  2. added general condition action to help in creating better automations
  3. added some guiding texts to help with the setting up
4 Likes

This looks incredibly promising - I began to play with it this morning - was able to get pretty far but no 'Connect' would work to a workstation - and the 'configure' at the workstation in the EventGhost returns an error.
Using the WOL application I could trigger a shutdown so the device is clearly there and functional.
Is a cert required? does the hub need to be set with user login enabled or can I bypass that?

No certification is required. user and pass are optional

Did you use the included Hubitat plugin for EventGhost?
What happens when you try to add it?
what is the error that you are getting?
what is the version of EventGhost?

Heya @gilshallem -
I finally got some time to get a good look. I have tried this both on a laptop and a PC, the laptop has NO lan device - just wireless. Not sure WOL works there. Also, I don't have IPv6 in my network in case that is a problem.

When I tried to run the plugin on the laptop (both attempts are with NO login info, hub security disabled - I get:

On the pc - (looks like the same failure :slight_smile:
image

On the PC - with WOL on and working - and entering my username and password and security on in the hub:
image

Versions:
image

Any suggestions?

(both machines have a Device installed in my HE device list)

Hi @jshimota
Can you please try to update your EventGhost and Python and let me know if that helped?

Please update EventGhost first and check and if it still doesn't work update Python, this way we will know if the issue is the EventGhost or Python

Good morning. That looks better - I've some questions I'm not sure where to look for the answers -

  1. During the plugin install on the W10 machine, The plugin popped up asking for port, username and password. My HE has no password for local use. I could not 'apply' if I didn't enter anything. I had to enter values to user/pass pair. This resulted in '401 Unauthorized' from websocket entries in my HE log.
  2. I have a domain server here in my office - so user accounts on workstations are domain accounts. For the username and password in the Hubitat device for my test workstation, how do I state a domain username? eg; abcd/username or abcd\username?
  3. One field says it will detect the MAC address - I attempted to specify the mac as I have a multihomed machine (with multiple Network cards). The information text does not state how to enter the MAC - is it with Dashes, Semi-colons or no hexset dividers, just pure ascii?
    34:97:F6:85:9D:C7
    34-97-F6-85-9D-C7
    3497F6859DC7


The connect State Variable shows as 'true' but the current states variable always shows 'false'. Is that expected?

What is a good test to run would you suggest? send a prebuilt task?

progress! I was able to execute a hubitat Send command from the workstation to the hub.
image
Resulted in:
[dev:554] (http://hubitat/logs#dev554) 2021-08-30 09:14:30.861 am [debug] (http://hubitat/device/edit/554) recived: ["are you there", null

This is excellent! Lets see if I can get it to go the other way now!
(note the spelling error)

Hi @jshimota,
I'm happy to see that it is working for you.
Did you update EG? or Python or both?

as for your questions
1,2 when you add the plugin for the first time it doesn't let you apply without making changes - that is an EG bug, you can write one letter in the username field and delete it. The EG plugin listens to your hub on the stated port. you can choose to give it a username and password in order to make sure no one else sends events to your EG except your hub. it is not mandatory. if you do add a user and password, you need to set them also in the hub so it will be able to connect to EG
3. any of the formats you mentioned will work
4. state variables do not livelily refresh. refresh the page and you'll the see the actual current value of the state variable

I recommend watching the tutorial video. I split it to parts so you can watch only the relevant parts . watch the setup part, it will help you :slight_smile:
I give 4 test runs in the video and I show how to implement them.

I also recommend installing nircmd. it works quite nicely with EG. for instance the built-in function of EG that turn of the monitor didn't work well so i am using run command with a command of nircmd. I use it to turn the screen on and off via google assistent
image

I see the bug clearly now that you've described it. Just as you say - enter a value, any value and save. then go back and remove.
May I suggest that you modify the Plugin 'settings' tab to say 'HE Computer Control App login' or something like that? similarly, on the Device login component within HE - change the text to say 'Device EG login'? There are a number of user/pass pairs in and around this area and it was confusing.

Good idea. I will implement it. I edited the last post and added a couple of things ::grinning_face_with_smiling_eyes:

you don't actually even need to save and go back, just enter one letter, delete it and then save

I'm already playing with this :slight_smile: it's working quite well ! You asked about my python version - EG came with stackless 2.7.12 final. The python I have in my machine's environment is 3.9.

you had this error before
image
How did you solve it?

it cleared when I completely removed the Stable release and put in the Beta W10 release of EG I downloaded from the website. clearly the 5.0 rc6 [beta?] has fixes that are important to my situation!

Thanks. I only tested it on the beta. I will add an instruction to download the beta version. Enjoy the app. Please let me know if you come up with some cool automation ideas :slight_smile:

1 Like

LOL! the first I will create will be VLC related - I watch movies on my office display and have scenes that automate the office ambiance which I execute (lower the office lights, turn on ambiance, disable the office alexa voice) so I'm going to try create a VLC event that shoots back at the HE to run my HE rules.. this is going to be really fun and useful!
I'm also starting to think of twitter triggers... and ... well - I'll go watch your video and take it nice and easy!
I wish HE network interface was more robust so I could sandbox this into a dmz subnet ... oh well.

Cool! :slight_smile: :grinning_face_with_smiling_eyes:

I updated the plugin with some new options

This is awesome. I got the device setup and controlling my PC.

@gilshallem how do I integrate this into rules? I.e How can I execute one of the commands as an action in rule? E.g. If this then send event 'string'?

Apologies if I'm missing something simple here...but not sure how to access the custom device from rules.

Hi @darron, Im happy to hear that it works well for you :grinning_face_with_smiling_eyes:
using rule machine you can send events to EG by using a custom action on the device "Send Event" or "Wakeup and send event"

you can trigger a rule by comparing the attribute ReceivedCommand to the command that is sent from EG.

for a more elaborate answer please look at the video I posted. you can skip the beginning and jump to the examples since you already managed to set it up

Thanks...totally missed the video. It showed me exactly what I needed. The parameters were from the button device. Perfect. Thx. Now to automate my arcade and virtual pinball machines using this!

1 Like

Download the Hubitat app