npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

homebridge-samsung-smart-aircon

v0.2.2

Published

Homebridge plugin for the Samsung smart air conditioners with port 8888

Downloads

15

Readme

homebridge-samsung-smart-aircon

(homebridge-samsung-aircon-8888 <= This name triggers npm spam check...)

This is a Homebridge plugin for Samsung Smart Air Conditioner with Port 8888. If you have your Samsung AC working over Port 2878, please check out this project.

This allows you to control your Samsung air conditioner with HomeKit and Siri.

Air Conditioner Model

Tested with AJ009MBADEC, should work with all AJ***MBADEC models.

Samsung AJ009MBADEC

Installation

Make sure that you have Node and npm installed.

Install Homebridge

npm install -g homebridge

If you encounter permission issue, you may need do this with sudo and --unsafe-perm:

sudo npm install -g homebridge --unsafe-perm

If you are on Raspberry or Debian system, and wish to use systemd to run homebridge so that it is persisted, please refer to this reference.

Install Plugin

npm install -g homebridge-samsung-smart-aircon

Please apply sudo and / or --unsafe-perm if you encounter any permission error.

Install jq

jq is a command-line JSON parse tool. You need install jq first.

On Mac, if you have brew installed:

brew install jq

On Linux (Raspberry Pi etc.), you may try apt-get:

apt-get install jq

Obtain Your Samsung AC Token

Assign Static IP

It is highly recommended to assign a static IP to your AC. If you have not done so, please do this via your home router, and restart your AC (cut off power, not via remote only) or router thereafter, to make sure that your AC does have the static IP you have assigned to.

Get Token

cd to your installed node_modules/homebridge-samsung-aircon-8888, and you will find a Server8889.py script.

From the folder:

python Server8889.py

Note that this scripts needs the cert ac14k_m.pem, which is in the plugin folder as well. It assumes that your plugin is installed at /usr/local/lib/node_modules/homebridge-samsung-aircon-8888. If in any case that the path of your installed module is different, you need feed it with the correct path:

python Server8889.py /my-absolute-path-to/ac14k_m.pem

If successful, a server will run and listen to the response from your AC. Open a new Terminal / Shell window, and type in as follows. Please do not hit enter to execute this first.

curl -k -H "Content-Type: application/json" -H "DeviceToken: xxxxxxxxxxx" --cert /usr/local/lib/node_modules/homebridge-samsung-aircon-8888/ac14k_m.pem --insecure -X POST https://192.168.1.xxx:8888/devicetoken/request

Please replace the IP address to your AC's static IP. If you have your cert elsewhere, please replace the cert path too.

Turn off your AC, and then hit enter to run the script. Then turn on your AC again.

Return to the Shell window that is running the python script. You should see the following:

----- Request Start ----->

/devicetoken/response
Host: 192.168.1.xxx:8889
Accept: */*
X-API-Version : v1.0.0
Content-Type: application/json
Content-Length: 28

{"DeviceToken":"xxxxxxxx"}
<__main__.RequestHandler instance at 0x......>
<----- Request End -----

Please note down the DeviceToken value. This is your AC token.

Install Root Certificate

If you are on Mac, simply double click to install it.

If you are on Linux:

 sudo mkdir /usr/share/ca-certificates/local
 
 sudo cp /usr/lib/node_modules/homebridge-samsung-aircon-8888	/ac14k_m.pem /usr/share/ca-certificates/local/
 
 sudo update-ca-certificates

Update Homebridge Config File

Usually, you may find your Homebridge config file at ~/.homebridge/config.json.

You may refer to the config-sample.json in this project folder as reference.

{
    // Homebridge and other configs...
    "accessories": [{
        "accessory": "SamsungSmartAirConditioner", // do not change this
        "name": "My Aircon",
        "ip": "192.168.1.x", // AC's static IP
        "token": "A1B2C3D4E5F", // the token 
        "patchCert": "/usr/local/lib/node_modules/homebridge-samsung-aircon-8888/ac14k_m.pem",
        "userAllowedMode": "cool" // 'both','heat', 'cool'
    }]
}

userAllowedMode

Accepted value: 'both', 'heat', 'cool'.

While this AC technically supports both heating and cooling, Samsung has made specific models for some countries, and may have either heating or cooling disabled (even though the disabled mode can still be found on the official remote control, it's not functioning). Also, some parts of the world need not one of these modes.

Based on your AC model and your living place, you may wish to set this value to 'heat' to allow heating only, or 'cool' to allow cooling only, or 'both'.

Please note that due to Homekit limitation, this may not be perfect.

Some Notes

Fan or Wind / Dry Mode

At current stage, homekit HeaterCooler does not have an option for these modes.

Heating / Cooling Trigger Threshold

While this is not really an AC function, adjusting them is actually setting the target temperature. There are no separate thresholds for this AC. (and Homekit HeaterCooler does not support TargetTemperature directly. Thermostat supports it, but it does not have some other functions...)

Swing and Wind Level

Switching between swinging and fixed modes is fine. The "Rotation Speed" is actually to adjust the wind level, which ranges from 1 to 4.

Filter

Support for filter health has been added, though I am not sure how to see it in Apple's Home app. Its status is accessible via Siri. You may see this information if you use Home 3 app.

Resetting filter status function is yet to add.

Credit

This project is forked from cicciovo/homebridge-samsung-airconditioner and rewritten in Typescript.

The Typescipt part uses homebridge-tesla as reference, as well as for some utils methods.