Over the last year, the Hubitat has proven itself more powerful every day and I've looked at integrating more of my devices into it, because... why not? This will be a two part blog post for setting up and configuring nodejs-poolController and then integrating it into Hubitat.
Since the pool went in a few years back, we've been monitoring and managing it using EasyTouch and ScreenLogic, by extension. It's served its purpose for being able to turn lights on and off, controlling the heater, and checking the water temperature. The interface is serviceable, but can be a bit confusing if you don't know that 'Booster Pump' == 'Pool Cleaner' and you have to go to Features to turn on the lights rather than the section that says Lighting. So, a small learning curve, but still a standalone app that begs to be integrated.
The process to setup the poolController was not really that daunting. I had it completed in under an hour. Generally here's the steps I went through:
root@poolcontroller:~# apt-get update && upgrade
root@poolcontroller:~# apt install npm node
This installs nodeJS 10 (at least with my build) and the author recommends 12) which was installed using nvm in the following steps.
root@poolcontroller:~# curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
root@poolcontroller:~# nvm install 12
Install build-essentials and git to pull down code.
root@poolcontroller:~# apt install git
root@poolcontroller:~# apt install build-essential
Clone both projects down.
nodejs-poolController:
root@poolcontroller:~# git clone https://github.com/tagyoureit/nodejs-poolController.git
nodejs-poolcontroller-webClient:
root@poolcontroller:~# git clone https://github.com/tagyoureit/nodejs-poolController-webClient.git
Install both node packages with npm i.
root@poolcontroller:~/nodejs-poolController#npm i
root@poolcontroller:~/nodejs-poolController-webClient# npm i
Run the nodejs-poolControler.
root@poolcontroller:~/nodejs-poolController# npm start
After it's running for the first time, you can edit the config.json file with your specifics.
Run the nodejs-poolController-webClient
root@poolcontroller:~/nodejs-poolController-webClient# npm start
Assuming everything went well, you should be able to browse to that IP address on port 8080.
I took the extra step to setup pm2 to allow the services to startup on reboot.
root@poolcontroller:~/nodejs-poolController# npm install -g pm2
root@poolcontroller:~/nodejs-poolController# pm2 start npm --name="poolController" -- start
root@poolcontroller:~/nodejs-poolController# cd ../nodejs-poolController-webClient




No comments:
Post a Comment