SmartThings integration for MyQ Garage Doors and Switches Based on ady642/HomeCloudHub
aromka
, name MyQController
, branch master
. MyQController (master)
repositoryMyQController (master)
Prerequisites: You must have node and npm installed on your system.
git clone https://github.com/aromka/myqcontroller.git
from directory where you want the server installednpm install
localIP
node server [your-localIP]
from myqcontroller
directory, for example: node server 192.168.0.10
192.168.0.5
. If you have firewall enabled, make sure to open port 42457
)Installing on a fresh copy of Raspbian NOOB on Raspberry Pi 3
You can either do this through Raspberry Pi's console, or ssh to it from your mac / pc.
If you want to ssh and run the commands from your mac, the default "Raspbian" OS will automatically broadcast its presence on your network under the mDNS name raspberrypi
. If you are using Mac or Linux, you can reach your Pi easily:
ssh pi@raspberrypi.local
The default username for Raspbian is pi
and the password is raspberry
.
Once you login, update the system and install npm:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get npm
Optionally create a folder where you want to store MyQController app
mkdir ~/Apps
cd ~/Apps
git clone https://github.com/aromka/myqcontroller.git
cd myqcontroller && npm install
Update config.json file
cd ~/Apps/myqcontroller/server/config
cp config.json.example config.json
nano config.json
And set your SmartThings Hub's IP and port. Now run the server. Find out your Raspberry Pi's IP address on your local network (you will need to set it in the app)
hostname -I
Run the server
node server
And update the IP in MyQ Controller SmartApp in the SmartThings app.
You can add a command to your /etc/rc.local
sudo nano /etc/rc.local
and add the following content right before exit 0
exec 2> /tmp/rc.local.log # send stderr from rc.local to a log file
exec 1>&2 # send stdout to the same log file
set -x # tell sh to display commands before execution
node /home/pi/Apps/myqcontroller/server [your-localIP] &
This will run the MyQController server after raspberry pi boots up, and will log the output to /tmp/rc.local.log
file.
Restart the system
sudo reboot
You can tail the logs to make sure everything works as expected.
tail -f /tmp/rc.local.log
sudo kill $(ps aux | grep [m]yq | awk '{print $2}') && sudo /etc/rc.local
When you PC / Mac restarts when running a node server, you might get a different IP address, so app settings need to be update to assign the new IP, so you should both Raspberry PI (or your server) and SmartThing to static IP
sudo nano /etc/dhcpcd.conf
interface eth0 static ip_address=192.168.1.XX/24 static routers=192.168.1.1 static domain_name_servers=192.168.1.1
sudo reboot