{"id":17858592,"url":"https://github.com/vzakharchenko/smartthings-phevctl","last_synced_at":"2025-07-27T23:30:50.839Z","repository":{"id":45852166,"uuid":"342210291","full_name":"vzakharchenko/smartthings-phevctl","owner":"vzakharchenko","description":"Remote Control Outlander Phev over SMS and/or Smartthings","archived":false,"fork":false,"pushed_at":"2024-10-23T00:56:01.000Z","size":21164,"stargazers_count":4,"open_issues_count":11,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-28T05:45:58.527Z","etag":null,"topics":["airconditioning","device-handler","door-lock","mitsubishi","mobile","outlander","outlander-phev","phev","smartapp","smartthings","smartthings-application","sms"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vzakharchenko.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-25T10:40:22.000Z","updated_at":"2024-07-27T17:36:53.000Z","dependencies_parsed_at":"2022-09-14T12:22:47.284Z","dependency_job_id":"d0540ab0-1265-4caf-8886-7c904f752094","html_url":"https://github.com/vzakharchenko/smartthings-phevctl","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vzakharchenko%2Fsmartthings-phevctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vzakharchenko%2Fsmartthings-phevctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vzakharchenko%2Fsmartthings-phevctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vzakharchenko%2Fsmartthings-phevctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vzakharchenko","download_url":"https://codeload.github.com/vzakharchenko/smartthings-phevctl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227732303,"owners_count":17811362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airconditioning","device-handler","door-lock","mitsubishi","mobile","outlander","outlander-phev","phev","smartapp","smartthings","smartthings-application","sms"],"created_at":"2024-10-28T05:22:22.014Z","updated_at":"2024-12-03T03:12:51.883Z","avatar_url":"https://github.com/vzakharchenko.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smartthings and SMS Remote control for Outlander PHEV\nSMS and Smartthings application wrapper over phevctl\n- [![Node.js CI](https://github.com/vzakharchenko/smartthings-phevctl/actions/workflows/build.yml/badge.svg)](https://github.com/vzakharchenko/smartthings-phevctl/actions/workflows/build.yml)\n- [![docker](https://github.com/vzakharchenko/smartthings-phevctl/actions/workflows/docker.yml/badge.svg)](https://github.com/vzakharchenko/smartthings-phevctl/actions/workflows/docker.yml)\n- [![NPM](https://nodei.co/npm/smartthings-phevctl.png)](https://npmjs.org/package/smartthings-phevctl)\n\n![smartthings.gif](./img/smartthings.gif)\n![smartthings.gif](./img/smartthings1.gif)\n![Charger.png](./img/Charger.png)![doorLock.png](./img/doorLock.png)![](./img/message1.png)\n\n## Features:\n- [can work over sms without smartthings](https://github.com/vzakharchenko/smartthings-phevctl/wiki/SMSServiceWithoutSmartthings)\n- [receive PHEV errors over SMS ](https://github.com/vzakharchenko/smartthings-phevctl/wiki/supportedSMSErrorCodes)\n- [receive Theft Alarm Notifications (if the theft alarm is enabled in the ETACS ) ](https://github.com/vzakharchenko/smartthings-phevctl/wiki/supportedSMSErrorCodes#theft-alarm-codes)\n- switch on/off condition/heater\n- receive warning message from the remote EV and send it in push Notification.\n- send Notification \"Pre A/C has stopped. Possible causes of this are as follows: Door is Open. Main battery level is Low. Drive Battery temperature is Low.\"\n- change mode of air conditioner: heater/cool/windscreen for 10/20/30 mins,\n- show battery level\n- support google home\n- check if doors are closed\n- Thermostat Operating State\n- Support SMS if use mikrotik LTE/huawei e3372h-320(CL4E3372HM)\n- [support wifi EVSE (Electric Vehicle (EV) Charging Stations)](#evse-electric-vehicle-ev-charging-stations)\n- [SMS commands](https://github.com/vzakharchenko/smartthings-phevctl/wiki/supportedSMSCommands)\n\n\n## comparison of installation types\n\n| Installation Type                                                           | Execute action(heating/cooling/headlights and etc...)  | Smartthings Hub required | Internet connection required | can send/receive SMS | huawei e3372h-320(CL4E3372HM) / MikroTik LtAP mini LTE kit  | Raspberry Pi must be installed | Send Push Notifications |\n|-----------------------------------------------------------------------------|--------------------------------------------------------|----------------------|------------------------------|----------------------|----------------------------------------------|--------------------------------|-------------------------|\n| Cloud Installation (run smartthings-phevctl on the cloud)                   | Immediately                                            | No                   | Yes                          | No                   | Yes                                          | No                             | Yes                     |\n| Cloud Installation with rapberry Pi(Cloud is forwarded smartthings-phevctl) | Immediately                                            | No                   | No                           | Yes                  | Yes                                          | Yes                            | Yes                     |\n| Сontrol over SMS without smartthings                                        | 1-2 minutes delay                                      | No                   | No                           | Yes                  | Yes                                          | Yes                            | No                     |\n| Local Network Installation(under NAT)                                       | Immediately                                            | Yes                  | Yes                          | No                   | Yes                                          | No                             | Yes                     |\n| Run without cloud and without Smartthings Hub                               | 2-5 minutes delay                                      | No                   | No                           | Yes                  | Yes                                          | Yes                            | Yes                     |\n\n\n\n## Cloud Installation\n- [cloud installation](https://github.com/vzakharchenko/remote-ctrl-gsm/blob/master/cloud/README.md)\n- [hetzner cloud](https://github.com/vzakharchenko/remote-ctrl-gsm/wiki/gsm-extender-hetzner-cloud)\n- [scaleway cloud](https://github.com/vzakharchenko/remote-ctrl-gsm/wiki/gsm-extender-scaleway-cloud)\n## Without cloud installation\n- [control over SMS without smartthings](https://github.com/vzakharchenko/smartthings-phevctl/wiki/SMSServiceWithoutSmartthings)\n- [Local Network Installation(under NAT)](https://github.com/vzakharchenko/smartthings-phevctl#local-network-installationunder-nat)\n- [Run without cloud and without Smartthings Hub](https://github.com/vzakharchenko/smartthings-phevctl#run-without-cloud-and-without-smartthings-hub)\n\n\n## Outlander PHEV Registration\n- First need to register your phone on the original application [Android](https://play.google.com/store/apps/details?id=com.inventec.iMobile2) or [Apple](https://apps.apple.com/ua/app/outlander-phev-remote-ctrl/id1107478931?l=ru) or (Modified application)[https://github.com/vzakharchenko/remote-ctrl-gsm]\n- [start Smartthings-phevctl Server](https://github.com/vzakharchenko/smartthings-phevctl#installation-steps)\n- open server and enter your phone mac.\n\n## Installation Steps\n1. [Install Server using Docker](https://github.com/vzakharchenko/smartthings-phevctl#server-docker-installation) or [raspberry Pi zero](https://github.com/vzakharchenko/smartthings-phevctl#raspberry-pi-zero-installation) or  [Manual Installation](https://github.com/vzakharchenko/smartthings-phevctl#server-manual-installation)\n2. [create Device Handler](https://github.com/vzakharchenko/smartthings-phevctl#create-custom-dht)\n3. [create smartapp](https://github.com/vzakharchenko/smartthings-phevctl#create-smartapp)\n4. [Configure smartthings application on android or apple](https://github.com/vzakharchenko/smartthings-phevctl#configure-smartthings-application)\n5. [Get \"Smartthings Application Id\" and \"Smartthings Application Secret\"](https://github.com/vzakharchenko/smartthings-phevctl#get-smartthings-application-id-and-smartthings-application-secret)\n6. [Configure Server](https://github.com/vzakharchenko/smartthings-phevctl#configure-server)\n7. [Add Smartthings devices](https://github.com/vzakharchenko/smartthings-phevctl#add-a-new-smartthings-device)\n\n## Server Docker Installation\n- Install docker\n```\nsudo su\ncurl -sSL https://get.docker.com | bash\nusermod -aG docker $USER\n```\n- Supported Architectures: amd64,x86-64,arm64,ppc64le,arm/v7\n```\ndocker -d run --name=smartthings-phevctl  -p 8080:8080 -p 8099:8099 -p 8098:8098 --restart=always vassio/smartthings-phevctl\n```\nor\n```\necho \"{}\"\u003e/opt/remote-ctrl-gsm.json\ndocker -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\n```\n\n# Raspberry Pi Zero installation\n1. Download [Raspberry Pi OS Lite](https://www.raspberrypi.org/software/operating-systems/#raspberry-pi-os-32-bit)\n2. write the Raspberry Pi OS image to the SD card using [balenaEtcher](https://www.balena.io/etcher/) or analog\n3. [write empty \"ssh\" and wpa_supplicant.conf files on sdcard (boot) ](https://desertbot.io/blog/headless-pi-zero-w-wifi-setup-windows)\n4. install phevctl, node(\u003e=12) and smartthings-phevctl\n```\nsudo su\napt-get upgrade -y \u0026\u0026 apt-get -y install build-essential cmake git python3-distutils\nmkdir /opt/phevctl\ncd /opt/phevctl \u0026\u0026 git clone https://github.com/papawattu/msg-core\ncd /opt/phevctl \u0026\u0026  git clone https://github.com/vzakharchenko/phevcore.git\ncd /opt/phevctl \u0026\u0026 git clone https://github.com/DaveGamble/cJSON.git\ncd /opt/phevctl \u0026\u0026 git clone https://github.com/vzakharchenko/phevctl\ncd /opt/phevctl/cJSON \u0026\u0026 mkdir build \u0026\u0026 cd build \u0026\u0026 cmake .. \u0026\u0026 make \u0026\u0026 make install\ncd /opt/phevctl/msg-core \u0026\u0026 mkdir build \u0026\u0026 cd build \u0026\u0026 cmake .. \u0026\u0026 make \u0026\u0026 make install\ncd /opt/phevctl/phevcore \u0026\u0026 mkdir build \u0026\u0026 cd build \u0026\u0026 cmake .. \u0026\u0026 make \u0026\u0026 make install\ncd /opt/phevctl/phevctl \u0026\u0026 mkdir -p build \u0026\u0026 cd build \u0026\u0026 cmake .. \u0026\u0026 make\nrm -f /usr/bin/phevctl\nln -sf /opt/phevctl/phevctl/build/phevctl /usr/bin/phevctl\ncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash\nsource ~/.bashrc\nnvm install --lts\n# You can go drink coffee)\nnpm i pm2 -g\nenv PATH=$PATH:/usr/bin pm2 startup systemd -u root --hp ${HOME}\npm2 startup -u root\nnpm i smartthings-phevctl -g\npm2 start `npm root -g`/smartthings-phevctl/smartthings-phevctl.js\npm2 save\n```\n\n## Server Manual Installation\n```\nsudo su\napt-get upgrade -y \u0026\u0026 apt-get -y install build-essential cmake git\nmkdir /opt/phevctl\ncd /opt/phevctl \u0026\u0026 git clone https://github.com/papawattu/msg-core\ncd /opt/phevctl \u0026\u0026  git clone https://github.com/vzakharchenko/phevcore.git\ncd /opt/phevctl \u0026\u0026 git clone https://github.com/DaveGamble/cJSON.git\ncd /opt/phevctl \u0026\u0026 git clone https://github.com/vzakharchenko/phevctl\ncd /opt/phevctl/cJSON \u0026\u0026 mkdir build \u0026\u0026 cd build \u0026\u0026 cmake .. \u0026\u0026 make \u0026\u0026 make install\ncd /opt/phevctl/msg-core \u0026\u0026 mkdir build \u0026\u0026 cd build \u0026\u0026 cmake .. \u0026\u0026 make \u0026\u0026 make install\ncd /opt/phevctl/phevcore \u0026\u0026 mkdir build \u0026\u0026 cd build \u0026\u0026 cmake .. \u0026\u0026 make \u0026\u0026 make install\ncd /opt/phevctl/phevctl \u0026\u0026 mkdir -p build \u0026\u0026 cd build \u0026\u0026 cmake .. \u0026\u0026 make\nrm -f /usr/bin/phevctl\nwget -qO- https://getpm2.com/install.sh | bash\nenv PATH=$PATH:/usr/bin pm2 startup systemd -u ${currentUser} --hp ${HOME}\nnpm i smartthings-phevctl -g\npm2 start `npm root -g`/smartthings-phevctl/smartthings-phevctl.js\npm2 save\n```\n\n\n## Smartthings installation\n\n### Create Custom DHT\n1. open [https://graph.api.smartthings.com/](https://graph.api.smartthings.com/)\n2. open your location/ or create a new one ![](./img/dht1.png)\n3. open \"My Device Handler\" and \"create New Device Handler\"![](./img/dht2.png)\n4. 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) ![](./img/dht3.png)\n5. click save\n\n### Create SmartApp\n1. open [https://graph.api.smartthings.com/](https://graph.api.smartthings.com/)\n2. open your location ![](./img/dht1.png)\n3. create a new SmartApp ![](./img/smartapp1.png)\n4. select from code and add [remote-ctrl-gsm.groovy](./smartapp/remote-ctrl-gsm.groovy)  ![](./img/smartapp2.png)\n5. open smartapp application and click \"App Settings\"  ![](./img/smartapp3.png) ![](./img/smartapp4.png)\n6. enable \"OAuth\" ![](./img/smartapp5.png)\n7. Save and publish application  ![](./img/smartapp6.png)\n\n### Configure Smartthings application\n\n1. open smartthings application in Phone [Android](https://play.google.com/store/apps/details?id=com.samsung.android.oneconnect) or [Apple](https://apps.apple.com/us/app/smartthings/id1222822904)\n2. select location ![](./img/smartthings1.png)\n3. add SmartApp ![](./img/smartthings2.png)\n4. add \"remote-ctrl-gsm\" ![](./img/smartthings3.png)\n5. set IP and port of server and click save ![](./img/smartthings4.png)\n\n### Get \"Smartthings Application Id\" and \"Smartthings Application Secret\"\n1. open [https://graph.api.smartthings.com/](https://graph.api.smartthings.com/)\n2. select smartapps in your location ![](./img/smartapp7.png)\n3. select your smartapp ![](./img/smartapp8.png)\n4. get \"Smartthings Application Id\" and \"Smartthings Application Secret\" from the page ![](./img/smartapp9.png)\n\n### Configure Server\n\n1. open server ```http://\u003cIP\u003e:8080```\n2. default login/password: admin/admin\n3. configure \"Smartthings Application Id\", \"Smartthings Application Secret\" and mac address ![](./img/settings.png)\n4. click save\n\n### Add a new Smartthings device\n1. select devices-\u003eadd Device ![](./img/addDevice.png)\n2. Device will be appear om Smartthings App\n\n## Local Network Installation(under NAT)\n- install [Smartthings Hub)[https://www.samsung.com/us/smart-home/smartthings/hubs/] on location.\n- during installation smartapp select hub. ![](./img/smartapp10.png)\n\n## Run without cloud and without Smartthings Hub\n- [Configure Smartthings application without cloud and hub](https://github.com/vzakharchenko/smartthings-phevctl#configure-smartthings-application)\n- during installation smartapp select \"Setup my devices without cloud\". ![](./img/nocloud.png)\n\n# Authentication\n## Local authentication (default)\ndefault login/password: ```admin/admin```\n### change password for user\n![](./img/users1.png)\n\n### add a new User\n![](./img/users2.png)\n\n## Keycloak authentication\n\n![](./img/keycloak.png)\n\nrestart Application\n## Keycloak authorization\n![](./img/authorization.png)\nrestart Application\n## Thermostat operation state\n![](./img/thermo1.png)\n![](./img/thermo2.png)\n![](./img/thermo3.png)\n\n\n## Push Notification\n![](./img/message3.png)\n![](./img/message1.png)\n![](./img/message2.png)\n\n# EVSE Electric Vehicle (EV) Charging Stations\n\n## Scripts for [energy star charging stations](https://energy-star.com.ua/)\n![](./img/pr2-large.jpg)\n\n- Slow charging(slowCharge.sh)\n```\ncurl --header \"application/x-www-form-urlencoded\"   --request POST   --data 'cur_set=7\u0026charge_start=1\u0026adaptive_mode_status=1\u0026adaptive_mode_voltage=220\u0026timer=0\u0026timer_start=0'   http://192.168.4.1/ajax\n```\n- Normal charging(fastCharge.sh)\n\n```\ncurl --header \"application/x-www-form-urlencoded\"   --request POST   --data 'cur_set=16\u0026charge_start=1\u0026adaptive_mode_status=0\u0026adaptive_mode_voltage=220\u0026timer=0\u0026timer_start=0'   http://192.168.4.1/ajax\n```\n- Disable charging(disableCharge.sh)\n\n```\ncurl --header \"application/x-www-form-urlencoded\"   --request POST   --data 'cur_set=7\u0026charge_start=0\u0026adaptive_mode_status=1\u0026adaptive_mode_voltage=220\u0026timer=0\u0026timer_start=0'   http://192.168.4.1/ajax\n```\n\n- Mikrotik Configuration\n```\n/interface wireless security-profiles\nadd authentication-types=wpa2-psk group-ciphers=tkip mode=dynamic-keys name=EVSE supplicant-identity=MikroTik unicast-ciphers=tkip wpa-pre-shared-key=\u003cEVSE_PASSWORD\u003e wpa2-pre-shared-key=\u003cEVSE_PASSWORD\u003e\n/interface wireless\nset [ find default-name=wlan1 ] disabled=no frequency=2447 mode=station-pseudobridge name=EVSE_CHARGER security-profile=EVSE ssid=\u003cEVSE_SSID\u003e\n\n/interface bridge\nadd dhcp-snooping=yes fast-forward=no igmp-snooping=yes name=bridgeEVSE\n/interface bridge port\nadd bridge=bridgeEVSE broadcast-flood=no edge=no-discover interface=EVSE_CHARGER multicast-router=disabled trusted=yes unknown-multicast-flood=no unknown-unicast-flood=no\n/interface bridge settings\nset allow-fast-path=no\n\n/ip dhcp-client\nadd add-default-route=no disabled=no interface=bridgeCar use-peer-dns=no use-peer-ntp=no\nadd add-default-route=no disabled=no interface=bridgeEVSE use-peer-dns=no use-peer-ntp=no\n```\n\n## add authorization for EVSE Charging\n\n- start proxy application\n```\nnpm i pm2 -g\nenv PATH=$PATH:/usr/bin pm2 startup systemd -u root --hp ${HOME}\npm2 startup -u root\nnpm i smartthings-phevctl -g\npm2 start `npm root -g`/smartthings-phevctl/evse-proxy.js\npm2 save\n```\n\n- configure evse-proxy\n```\nnano ~/.remote-ctrl-gsm/config.json\n```\n```json\n{\n \"evseServer\": {\n  \"/\": \"https://192.168.4.1\",\n  \"style.css\": \"https://192.168.4.1/style.css\",\n  \"es.js\": \"https://192.168.4.1/es.js\",\n  \"ajax\": \"https://192.168.4.1/ajax\"\n },\n \"users\": [\n  {\n   \"id\": \"0\",\n   \"username\": \"admin\",\n   \"password\": \"admin\"\n  }\n ],\n \"port\": 8011,\n \"role\":\"\u003cKEYCLOAK_REALM\u003e:\u003cKEYCLOAK_CLIENT\u003e\"\n}\n```\n- Keycloak authorization\nexample keycloak.json:\n```\n{\n  \"realm\": \"\u003cREALM\u003e\",\n  \"auth-server-url\": \"https://\u003cKEYCLOAK_URL\u003e/auth/\",\n  \"ssl-required\": \"external\",\n  \"resource\": \"\u003cCLIENT_ID\u003e\",\n  \"credentials\": {\n    \"secret\": \"\u003cCLIENT_SECRET\u003e\"\n  },\n  \"confidential-port\": 0\n}\n```\nKeycloak security role:\n```\n{\n \"evseServer\": {\n  ...\n }\n ],\n \"role\":\"\u003cKEYCLOAK_REALM\u003e:\u003cKEYCLOAK_CLIENT\u003e\"\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvzakharchenko%2Fsmartthings-phevctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvzakharchenko%2Fsmartthings-phevctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvzakharchenko%2Fsmartthings-phevctl/lists"}