JSPM

  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q54252F
  • License Apache-2.0

smartthings remote ctrl

Package Exports

  • smartthings-phevctl

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (smartthings-phevctl) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Smartthings and SMS Remote control for Outlander PHEV

SMS and Smartthings application wrapper over phevctl

  • Node.js CI
  • docker
  • NPM
  • donate

smartthings.gif smartthings.gif Charger.pngdoorLock.png

Features:

Cloud Installation

Without cloud installation

Outlander PHEV Registration

Installation Steps

  1. Install Server using Docker or raspberry Pi zero or Manual Installation
  2. create Device Handler
  3. create smartapp
  4. Configure smartthings application on android or apple
  5. Get "Smartthings Application Id" and "Smartthings Application Secret"
  6. Configure Server
  7. Add Smartthings devices

Server Docker Installation

  • Install docker
sudo su
curl -sSL https://get.docker.com | bash
usermod -aG docker $USER
  • Supported Architectures: amd64,x86-64,arm64,ppc64le,arm/v7
docker -d run --name=smartthings-phevctl  -p 8080:8080 -p 8099:8099 -p 8098:8098 --restart=always vassio/smartthings-phevctl

or

echo "{}">/opt/remote-ctrl-gsm.json
docker -d run --name=smartthings-phevctl  -p 8080:8080 -p 8099:8099 -p 8098:8098 -v /opt/config/remote-ctrl-gsm.json:/opt/remote-ctrl-gsm.json --restart=always vassio/smartthings-phevctl

Raspberry Pi Zero installation

  1. Download Raspberry Pi OS Lite
  2. write the Raspberry Pi OS image to the SD card using balenaEtcher or analog
  3. write empty "ssh" and wpa_supplicant.conf files on sdcard (boot)
  4. install phevctl, node and smartthings-phevctl
sudo su
apt-get upgrade -y && apt-get -y install build-essential cmake git python3-distutils
mkdir /opt/phevctl
cd /opt/phevctl && git clone https://github.com/papawattu/msg-core
cd /opt/phevctl &&  git clone https://github.com/vzakharchenko/phevcore.git
cd /opt/phevctl && git clone https://github.com/DaveGamble/cJSON.git
cd /opt/phevctl && git clone https://github.com/vzakharchenko/phevctl
cd /opt/phevctl/cJSON && mkdir build && cd build && cmake .. && make && make install
cd /opt/phevctl/msg-core && mkdir build && cd build && cmake .. && make && make install
cd /opt/phevctl/phevcore && mkdir build && cd build && cmake .. && make && make install
cd /opt/phevctl/phevctl && mkdir -p build && cd build && cmake .. && make
rm -f /usr/bin/phevctl
ln -sf /opt/phevctl/phevctl/build/phevctl /usr/bin/phevctl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
source ~/.bashrc
nvm install --lts
# You can go drink coffee)
npm i pm2 -g
env PATH=$PATH:/usr/bin pm2 startup systemd -u root --hp ${HOME}
pm2 startup -u root
npm i smartthings-phevctl -g
pm2 start `npm root -g`/smartthings-phevctl/smartthings-phevctl.js
pm2 save

Server Manual Installation

sudo su
apt-get upgrade -y && apt-get -y install build-essential cmake git
mkdir /opt/phevctl
cd /opt/phevctl && git clone https://github.com/papawattu/msg-core
cd /opt/phevctl &&  git clone https://github.com/vzakharchenko/phevcore.git
cd /opt/phevctl && git clone https://github.com/DaveGamble/cJSON.git
cd /opt/phevctl && git clone https://github.com/vzakharchenko/phevctl
cd /opt/phevctl/cJSON && mkdir build && cd build && cmake .. && make && make install
cd /opt/phevctl/msg-core && mkdir build && cd build && cmake .. && make && make install
cd /opt/phevctl/phevcore && mkdir build && cd build && cmake .. && make && make install
cd /opt/phevctl/phevctl && mkdir -p build && cd build && cmake .. && make
rm -f /usr/bin/phevctl
wget -qO- https://getpm2.com/install.sh | bash
env PATH=$PATH:/usr/bin pm2 startup systemd -u ${currentUser} --hp ${HOME}
npm i smartthings-phevctl -g
pm2 start `npm root -g`/smartthings-phevctl/smartthings-phevctl.js
pm2 save

Smartthings installation

Create Custom DHT

  1. open https://graph.api.smartthings.com/
  2. open your location/ or create a new one
  3. open "My Device Handler" and "create New Device Handler"
  4. select from code and add [Outlander PHEV Action.groovy](./dht/Outlander PHEV Action.groovy), [Outlander PHEV Battery.groovy](./dht/Outlander PHEV Battery.groovy), [Outlander PHEV Thermostat.groovy](./dht/Outlander PHEV Thermostat.groovy) and [Outlander PHEV Doors.groovy](./dht/Outlander PHEV Doors.groovy)
  5. click save

Create SmartApp

  1. open https://graph.api.smartthings.com/
  2. open your location
  3. create a new SmartApp
  4. select from code and add remote-ctrl-gsm.groovy
  5. open smartapp application and click "App Settings"
  6. enable "OAuth"
  7. Save and publish application

Configure Smartthings application

  1. open smartthings application in Phone Android or Apple
  2. select location
  3. add SmartApp
  4. add "remote-ctrl-gsm"
  5. set IP and port of server and click save

Get "Smartthings Application Id" and "Smartthings Application Secret"

  1. open https://graph.api.smartthings.com/
  2. select smartapps in your location
  3. select your smartapp
  4. get "Smartthings Application Id" and "Smartthings Application Secret" from the page

Configure Server

  1. open server http://<IP>:8080
  2. default login/password: admin/admin
  3. configure "Smartthings Application Id", "Smartthings Application Secret" and mac address
  4. click save

Add a new Smartthings device

  1. select devices->add Device
  2. Device will be appear om Smartthings App

Local Network Installation(under NAT)

Authentication

Local authentication (default)

default login/password: admin/admin

change password for user

add a new User

Keycloak authentication

restart Application

Thermostat operation state

Push Notification