{"id":18645745,"url":"https://github.com/orlopau/semp","last_synced_at":"2025-04-11T12:31:34.293Z","repository":{"id":33782318,"uuid":"140485612","full_name":"orlopau/semp","owner":"orlopau","description":"A REST Api for the SMA SEMP protocol","archived":false,"fork":false,"pushed_at":"2023-07-03T09:08:02.000Z","size":226,"stargazers_count":7,"open_issues_count":10,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T13:51:11.320Z","etag":null,"topics":["automation","energy-management","rest-api","smart-home","sunnyportal"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/orlopau.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-07-10T20:46:59.000Z","updated_at":"2024-09-28T15:57:01.000Z","dependencies_parsed_at":"2023-02-13T03:45:59.561Z","dependency_job_id":null,"html_url":"https://github.com/orlopau/semp","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/orlopau%2Fsemp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orlopau%2Fsemp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orlopau%2Fsemp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orlopau%2Fsemp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orlopau","download_url":"https://codeload.github.com/orlopau/semp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248401962,"owners_count":21097328,"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":["automation","energy-management","rest-api","smart-home","sunnyportal"],"created_at":"2024-11-07T06:17:03.755Z","updated_at":"2025-04-11T12:31:33.570Z","avatar_url":"https://github.com/orlopau.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SEMP2REST\nAdapts the SMA SEMP protocol to REST for easier usage.\n\n## REST Api\nDocumentation for the specific functionality of parameters can be found on [SMAs Website](https://www.sma.de/produkte/sma-developer.html)\nunder SEMP.\n---\n* [Get devices](./docs/api/devices/get.md): `GET /api/devices`\n* [Create device](./docs/api/devices/post.md): `POST /api/devices`\n---\n* [Get device](./docs/api/devices/id/get.md): `GET /api/devices/:id`\n* [Update device](./docs/api/devices/id/put.md): `PUT /api/devices/:id`\n* [Delete device](./docs/api/devices/id/delete.md): `DELETE /api/devices/:id`\n---\n* [Set hook url](./docs/api/devices/id/hook/post.md): `POST /api/devices/:id/hook`\n* [Delete hook url](./docs/api/devices/id/hook/delete.md): `DELETE /api/devices/:id/hook`\n---\n* [Get planning requests](./docs/api/devices/id/planningRequests/get.md): `GET /api/devices/:id/planningRequests`\n* [Add planning request](./docs/api/devices/id/planningRequests/post.md): `POST /api/devices/:id/planningRequests`\n* [Delete all planning requests](./docs/api/devices/id/planningRequests/delete.md): `DELETE /api/devices/:id/planningRequests`\n---\n* [Update last power](./docs/api/devices/id/lastPower/put.md): `PUT /api/devices/:id/lastPower`\n---\n* [Get recommendation (hook preferred)](./docs/api/devices/id/recommendation/get.md): `GET /api/devices/:id/recommendation`\n\n## Usage\nThe library can be used in two ways.\n\n**1. Docker (preferred)**\n\n1. [Install docker](https://docs.docker.com/install/).\n\n2. Clone.\n\n    ```\n    git clone https://github.com/orlopau/semp.git\n    cd semp\n    ```\n\n3. Run the container\n\n    `--net=host` is needed because of SSDP device discovery, which uses UDP.\n    This means that port flags will be ignored. To use different ports, specify a build flag AND a \n    environment variable on runtime as shown below.\n    \n    The standard ports are `9765` for SEMP and `9766` for the API.\n    \n    `-t` specifies the tag.\n        \n    ```\n    docker build -t semp --build-arg semp=9765 --build-arg api=9766 .\n    ```\n    \n    When running the container, the IP Address of the host must be specified.\n    \n    If the ports have been changed from the standard configuration, additional env variables\n    have to be added.\n    \n    Use the `-it` flag for testing (interactive mode).\n    \n    Every argument except IP is optional.\n    \n    ```\n    docker run -it --net=host \\\n        -e IP=\"192.168.188.101\" \\\n        -e SEMP_PORT=9765 \\\n        -e API_PORT=9766 \\\n        -e UUID=\"290B3891-0311-4854-4333-7B10BC802C2D\" \\\n        -e NAME=\"Semp Gateway\" \\\n        -e MANUFACTURER=\"Semp2Rest\" \\\n        semp\n    ```\n    \n    For deployment remove the `-it` flag and add `--restart=always` to restart on boot and error.\n    \n**2. Module**\n\nDownload the module from npm.\n\n```npm install semp2rest --save```\n\nThen use the module as follows:\n\n```javascript\nconst Gateway = require('semp2rest');\nconst gateway = new Gateway(\"290B3891-0311-4854-4333-7C70BC802C2D\", \"192.168.188.101\", 9089, 9090);\ngateway.start();\n```\n\nTypescript works out-of-the-box.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forlopau%2Fsemp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forlopau%2Fsemp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forlopau%2Fsemp/lists"}