{"id":16274994,"url":"https://github.com/sv443/kscontrol","last_synced_at":"2026-05-02T04:33:44.784Z","repository":{"id":50514507,"uuid":"516890188","full_name":"Sv443/KSControl","owner":"Sv443","description":"WiFi-controlled and autonomous gadget to control the Klarstein NB series A/C","archived":false,"fork":false,"pushed_at":"2022-10-12T12:22:41.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-08T16:21:19.285Z","etag":null,"topics":["air-conditioning","esp8266","http-server","iot","remote-control","wifi"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sv443.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-22T21:23:04.000Z","updated_at":"2022-07-27T14:25:02.000Z","dependencies_parsed_at":"2023-01-19T22:19:06.911Z","dependency_job_id":null,"html_url":"https://github.com/Sv443/KSControl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Sv443/KSControl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sv443%2FKSControl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sv443%2FKSControl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sv443%2FKSControl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sv443%2FKSControl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sv443","download_url":"https://codeload.github.com/Sv443/KSControl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sv443%2FKSControl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32523426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-02T01:12:54.858Z","status":"online","status_checked_at":"2026-05-02T02:00:05.923Z","response_time":132,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["air-conditioning","esp8266","http-server","iot","remote-control","wifi"],"created_at":"2024-10-10T18:31:25.836Z","updated_at":"2026-05-02T04:33:44.756Z","avatar_url":"https://github.com/Sv443.png","language":"C++","funding_links":["https://github.com/sponsors/Sv443"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\" style=\"text-align:center;\"\u003e\n\n# KSControl\n### WiFi-controlled and autonomous gadget to control the Klarstein NB series A/C\n\n\u003cbr\u003e\n\n##### Disclaimer:\n##### This was only tested with the NB9 model but it'll probably work with other NB series aircons\n\n\u003c/div\u003e\n\n\u003cbr\u003e\u003cbr\u003e\n\n### Table of content:\n\n- [Software installation](#software-installation)\n- [Hardware installation](#hardware-installation)\n  - [Parts list](#parts-list)\n  - [Schematic](#schematic)\n- [Server](#server)\n  - [Set state](#post-state)\n  - [Get state](#get-state)\n  - [Errors](#errors)\n\n\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\n\n## Software installation:\n1. Set up the ESP board and firmware in the Arduino IDE ([follow this guide](https://randomnerdtutorials.com/how-to-install-esp8266-board-arduino-ide/))\n2. Clone or download and extract this project and open it with the Arduino IDE\n3. Install the following library in the library manager (Sketch \u003e Include library): `ESP_EEPROM` by j-watson\n4. Rename the file `settings.h.template` to `settings.h`, enter your WiFi's credentials and edit the other settings to your liking\n5. Upload the sketch to the ESP board with the arrow button at the top\n6. Open the serial monitor ( \u003ckbd\u003eCtrl\u003c/kbd\u003e + \u003ckbd\u003eShift\u003c/kbd\u003e + \u003ckbd\u003eM\u003c/kbd\u003e ) to view information and a live log (make sure the BAUD rate is set to 115200)\n\n\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\n\n## Hardware installation:\n\n### Parts list:\n- ESP8266 board (or other ESP)\n- Infrared LED (100mA, ~1.5V)\n- Generic npn transistor\n- 30-45 Ω LED resistor (3x 100Ω in parallel or 4x 10Ω in series)\n- 1 kΩ transistor resistor\n\n(resistor values are wrong, TODO: correct them lol)\n\n\u003cbr\u003e\n\n### Schematic:\n\u003ca href=\"./resources/Schematic/Schematic.svg\"\u003e\u003cimg alt=\"schematic image\" src=\"./resources/Schematic/Schematic.svg\" height=\"400\" /\u003e\u003c/a\u003e\n\n\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\n\n## Server:\nKSControl spins up an HTTP server on your ESP's WiFi.  \nIt can be used to remote control the A/C from within your network.  \nTo access it from anywhere, you can either set up a VPN connection to your network, host a reverse proxy like nginx on a Raspberry Pi, or forward the TCP port 80 in your router's configuration (if you're doing this, make sure your ESP is assigned a static IP in your router's interface).  \n  \nUse the following routes to talk to KSControl, using its IP address displayed in the Arduino IDE serial monitor.  \n\n\u003cbr\u003e\n\n\u003e ### POST `/state`\n\u003e All control data (temp, mode, etc) needs to be simultaneously transmitted to the A/C whenever only one value changes, so the ESP keeps track of the current state of the A/C.  \n\u003e If a request is sent to this route, the internal state gets updated and sent to the A/C unit via infrared, just like the remote control would.  \n\u003e   \n\u003e Some values depend on your A/C model's capabilities (some can't heat for example) and will not influence the actual A/C unit's state.  \n\u003e However the ESP's state will be updated with whatever you throw at it, so do some validation yourself if needed.  \n\u003e   \n\u003e To update the state with new values, send a POST request to this route with the following URL parameters.  \n\u003e For example: `/state?enabled=true\u0026mode=COOL\u0026temp=18`\n\u003e \n\u003e | Key | Type | Possible values |\n\u003e | :-- | :-- | :-- |\n\u003e | enabled | boolean | true, false |\n\u003e | temp | number | 16-30 (in °C) |\n\u003e | mode | string | AUTO, COOL, DRY, FAN, HEAT |\n\u003e | fan | string | AUTO, LOW, MEDIUM, HIGH |\n\u003e   \n\u003e This route returns a JSON object that informs you of the success:\n\u003e ```json\n\u003e {\n\u003e   \"error\": false,\n\u003e   \"message\": \"Successfully updated the state\"\n\u003e }\n\u003e ```\n\n\u003cbr\u003e\n\n\u003e ### GET `/state`\n\u003e This route returns the current state that's set in the ESP as a JSON object.  \n\u003e When no state update has been received by the ESP yet, it will return an empty object.  \n\u003e   \n\u003e Sadly the ESP's state and the actual A/C unit's state can differ, as someone can use the remote or press the buttons on the unit to change its state without the ESP knowing of it.  \n\u003e But if you send a request to the [POST /state](#post-state) endpoint with all parameters set, you will make the states consistent again.  \n\u003e   \n\u003e The returned data could look like this:\n\u003e ```json\n\u003e {\n\u003e   \"error\": false,\n\u003e   \"state\": {\n\u003e     \"enabled\": true,\n\u003e     \"temp\": 20,\n\u003e     \"mode\": \"COOL\",\n\u003e     \"fan\": \"HIGH\"\n\u003e   }\n\u003e }\n\u003e ```\n\n\u003cbr\u003e\n\n### Errors\nClient errors have the HTTP response codes 4xx, server errors have the codes 5xx.  \nAdditionally, KSControl will return a JSON object looking like this, informing you what the problem is:\n```json\n{\n  \"error\": true,\n  \"message\": \"Something went wrong\"\n}\n```\n\n\u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\n\n\u003cdiv align=\"center\" style=\"text-align: center;\"\u003e\n\nMade with ❤️ by [Sv443](https://github.com/Sv443)  \nIf you like this project, please consider [supporting me](https://github.com/sponsors/Sv443)  \n  \n© 2022 Sv443 - [MIT license](./LICENSE.txt)\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsv443%2Fkscontrol","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsv443%2Fkscontrol","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsv443%2Fkscontrol/lists"}