How to autostart ha-bridge and HG on windows platform?

Thank you Mike. I’m sure that it some day will be valuable knowledge when new users find HG.

Oh, Gosh…
Notice: I have never ever used HA-Bridge before…

I was able to install it as Windows service in 2 minutes. What did I do:

  1. Downloaded nssm archive, extracted nssm.exe from x64 folder into C:\Windows
  2. Downloaded ha-bridge-5.2.1.jar from GitHub’s releases page into C:\HA-Bridge
  3. Ran powershell with admin privileges
  4. nssm install ha-bridge
  5. In GUI entered java as executable (because in installation FAQ on the GitHub they say to start the app with the command java -jar ha-bridge-5.2.1.jar), C:\HA-Bridge as startup directory and -jar C:\HA-Bridge\ha-bridge-5.2.1.jar as arguments.
    image
  6. Clicked Install service
  7. Opened Windows Task Manager, Services tab
  8. Right-click on ha-bridge service - Start
  9. PROFIT (I can see web interface on http://localhost)

The only prerequisite I have already had on my system was Java.

Right click on nssm and do run as administrator…

No, this manager is a strange wrapper around HomeGenie itself (the only profit - it displays a tray icon). You need to use HomeGenie.exe as an application for service in NSSM.

I believe HomeGenieManager will be deleted at some point.

1 Like

Thank you for your info. I got that far also, HA-bridge does show up in services tab of task manager - as stopped. It will not start.

If I go to my c:\ha-bridge directory and click open on it, it does start. So somehow the path, program name, data to pass to it are not yet correct on my win 10 64bit machine. I am trying different variations. I know I need to delete the added NSSM service with NSSM remove [ha-bridge] command before trying another variation…

ditto homegeniemanager; I add it to windows task manager services window but it does not let HG run. I too tried using NSSM sending instead homegenieservice and that did not work either. I will try other variations after I get HA-bridge to actually start

I really do advise going to Raspberry Pi route with HG as Tuicemen and others have done,

So inexpensive to setup, so easy to configure and all those configuration issues you are experiencing in Windows are so time consuming to resolve. Just a suggestion.

@David_Wallis has already developed an integrated solution to the Alexa situation in HG as far as I know which would also work nicely on the raspberry pi.

Thank you for that suggestion, but I have a full time fast SSD drive windows 10 machine that runs 24/7 here for business anyway. When I require it to send ARM & DISARM commands to my security system it is outside normal business hours so not tasking the 7 processors. Since we know HG does work on windows, being able to automatically start the two necessary programs, is a bonus to getting new folks on board and perhaps taking HG to the next step. It is not costing me anything to experiment this way as I am semi retired and have the time. Since others have shown java programs capable of being started as services, I do not think I am asking for too much. Since HGmanager does not seem to operate well as a service, finding another way seems reasonable also.

For the first time, HG DID autostart here on last reboot; I have been working on ha-bridge, so no clue yet why all of a sudden HG started.

This running HomeGenieService is NOT one of my nssm attempts… So I must assume it ran from pin to start… That at least is a start.

I have HA-bridge running as a service. I prove it by rebooting that computer but not signing in. I then go to another computer on my network and enter127.0.0.1:8516 and it brings up Ha-Bridge.

The solution was to make the java run command line into a batch file, then NSSM that batch file into a service:

image

and

image

So Ha-bridge start as service is complete and works. On to HG…

So HG is still starting after boot and sign in, even with ‘pin to start’ disabled… I found it in startup folder anyway:

image

So I will delete this folder from startup folder and try more nssm routines to see if one can be found that starts a service instead of needing to sign into windows first…

Mikes reasoning for running the HA-Bridge is not for Alexa control but for the other supported hardware it handles.
I also don’t believe HG setup and configuration to be less difficult on a Pi.
My reasoning for going the Pi route was mainly for the low power consumption…
The benefits of running HG from a PI besides what you mentioned are you can place it anywhere, no monitor, keyboard, or mouse needs be connected to it (Except for The initial OS install)

I already had HG running on a MK800 Android TV stick running Linux but it wasn’t powerful enough to handle HG and that of a streaming device I required at my off grid place. It also ran hot which made me uncomfortable.
If my HP thin client used less power or the same as a Pi I wouldn’t have switched to a Pi as it did what I needed.
The HG in a CM15A was strictly done as a proof of concept which turned out to be better then expected, that is the only reason I now run one in the city as I to always had a Windows machine running 24/7.

Thanks Tuicemen; what you say it true in my case.

So I now have installed HGmanager with NSSM:

image

I suspect it is working as a service since after signing into windows HG runs.

But I lost network capability on HG about 4 days ago and have not figured out yet why HG only runs on the local computer. I suspect in my poking around I somehow damaged HGservice.exe program. Altho it says homegenieservice is running, and I get the icon in task bar, no other computer can connect - again for 4-5 days. I will reinstall HG to see if that gets me network connectivity again - I can obviously no longer troublshoot if I can start the service when I cannot test it off this local machine.

Mike, before you go the reinstall route check the Port HG is running from.
when connecting from another pc you must specify the port as well as the IP.
if the port your using from another PC is incorrect it will not connect.

If your HG server is not running on the default port 80 you will need to specify in your browser bar what port you are trying to access. If it’s running on say 8080 and your servers address is 192.168.0.100 you will need to type the following

192.168.0.100:8080

If you restart the HG server at any stage and the default port 80 in use HG will bind to the next available port

Again same applies if you are trying to access the HG server outside of your LAN. Your public IP address :8080

Pete, I know that. I have IIS running on port 80, then I tried to run HA-bridge (default port 80) and HG port 80. I get it man.

I changed my HG from port 80 to 8516 WEEKS Ago. Yes, of course to run it I have to type lcoalhost:8516. I have tried other ports in last week since it stopped working on network to no avail. I left it on 8080 now. Of course to run AT ALL I need to enter computer name or 127.0.0.1 ot localhost or 192.168etc wqith :8516 or 8080.

I have blue IRis server running on a network computer, I have Milestone camera server running on another, I have 4 cheap chinese 1080p cameras all running on their own ports, I have 6 other IP_ cameras running on other ones… I am not a newbie to port usage.

Please, this is not the issue.

Since I am ready to reinstall HG to try to regain network server, I will install 1.1.15 and try it…

Ok I leave you in the capable hands of Tuicemen. Just trying to help.

You’d be amazed at the amount of people that trip up on that stage. Obviously not a issue for you.

Good luck with the install.

So ver 1-1-15 wanted to install in program file directory instead of program file(x86) for 32 bit programs, so I let it to keep it as separate from the uninstalled 526 version. It operates the same in windows. Loaded my config file, it still does not populate security modules (until they sign in & I go to groups,config, page and exit).

I still have no network server.

Just spent an hour deleting IIS crud off my local machine. No difference. Now that it is gone I went back to port 80, still no good…

Got my network server back talking: if I turn off my server local machine with HG’s firewall it is again available on other machines. so some firewall issue. Attack that next.

another thing that needs removing from hg is the functionality for it to randomly choose its port. does does my fecking tits in!

I found that random behaviour stopped if the port setting was high enough on the port list. Less chance of some other service grabbing it.

What we really do need to implement is the encrypting of our email credentials. Scary watching the log when HG is sending an email notification.

Since I freed port 80 again, I changed HG back to it so I can see its service listed in my IP scanner for this computer and can click on it to run. Anyway, found if I turned off windows firwall the service worked on other netowrk computers. Adding all 3 names (homegenie.exe, homegenieservice.exe, & home geniermanager.exe to firewall allowed program list and clicking local network ok still did not get it thru. Finally got it thru by turning no to yes in each ones inbound rules (under advanced settings) for domains.

It appears as bounz said that ver 1.1.15 works fine on windows 10, 64bit machine. And the undefined security modules, until reporting in, are still that way.

I assume something in this new build installed the homegenieservice into the computer service list and set it to automatic as it runs by itself after each boot and I do not have nssm controlling it or ‘pin to start’ turned on for anything. The only special boot I needed to add as the batch file to start ha-bridge java program and then nssm to add that batch file to windows services.