{"id":22710014,"url":"https://github.com/qb4-dev/libsupla","last_synced_at":"2026-03-16T17:37:16.589Z","repository":{"id":157055797,"uuid":"542236055","full_name":"QB4-dev/libsupla","owner":"QB4-dev","description":"Free library to create devices connected with SUPLA - Open Source building automation system","archived":false,"fork":false,"pushed_at":"2025-03-16T19:21:16.000Z","size":734,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T13:55:17.188Z","etag":null,"topics":["esp8266","homeautomation","iot","linux","supla"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/QB4-dev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-09-27T18:37:12.000Z","updated_at":"2025-02-10T19:10:18.000Z","dependencies_parsed_at":"2024-02-17T21:25:32.351Z","dependency_job_id":"229a32d9-3916-4dd5-b48e-1e20f0696cab","html_url":"https://github.com/QB4-dev/libsupla","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/QB4-dev%2Flibsupla","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QB4-dev%2Flibsupla/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QB4-dev%2Flibsupla/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QB4-dev%2Flibsupla/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QB4-dev","download_url":"https://codeload.github.com/QB4-dev/libsupla/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724588,"owners_count":21151559,"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":["esp8266","homeautomation","iot","linux","supla"],"created_at":"2024-12-10T11:12:56.590Z","updated_at":"2026-03-16T17:37:16.561Z","avatar_url":"https://github.com/QB4-dev.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libsupla\n\n[SUPLA](https://www.supla.org) is an open source project for home automation.\n\n# libsupla library\n\nThis library can be used to create devices and services connected with SUPLA Cloud.\nIf compared with more complex [supla-device](https://github.com/SUPLA/supla-device) which is like \nfirmware/SDK based on Arduino lib ported to various platforms this library concept is more classical, \nand has less dependencies.\n\n## Supported platforms\n\nThis library has been tested on following platforms:\n- Linux\n- ESP8266 as [RTOS-SDK Component](https://github.com/QB4-dev/esp-libsupla) (currently without SSL/TLS)\n- ESP32   as [ESP-IDF Component](https://github.com/QB4-dev/esp-libsupla)  (currently without SSL/TLS)\n\n## Getting started\n\nTo compile this library on Linux please install first:\n\n`sudo apt-get install libssl-dev`\n\nor use `NOSSL=1` flag to compile without SSL support\n\nThen run\n\n```\nmake all\n```\n\nand to install library:\n\n```\nsudo make install\n```\n\nFrom now you can start to write your own software connected with [SUPLA](https://www.supla.org)\nJust add to your C code:\n\n```\n#include \u003clibsupla/device.h\u003e\n```\n\nand add linker flag `-lsupla`  and `-lssl` if compiled without `NOSSL=1` flag\n\n## The basics\n\n### Device\n\nWe will start from creation of SUPLA device object:\n\n```\nsupla_dev_t *dev = supla_dev_create(\"Test Device\",NULL);\n\n```\n\nThen we need SUPLA Cloud connection config like:\n\n```\nstatic struct supla_config supla_config = {\n\t.email = \"user@example.com\",\n\t.auth_key = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},\n\t.guid = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},\n\t.server = \"svr.supla.org\",\n\t.ssl = 1\n};\n\n```\n\nYou must have supla account registered with email address and to quick start - generate your device data using links below:\n- [AUTHKEY generator](https://www.supla.org/arduino/get-authkey)\n- [GUID generator](https://www.supla.org/arduino/get-guid)\n\n\nSUPLA device must be configured before first connection:\n\n```\nsupla_dev_set_config(dev,\u0026supla_config);\n```\n\n### Channels\n\nSUPLA device uses channels. We can start from the most basic thermometer channel:\n\n```\nstatic supla_channel_t *temp_channel;\n\nstatic supla_channel_config_t temp_channel_config = {\n\t.type = SUPLA_CHANNELTYPE_THERMOMETER ,\n\t.supported_functions = SUPLA_CHANNELFNC_THERMOMETER,\n\t.default_function = SUPLA_CHANNELFNC_THERMOMETER,\n};\n```\n\nTo create and add channel to device use following functions:\n\n```\ntemp_channel = supla_channel_create(\u0026temp_channel_config);\nsupla_dev_add_channel(dev,temp_channel);\n```\nIn seperate thread/task we can set temperature\n\n```\nsupla_channel_set_double_value(temp_channel,temp);\n```\n\nAnd in main SUPLA thread put `supla_dev_iterate` inside infinite loop\n\n```\nwhile(!app_quit){\n\tsupla_dev_iterate(dev);\n\tusleep(10000);\n}\n```\n\nDevice would automatically synchronize channels data with server\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqb4-dev%2Flibsupla","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqb4-dev%2Flibsupla","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqb4-dev%2Flibsupla/lists"}