HousePanel 2 Node Version

Hi Everybody!

I'm excited to be releasing the initial version of HousePanel Node.js edition to the Hubitat and SamrtThings community.

I have added a third hub type - the popular ISY hub from Universal Devices. Many thanks to @simplextech for introducing me to that community of fine home automation professionals.

This version of HousePanel is a complete rewrite of the server component from PHP into Node.js. What this means is that you no longer need to configure a web server or PHP to use HousePanel. All you need is a working npm and Node installation. This also means that the middle-man housepanel-push app is no longer needed since the main server doubles as a webSocket listener to keep everything in sync. Finally, because Node.js is a server that runs in the background all the time, this means each request to the server is lightning fast. In plain english -- HP is faster than ever, and more stable than ever. I still have some test to do, but I think you will be please with the robustness of this version even now.

To get started, follow these simple installation instructions. Unfortunately I couldn't get my public facing npm repo to work so you still have to deal with GitHub directly.. Anyway, here is what you need to do.

  • copy all files from the GitHub repository, or clone it as usual using "git clone https://github.com/kewashi/hpserver.git"
  • in the folder where the main files are, run "npm install" (do not list the name of the app after install as this is a local install)
  • after npm does it's thing, you are ready to launch the server. I suggest piping the debug output to a file using this command:
node hpserver.js >& hpserver.log &
  • give it about 30 seconds to initialize and then launch a browser and point it to your server where you did the above install and port 3080
  • for example, if you installed it on your Polisy or a Raspberry PI, point to that IP address with port 3080. My Polisy is on 192.168.1.50 so I go to:

http://192.168.1.50:3080

This will show you the main HousePanel page. You will be logged in as user "default" which you can change from the Options page. From this page you can explore all the features of HousePanel and play with the two clock tiles that are by default put into each room. But to see the full power of HP, you will need to link a smart home hub. This version supports ISY, SmartThings, and Hubitat hubs. All three can be linked but only one ISY hub is allowed. Multiple Hubitat hubs are allowed. I will explain how to link a hub in a moment, but first I want to show you what HousePanel can do. Here is a screen shot of Version 2.220 with my ISY hub linked and my SmartThings and Hubitat hubs also linked.

All of the original deep customization of HP has been retained,. Full documentation is available at http://www.housepanel.net

I know this doc is out-dated so bear with me while I update it.

7 Likes

I got it installed and could open the sample in the browser. However, when I try to authorize my Hubitat or SmartThings hub, I get a simple [object Object] Not found on the resulting webpage. Any suggestions on what I did or shouldn't have done? I don't have the previous version running anywhere.

Did you install the HousePanel.groovy app into the Hubitat IDE and into the ST IDE? You need to do that and enable OAUTH for the hub auth to work.

I did but it was something else i did that was stupid stupid!!!

Now, I can get one hub to authorize but not the 2nd. If I authorize Hubitat first as Hub 0, when I go to authorize the SmartThings Hub as Hub 1, it goes to Hubitat to select devices. If I authorize SmartThings Hub as Hub 0 then try to authorize Hubitat Hub, it goes to SmartThings to select devices.

Also, I am selecting devices but none are being authorized with either hub. I will just wait until you have written instructions on how to link hub as you mentioned in your original post. I am sure I am still doing stupid s&%t!

Dude - you are so close. I think you just have to restart the server and everything should work fine. Sometimes adding hubs gets things confused - I am still working out those kinks. Again just kill the server process and relaunch it and then restart your browser. It should then all work.

Also, make sure you have the latest version. One other trick is I always only add one hub at a time with a return to home page in between before adding the second hub.

1 Like

OHHHH the agony!!! Since it wasn't working and I accidentally installed on the wrong Pi, i uninstalled and tried putting it on correct Pi and now I can't get http://myipaddress:3080 to open. I am getting "IP Address refused to connect" That serves me right. :grin: :grin: :grin:

Had I not deleted everything on my first Pi, how would I restart the server?

Just start fresh. Remove existing processes and deleting existing *.cfg files.

I must be jinxed. I originally almost got it installed on my "OLD" Pi-4 but since it didn't work, I removed it and installed on my "NEW" Pi-4 since that's where I intended to install in first place. I tried multiple times and keep getting this screen:

So, I figured, fine I will go back and install on "OLD" machine and SOB I am getting the same thing. I opened the log file on both machines and get this so it seems like the install worked.

I must be making some elementary mistake(s).

Is your IP address really 192.168.68.xx?

That is unusual. It is usually 192.168.1.xx

Mine is .11 but that is weird too.

Your node server is up and running so you just have to point to it with the right address and make sure your PI is on the same subnet as your main machine and tablet.

Yup really is 192.168.68.xx. Everything is connected to same TP-Link Deco M5 Router.

I am afraid that I have hit a brick wall and it is obviously something going on my Raspberry PIs or my network that is causing the problem, not your application since other people are not having the same issue that I am. Thanks for your help but I think I am SOL. Maybe I will give it a couple of weeks and take a fresh look. Unfortunately, I don't know much about the Raspberry PIs; I just follow directions (usually). If something goes wrong, I don't have a process or the knowledge to troubleshoot.

Other than that log file, is there a way to confirm that the server is still running?

Hi Ken (@kewashi)

Can I say fair play to you creating and sharing this. I tried to get it running on a Mac in the past and now with this version via node. Have finally got it to install.

