{"id":15020657,"url":"https://github.com/pilotak/docker-lirc-watcher","last_synced_at":"2025-10-26T04:30:49.745Z","repository":{"id":54660973,"uuid":"172221229","full_name":"pilotak/docker-lirc-watcher","owner":"pilotak","description":"Listens to LIRC daemon and sends it to MQTT","archived":true,"fork":false,"pushed_at":"2021-02-05T07:03:58.000Z","size":47,"stargazers_count":12,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-23T18:28:09.256Z","etag":null,"topics":["bridge","debian","intel-nuc","lirc","lirc-daemon","mqtt","python","python3","raspberry-pi","raspberry-pi-2","raspberry-pi-3","raspberry-pi-4","ubuntu"],"latest_commit_sha":null,"homepage":null,"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/pilotak.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":"2019-02-23T14:05:44.000Z","updated_at":"2024-11-27T19:33:42.000Z","dependencies_parsed_at":"2022-08-13T23:10:28.539Z","dependency_job_id":null,"html_url":"https://github.com/pilotak/docker-lirc-watcher","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2Fdocker-lirc-watcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2Fdocker-lirc-watcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2Fdocker-lirc-watcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2Fdocker-lirc-watcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pilotak","download_url":"https://codeload.github.com/pilotak/docker-lirc-watcher/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238258985,"owners_count":19442509,"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":["bridge","debian","intel-nuc","lirc","lirc-daemon","mqtt","python","python3","raspberry-pi","raspberry-pi-2","raspberry-pi-3","raspberry-pi-4","ubuntu"],"created_at":"2024-09-24T19:55:23.901Z","updated_at":"2025-10-26T04:30:44.202Z","avatar_url":"https://github.com/pilotak.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LIRC watcher\n![Docker Build](https://github.com/pilotak/docker-lirc-watcher/workflows/docker%20build/badge.svg) ![Docker Pulls](https://img.shields.io/docker/pulls/pilotak/lirc-watcher) ![Docker Size](https://img.shields.io/docker/image-size/pilotak/lirc-watcher?color=orange)\n\nDocker container that listens to LIRC daemon (running on the host) and sends received codes over MQTT with added benefit of short and long putton press. It can also send IR remote keys through lirc by publishing to MQTT topics.\n\n**LIRC must be install on the host system**. Following examples have been tested below but should work on other platforms with adjustments too.\n\n### Debian Buster\nPlease follow steps in wiki [Install-on-Debian-Buster](https://github.com/pilotak/docker-lirc-watcher/wiki/Install-on-Debian-Buster)\n\n### Debian Stretch\nPlease follow steps in wiki [Install-on-Debian-Stretch](https://github.com/pilotak/docker-lirc-watcher/wiki/Install-on-Debian-Stretch)\n\n### Ubuntu 18.04\nPlease follow steps in wiki [Install-on-Ubuntu-18.04](https://github.com/pilotak/docker-lirc-watcher/wiki/Install-on-Ubuntu-18.04)\n\n## Recording codes\nTest receiver\n```sh\nsudo systemctl stop lircd.service\nmode2 --driver default --device /dev/lirc0\n```\nOutput should look similar to this:\n```\nspace 4195\npulse 551\nspace 1621\npulse 501\nspace 529\npulse 572\nspace 1553\npulse 547\nspace 524\npulse 551\nspace 525\npulse 549\n```\n\nIf everything is ok, execute following and follow the commands in the script. Adjust name of the file should you wish.\n```sh\nsudo irrecord --driver default --device /dev/lirc0 ~/pioneer.lircd.conf\n```\n\nYou will end it up with file `~/pioneer.lircd.conf`.\n\n```\nbegin remote\n\n  name  pioneer\n  bits           32\n  flags SPACE_ENC|CONST_LENGTH\n  eps            30\n  aeps          100\n\n  header       8544  4180\n  one           578  1545\n  zero          578   497\n  ptrail        575\n  gap          91166\n  min_repeat      3\n  toggle_bit_mask 0xF0F08080\n  frequency    38000\n\n      begin codes\n          KEY_POWER                0xA55A38C7\n          KEY_MUTE                 0xA55A48B7\n          KEY_VOLUMEUP             0xA55A50AF\n          KEY_VOLUMEDOWN           0xA55AD02F\n      end codes\n\nend remote\n```\n\nLet's move this config over to LIRC daemon.\n```sh\nsudo mv ~/pioneer.lircd.conf /etc/lirc/lircd.conf.d/\nsudo systemctl start lircd.service\n```\n\nTest receiver again, if you see the names of your keys when button pressed, that's a win-win.\n```sh\nirw\n```\n\n## Docker-compose\nNow just start the docker container, alter the config to your needs and you ready to rock.\n```yaml\nversion: \"3\"\nservices:\n  lirc:\n    container_name: lirc\n    restart: always\n    image: pilotak/lirc-watcher\n    environment:\n      - MQTT_BROKER=192.168.0.10\n      - MQTT_USER=admin\n      - MQTT_PASSWORD=my-secret-pw\n    volumes:\n      - /var/run/lirc/lircd:/var/run/lirc/lircd\n```\n\n### Environmental variables\nBellow are all available variables\n\n| Variable | Description | Default value |\n| --- | --- | :---:|\n| `LONG_PRESS` | How many messages is received to be considered as long press | 12 |\n| `READ_TIMEOUT` | How long to wait to process new data *seconds* | 0.2 | \n| `PAYLOAD_LONG_PRESS` | Payload on long press | \"long\" | \n| `PAYLOAD_SHORT_CLICK` | Payload on short press | \"short\" | \n| `MQTT_BROKER` | Broker address | localhost | \n| `MQTT_USER` | MQTT user | None | \n| `MQTT_PASSWORD` | MQTT password | None | \n| `MQTT_PORT` | MQTT broker port | 1883 | \n| `MQTT_ID` | MQTT client id | \"lirc-watcher\" | \n| `MQTT_PREFIX` | MQTT topic prefix | \"lirc\" |\n| `MQTT_QOS` | MQTT QOS | 1 |\n\n### MQTT topics for receiving\nWhen button is pressed you will receive message in format\n`MQTT_PREFIX/REMOTE_NAME/KEY_NAME` with payload `short` / `long` ie. `lirc/pioneer/KEY_POWER`\n\n### MQTT topics for sending\nTo send a remote key press, publish to `MQTT_PREFIX/send/REMOTE_NAME/KEY_NAME` with the payload being the number of repeats ie. `lirc/send/pioneer/KEY_POWER` If the payload is empty, repeats will default to 1.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilotak%2Fdocker-lirc-watcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpilotak%2Fdocker-lirc-watcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilotak%2Fdocker-lirc-watcher/lists"}