{"id":17488449,"url":"https://github.com/pjuzeliunas/nilan-rest-api","last_synced_at":"2025-04-22T17:27:00.464Z","repository":{"id":101879293,"uuid":"220327221","full_name":"pjuzeliunas/nilan-rest-api","owner":"pjuzeliunas","description":"REST API server for communication with Nilan CTS700 heatpump over Modbus TCP protocol","archived":false,"fork":false,"pushed_at":"2022-02-17T20:45:59.000Z","size":1100,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-19T07:08:07.068Z","etag":null,"topics":["modbus","modbus-tcp","nilan","raspberry-pi","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pjuzeliunas.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":"2019-11-07T20:54:42.000Z","updated_at":"2022-10-13T17:40:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"2850b345-bf18-4538-8a07-177c23337182","html_url":"https://github.com/pjuzeliunas/nilan-rest-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjuzeliunas%2Fnilan-rest-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjuzeliunas%2Fnilan-rest-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjuzeliunas%2Fnilan-rest-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjuzeliunas%2Fnilan-rest-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pjuzeliunas","download_url":"https://codeload.github.com/pjuzeliunas/nilan-rest-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250286450,"owners_count":21405443,"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":["modbus","modbus-tcp","nilan","raspberry-pi","rest-api"],"created_at":"2024-10-19T04:07:34.112Z","updated_at":"2025-04-22T17:27:00.439Z","avatar_url":"https://github.com/pjuzeliunas.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nilan-rest-api\n\nNilan API server is a REST interface for controlling Nilan heatpump. Server communicates with Nilan CTS700 using\n[Modbus TCP protocol](https://www.nilan.dk/Admin/Public/DWSDownload.aspx?File=%2fFiles%2fFiler%2fDownload%2fDanish%2fDokumentation%2fSoftware+vejledninger%2fModbus%2fCTS700_Modbus_protokol.pdf).\nIt exposes heatpump settings and readings in JSON format.\n\nServer is written in Go.\n\n\n## Usage\n\nREST API server is running on port 8080 and supports the following HTTP methods:\n\n#### GET `/readings`\n\nReturns basic readings of Nilan heatpump in JSON format.\n\n```\n{\n    \"RoomTemperature\": 242,\n    \"OutdoorTemperature\": 83,\n    \"AverageHumidity\": 38,\n    \"ActualHumidity\": 37,\n    \"DHWTankTopTemperature\": 553,\n    \"DHWTankBottomTemperature\": 511,\n    \"SupplyFlowTemperature\": 346\n}\n```\n\nTemperature is in ℃ times 10.\n\n#### GET `/settings`\n\nReturns basic settings of Nilan heatpump in JSON format.\n\n```\n{\n    \"FanSpeed\": 102,\n    \"DesiredRoomTemperature\": 230,\n    \"DesiredDHWTemperature\": 530,\n    \"DHWProductionPaused\": false,\n    \"DHWProductionPauseDuration\": 3,\n    \"CentralHeatingPaused\": false,\n    \"CentralHeatingPauseDuration\": 1,\n    \"VentilationMode\": 0,\n    \"VentilationOnPause\": false,\n    \"SetpointSupplyTemperature\": 350\n}\n```\n\nFan speed can be 101 (level 1), 102 (level 2), 103 (level 3) or 104 (level 4).\n\nTemperature is in ℃ times 10.\n\nVentilation mode can be 0 (auto), 1 (cooling) or 2 (heating).\n\n#### PUT `/settings`\n\nSets settings of Nilan heatpump. Body must be in the same JSON format as one from GET request.\nNil values or absence of them tells the server to keep the existing setting unchanged,\nthus making it possible to send a single setting change in a short form. For example, to change just\nthe fan speed, the following request body is valid:\n```\n{ \"FanSpeed\": 103 }\n```\n\n\n## Hardware setup\n\nTested on\n[Nilan Compact P AIR 9](https://www.nilan.dk/da-dk/forside/loesninger/boligloesninger/kompaktloesning/compact-p-air-9) heatpump \nand [Raspbery Pi 3](https://static.raspberrypi.org/files/product-briefs/Raspberry-Pi-Model-Bplus-Product-Brief.pdf) host.\n\nConnect Nilan to the host computer using Ethernet cable. Ethernet cable should hanging inside the heatpump.\n\n## Software setup\n\n### Prerequisites\n\n1. Host computer and Nilan heatpump must be on the same network. By default, heatpump has this IP address: 192.168.5.107(:502).\nMake sure that host computer and heatpump are running on the same network (subnet) by adjusting ethernet port IP address.\n2. Install either golang or docker.\n\n### Set up server using Docker\n\nBuild and run Docker container as follows:\n```\ndocker build -t nilan .\ndocker run -e NILAN_ADDRESS=\u003cIP and port of Nilan\u003e -it --rm -p 8080:8080 nilan\n```\n\nFor more sophisticated setup refer to Docker documentation.\n\n### Set up server using Go\n\nCompile and run server as follows:\n```\ngo get -d -v ./...\ngo build -o nilanapp app/app.go\nNILAN_ADDRESS=\u003cIP and port of Nilan\u003e ./nilanapp\n```\n\n## Disclaimer\n\nThis initial version of API server is developed by home automation enthusiast (outside Nilan company) and is based\non open Nilan CTS700 Modbus protocol.\n\nNilan is a registered trademark and belongs to [Nilan A/S](https://www.nilan.dk/Default.aspx).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjuzeliunas%2Fnilan-rest-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpjuzeliunas%2Fnilan-rest-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjuzeliunas%2Fnilan-rest-api/lists"}