My only issue seems to be anytime I make changes to regions or try add a hub. It falls over with the below error:

internal/modules/cjs/loader.js:979
throw err;
^
Error: Cannot find module '/Users/xxxxx/hpserver.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:976:15)
at Function.Module._load (internal/modules/cjs/loader.js:859:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}

Also the below error from webpage, once I add hub and start to assign devices to rooms:
TypeError: Cannot read property 'match' of null
at makeThing (/Users/xxxx/hpserver/hpserver.js:1795:19)
at /Users/xxxx/hpserver/hpserver.js:1519:20
at Array.forEach ()
at getNewPage (/Users/xxxx/hpserver/hpserver.js:1493:12)
at mainPage (/Users/xxxxx/hpserver/hpserver.js:4187:25)
at /Users/xxxx/hpserver/hpserver.js:5440:23
at Layer.handle [as handle_request] (/Users/xxxxx/hpserver/node_modules/express/lib/router/layer.js:95:5)
at next (/Users/xxxx/hpserver/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/Users/xxxxx/hpserver/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/Users/xxxxx/hpserver/node_modules/express/lib/router/layer.js:95:5)

Any ideas?
Is a PW mandatory??
I am going to try small things to see if I can isolate issue.

Look forward to trying it Ken! Nice that you’re including ISY too. :+1:t2:

Hi there, I finally got HousePanel 2 to work. I gave up trying to use the old version as I couldn't log in. But now it works and I am pretty happy.

Well it worked, that is to say. Now I am stuck at the same "cannot read property match of null" etc. error. It almost always happens when I either authorize my hub or add a device to the panel.

Hope kewashi can fix this issue. Because I am really looking forward to finally using his great dashboard!

Edit: Installed latest version - still the same issue. As soon as I add devices I get the error.....now I can't access hpserver anymore....(I managed to add a device once....that was a logitech harmony device....but as soon as I started adding my hue light, the error occured...)

Can you grab the latest and try again? And if you still get the error please tell me more about what you are seeing. Is that in the log file? Or is it in your browser? I can’t tell from the info you gave where this is happening. Please copy the full error dump info.

I already have version 2.254. Or did you change anything in the meantime? The error occurs in the browser. I will post the full error when I get home tonight. Thanks for the quick reply!

Ok, so this is the message that I get, when I open http://mylocalip:3080 in my browser:

"TypeError: Cannot read property 'match' of null
at makeThing (/home/pi/hpserver/hpserver.js:2183:19)
at /home/pi/hpserver/hpserver.js:1816:24
at Array.forEach ()
at getNewPage (/home/pi/hpserver/hpserver.js:1784:12)
at mainPage (/home/pi/hpserver/hpserver.js:5321:25)
at /home/pi/hpserver/hpserver.js:6874:23
at Layer.handle [as handle_request] (/home/pi/hpserver/node_modules/express/lib/router/layer.js:95:5)
at next (/home/pi/hpserver/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/pi/hpserver/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/pi/hpserver/node_modules/express/lib/router/layer.js:95:5)"

Hope this helps...

Edit: Btw, when I do "sudo npm install" I get the following error:

"npm WARN npm npm does not support Node.js v10.19.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
up to date in 6.623s"

Can I ignore this?

Your problem appears to be with your node install. Try this first while logged into you main folder with HP ....

npm install

Don’t do sudo

Then tell me what it says. After that try running HP again. If that doesn’t work tell me node gives when you say:

node version

Thanks

Sorry it took me so long, here we go:

when I type in:

"cd hpserver"

and then

"npm install"

it says:

"npm WARN npm npm does not support Node.js v10.19.0
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/
up to date in 6.848s"

when I then start hpserver with:

"node hpserver.js >& hpserver.log &
ps
tail hpserver.log"

it gives me:

"12.5.2020 09:21:17 Loading 1 hubs.
12.5.2020 09:21:18 HousePanel Node.js Server is running on port: 3080
12.5.2020 09:21:18 webSocket Server is listening on port: 1380"

After that, when I try to open http://myip:3080 in chrome browser I get

"TypeError: Cannot read property 'match' of null
at makeThing (/home/pi/hpserver/hpserver.js:2183:19)
at /home/pi/hpserver/hpserver.js:1816:24
at Array.forEach ()
at getNewPage (/home/pi/hpserver/hpserver.js:1784:12)
at mainPage (/home/pi/hpserver/hpserver.js:5321:25)
at /home/pi/hpserver/hpserver.js:6874:23
at Layer.handle [as handle_request] (/home/pi/hpserver/node_modules/express/lib/router/layer.js:95:5)
at next (/home/pi/hpserver/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/pi/hpserver/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/pi/hpserver/node_modules/express/lib/router/layer.js:95:5)"

"node version" gives me:

"internal/modules/cjs/loader.js:638
throw err;
^

Error: Cannot find module '/home/pi/hpserver/version'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)"

Sorry that's a lot of info....Hope it helps you to understand whats going on at my side...

Best regards!

Ok, so I did a fresh install of raspbian and housepanel again. I also managed to install node version 9.11.2 and dont get the node error anymore ( newer versions seem to throw the error). Housepanel started all up fine. I authorized my hub and could add the first light. But as soon as I tried to drag a second light on the panel it wouldnt appear as a tile. Reloading the page then throws the above mentioned "TypeError"....so always the first device seems to work fine. A second one then crashes housepanel....