{"id":16817939,"url":"https://github.com/pyrou/rc-restserver","last_synced_at":"2025-10-11T17:24:48.714Z","repository":{"id":22448669,"uuid":"25787055","full_name":"pyrou/RC-RESTserver","owner":"pyrou","description":"RC-RESTserver is a small REST Server written in python. It is designed for Control RF Remote-controlled devices (power sockets / lamp / ..) using several protocols (Chacon / Blyss / X10)","archived":false,"fork":false,"pushed_at":"2019-09-01T10:55:07.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T13:32:04.505Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","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/pyrou.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}},"created_at":"2014-10-26T19:12:27.000Z","updated_at":"2019-09-01T10:55:09.000Z","dependencies_parsed_at":"2022-08-20T15:20:32.302Z","dependency_job_id":null,"html_url":"https://github.com/pyrou/RC-RESTserver","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pyrou/RC-RESTserver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrou%2FRC-RESTserver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrou%2FRC-RESTserver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrou%2FRC-RESTserver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrou%2FRC-RESTserver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyrou","download_url":"https://codeload.github.com/pyrou/RC-RESTserver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrou%2FRC-RESTserver/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259747213,"owners_count":22905310,"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":[],"created_at":"2024-10-13T10:48:46.743Z","updated_at":"2025-10-11T17:24:43.665Z","avatar_url":"https://github.com/pyrou.png","language":"Python","readme":"RC-RESTserver\n=============\n\nRC-RESTserver is a small REST Server written in python. It is designed for Control RF Remote-controlled devices (power sockets / lamp / ..) using several protocols (Chacon / Otio / Blyss / X10)\n\n## Dependencies\n\nSubmodules require wiringPi : https://projects.drogon.net/raspberry-pi/wiringpi/\n\n**Building WiringPi**\n\n```bash\nsudo apt-get install wiringpi\n```\nAlternatively :\n\n```bash\nsudo apt-get install git-core\ngit clone git://github.com/pyrou/wiringPi\ncd wiringPi\n./build\n```\n\n## Installation \n\n```bash\ngit clone --recursive https://github.com/pyrou/RC-RESTserver.git\nwget https://bottlepy.org/bottle.py\nchmod ugo+x $(pwd)/RC-RESTserver/rcserver.py\nsudo ln -s $(pwd)/RC-RESTserver/rcserver.py /etc/init.d/rcserver\n/etc/init.d/rcserver start\n\n#make it boot automatically\nsudo ln -s /etc/init.d/rcserver /etc/rc3.d/S98rcserver\n```\n\n**Building RCSwitch**\n\n```bash\ncd RC-RESTserver/rcswitch-pi\n# edit PIN in send.cpp with appropriate wPi PIN number\n# +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+\n# | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |\n# +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+\n# |     |     |    3.3v |      |   |  1 || 2  |   |      | 5v      |     |     |\n# |   2 |   8 |   SDA.1 |   IN | 1 |  3 || 4  |   |      | 5v      |     |     |\n# |   3 |   9 |   SCL.1 |   IN | 1 |  5 || 6  |   |      | 0v      |     |     |\n# |   4 |   7 | GPIO. 7 |   IN | 1 |  7 || 8  | 0 | OUT  | TxD     | 15  | 14  |\n# |     |     |      0v |      |   |  9 || 10 | 1 | IN   | RxD     | 16  | 15  |\n# |  17 |   0 | GPIO. 0 |   IN | 0 | 11 || 12 | 0 | IN   | GPIO. 1 | 1   | 18  |\n# |  27 |   2 | GPIO. 2 |   IN | 0 | 13 || 14 |   |      | 0v      |     |     |\n# |  22 |   3 | GPIO. 3 |   IN | 0 | 15 || 16 | 0 | IN   | GPIO. 4 | 4   | 23  |\n# |     |     |    3.3v |      |   | 17 || 18 | 0 | IN   | GPIO. 5 | 5   | 24  |\n# |  10 |  12 |    MOSI |   IN | 0 | 19 || 20 |   |      | 0v      |     |     |\n# |   9 |  13 |    MISO |   IN | 0 | 21 || 22 | 0 | IN   | GPIO. 6 | 6   | 25  |\n# |  11 |  14 |    SCLK |   IN | 0 | 23 || 24 | 1 | IN   | CE0     | 10  | 8   |\n# |     |     |      0v |      |   | 25 || 26 | 1 | IN   | CE1     | 11  | 7   |\n# |   0 |  30 |   SDA.0 |   IN | 1 | 27 || 28 | 1 | IN   | SCL.0   | 31  | 1   |\n# |   5 |  21 | GPIO.21 |   IN | 1 | 29 || 30 |   |      | 0v      |     |     |\n# |   6 |  22 | GPIO.22 |   IN | 1 | 31 || 32 | 0 | IN   | GPIO.26 | 26  | 12  |\n# |  13 |  23 | GPIO.23 |   IN | 0 | 33 || 34 |   |      | 0v      |     |     |\n# |  19 |  24 | GPIO.24 |   IN | 0 | 35 || 36 | 0 | IN   | GPIO.27 | 27  | 16  |\n# |  26 |  25 | GPIO.25 |   IN | 0 | 37 || 38 | 0 | IN   | GPIO.28 | 28  | 20  |\n# |     |     |      0v |      |   | 39 || 40 | 0 | IN   | GPIO.29 | 29  | 21  |\n# +-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+\n# | BCM | wPi |   Name  | Mode | V | Physical | V | Mode | Name    | wPi | BCM |\n# +-----+-----+---------+------+---+---Pi 3---+---+------+---------+-----+-----+\nmake\n# test it with following command\n./send 11111 1 1\n```\n\n## API\n\nOnce the server is running you can perform HTTP requests to control your devices.\n\n### X10 devices\n\n```\nGET /x10/{device}/{unit}/{status}.json\n```\n\n| Param name | Description | Example |\n| --- | :--- | --- |\n| `device` | Called also \"House code\" on some devices, the de device must be a letter between `A` and `P` (case insensitive) | `C` |\n| `unit` | This is the \"Unit number\" and must be a number between `1` and `16` | `3` |\n| `status` | `on` or `off` | `on` |\n\n**Example**\n\nTo turn on the power socket configured as house code C, unit number 3 ; perform a GET request on the following endpoint :\n\n```\nGET /x10/C/3/on.json \n```\n\n\n### RC Switches devices\n\nThis endpoint will use the [rcswitch-pi library](https://github.com/r10r/rcswitch-pi) to control devices with a SC5262 / SC5272, HX2262 / HX2272, PT2262 / PT2272, EV1527, RT1527, FP1527 or HS1527 chipset. Also supports Intertechno outlets.\n\n```\nGET /switch/{device}/{unit}/{status}.json\n```\n\n| Param name | Description | Example |\n| --- | :--- | --- |\n| `device` | 5-Bits length mask* of the switch group. |  `10010` |\n| `unit` | This is the \"Unit number\" and must be a number between `1` and `5` | `2` |\n| `status` | `on` or `off` | `on` |\n\n**Determine your bit mask and unit number**\n\nRefer to DIP switches 1 to 5 where \"1\" = on and \"0\" = off, if all DIP switches are on, `{device}` should be `11111`. Then refer to DIP switches 6 to 10 (A..E) if switche D is on, `{unit}` is `4`.\n\n**Example**\n\nTo turn off the power outlet socket configured as group 01001, unit B ; perform a GET request on the following endpoint :\n\n```\nGET /switch/01001/2/off.json \n```\n\n#### Tri-states commands\n\nThis endpoint will also use the [rcswitch-pi library](https://github.com/r10r/rcswitch-pi) by sending \"tri-states\" raw commands.\n\n```\nGET /tristate/{command}.json\n```\n\n| Param name | Description | Example |\n| --- | :--- | --- |\n| `command` | Command identifier defined by F, 0 or 1. |  `F0FF011F0011` |\n\n**Example**\n\n```\nGET /tristate/F0FF011F0011.json \n```\n\n### Blyss devices\n\n```\nGET /blyss/{key}/{channel}/{status}.json\n```\n\n| Param name | Description | Example |\n| --- | :--- | --- |\n| `key` | This is your RF key in hex format. | `0FAE24` |\n| `channel` | This is the channel number to control. It must be a number between `1` and `5` | `1` |\n| `status` | `on` or `off` | `on` |\n\n**Determine your RF Key**\n\nDetermining your RF Key require additionnal components such as a 433Mhz RF Receiver. See complete instruction and code at [skyduino blog (in french)](https://skyduino.wordpress.com/2012/07/19/hack-partie-2-reverse-engineering-des-interrupteurs-domotique-blyss/)\n\n**Example**\n\nTo turn on the power socket on channel 1; perform a GET request on the following endpoint :\n\n```\nGET /blyss/0FAE24/1/on.json \n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyrou%2Frc-restserver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyrou%2Frc-restserver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyrou%2Frc-restserver/lists"}