{"id":13584408,"url":"https://github.com/defcon24bit/record-and-replay-RF-remote","last_synced_at":"2025-04-07T01:32:23.695Z","repository":{"id":135083027,"uuid":"291527215","full_name":"defcon24bit/record-and-replay-RF-remote","owner":"defcon24bit","description":"record \u0026 replay RF signal with Raspberry Pi \u0026 RTL-SDR dongle (optional) integrate with Home Assistant, Alexa and Google Home","archived":false,"fork":false,"pushed_at":"2024-01-27T15:07:47.000Z","size":10574,"stargazers_count":144,"open_issues_count":0,"forks_count":8,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-06T20:36:10.103Z","etag":null,"topics":["alexa","assistant","frequency","google-home","hassio","home-assistant","home-assistant-configuration","home-automation","raspberry-pi","record","replay","rf","rf-signal","sdr","voice-commands","webhook","webhooks"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/defcon24bit.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}},"created_at":"2020-08-30T18:20:32.000Z","updated_at":"2025-04-01T15:37:00.000Z","dependencies_parsed_at":"2024-01-27T16:35:39.735Z","dependency_job_id":null,"html_url":"https://github.com/defcon24bit/record-and-replay-RF-remote","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/defcon24bit%2Frecord-and-replay-RF-remote","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defcon24bit%2Frecord-and-replay-RF-remote/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defcon24bit%2Frecord-and-replay-RF-remote/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defcon24bit%2Frecord-and-replay-RF-remote/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/defcon24bit","download_url":"https://codeload.github.com/defcon24bit/record-and-replay-RF-remote/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247578104,"owners_count":20961225,"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":["alexa","assistant","frequency","google-home","hassio","home-assistant","home-assistant-configuration","home-automation","raspberry-pi","record","replay","rf","rf-signal","sdr","voice-commands","webhook","webhooks"],"created_at":"2024-08-01T15:04:13.469Z","updated_at":"2025-04-07T01:32:18.662Z","avatar_url":"https://github.com/defcon24bit.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# record and replay Radio Frequency (RF) remote signal \nRecord any replay any RF signal. (optional) Integrate with Home Assistant. Trigger replay with Alexa or Google Home.  \n![](docs/pics/project-drawing.png)\nCommon use cases: airconditioners, remote power plugs, fans, shades and kitchen hoods.  This won't work with rolling codes often used for more secure communication to open doors for example.  \n\n## required hardware\n\n* Raspberry Pi \n* radio receiver USB dongle (RTL-SDR with RTL2832U chipset)\n\n## record and replay RF signal \n\non your Pi\n1. Install [Raspberry Pi OS](https://www.raspberrypi.org/downloads/raspberry-pi-os/). \n2. Install https://github.com/F5OEO/rpitx\n3. Connect the RTL-SDR dongle to your Pi.\n4. Record remote signal.  \n\u003e To find the frequency, your can install [SDR](https://www.rtl-sdr.com/big-list-rtl-sdr-supported-software/) software.  If the remote has an FCC id, you can look that up [here](https://fccid.io).  Common frequencies are: 433.92, 868.3, 315, 288, 300, 303, 306, 310, 318, 330, 390, 403.55 and 418 MHz.\n```bash\ncd rpitx\n# this records on 868.00 MHz frequency and writes it to a fan-on-button.iq file\nrtl_sdr -s 250000 -g 35 -f 868.0000e6 fan-on-button.iq\n```\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; *above can also be done through the [rtlmenu.sh GUI](https://github.com/defcon24bit/record-and-replay-RF-remote/tree/master/docs/record-RF-signal-screenshots.md)*\n\n5. CTRL + C to stop recording.  \n\u003e You can remove the RTL-SDR dongle when you're done recoding.  It's not required for sending.    \n6. Add electrical wire to GPIO pin#7 (4th pin down, left row) - see [picture](https://github.com/defcon24bit/record-and-replay-RF-remote/tree/master/docs/pi-gpio-pins-picture.md).\n7. Replay recording.  \n```bash\nsudo ./rpitx/sendiq -s 250000 -f 868.0000e6 -t u8 -i ./rpitx/fan-on-button.iq\n```\n\u003c!--4. Launch the rpitx menu.\n```bash\ncd rpitx\n./rtlmenu.sh\n```\n5. Set frequency, record and test replay - see [screenshot examples](https://github.com/defcon24bit/record-and-replay-RF-remote/tree/master/docs/record-RF-signal-screenshots.md).  \n6. Rename the /rpitx/record.iq file.  \n\u003e The menu always uses the same file, so to avoid overwriting rename the file\n```bash\ncp record.iq on-button.iq\n```\n7. Go back to step 4. and repeat until you've recorded all buttons on your remote.    \n--\u003e\n\n## integrate with Home Assistant\n\nIf you don't have HA, start [here](https://github.com/defcon24bit/record-and-replay-RF-remote/tree/master/docs/install-hassio.md).  \n\n### add as switch \n\nCreate a command line switch for everyone recording you want to replay.\n\n```yaml\n# configuration.yaml\ncommand_line:\n  - switch:\n      name: fan_on\n      unique_id: fan_on\n# ssh is only required if HA and rpitx run on different machines\n      command_on: \"ssh -i /config/id_rsa -o StrictHostKeyChecking=no -q pi@\u003cYOUR.PI.IP.ADDRESS\u003e sudo ./rpitx/sendiq -s 250000 -f 868.0000e6 -t u8 -i ./rpitx/fan-all-on.iq\"\n      command_off: off\n# HA doesn't get feedback if the device is on or off.  This returns the switch always back to the off-state.  \n      command_state: off\n```\n\n### expose switch to 'emulated hue' component \n\nThis will allow Alexa to see the switch as a Philips Hue light.\n\n```yaml\n# configuration.yaml\nemulated_hue:\n  listen_port: 80\n  expose_by_default: false\n  entities:\n    switch.fan_on:\n      name: \"fan on\"\n      hidden: false\n```\n\nAlexa gets confused if you create multiple devices with simular names.       \nTo work around this, create Alexa Routines with a unique trigger sentences and avoid the words 'on' or 'off'.  \nI used *start*- and *stop cooking* - see [example](https://github.com/defcon24bit/record-and-replay-RF-remote/tree/master/docs/alexa-routine-picture.md).\n\n\n### create automation that exposes switch as a webhook \n\nThis will allow you to remotely trigger the switch via an HTTP POST request.   \nCan be used with Google Home for example. \n\n```yaml\n# configuration.yaml\nautomation:\n  - alias: webhook_fan_on\n    trigger:\n    - platform: webhook\n      webhook_id: \u003cPICK-A-RANDOM-WEBHOOK-ID\u003e\n      allowed_methods:\n        - POST\n        - PUT\n      local_only: false\n    condition: []\n    action:\n    - data: {}\n      entity_id: switch.fan_on\n      service: switch.turn_on\n    mode: single\n```\nTest the webhook\n```bash\ncurl -X POST https://\u003cYOUR-HA\u003e.duckdns.org/api/webhook/\u003cYOUR-WEBHOOK-ID\u003e\n```\n\n### create certificate on HA\n\nOnly required if HA and rpitx run on different machines.  \nThe certificate allows to remote execute ssh commands on another machine without a password prompt. \n\ncreate certificate\n```bash\nssh-keygen -t rsa -b 4096\n```\nsend certificate to your pi (command still run on HA)\n```bash\nssh-copy-id pi@\u003cYOUR.PI.IP.ADDRESS\u003e\n```\n\u003e Initially,  HA gave errors when running the remote ssh commands.  I can't remember the exact fix.  It was either the HA user context not having access to the key files or the file and folder permissions for the certificate keys were not set correctly.  I think below two things fixed it.  Let me know if this works for you.\n\non HA\ncopy the id_rsa to the HA /config folder\n\non your Pi\n```bash\nchmod 700 ~/.ssh/\nchmod 600 ~/.ssh/*\n```\n\n## create webhooks without HA\n\nIf you don't have HA, you can try creating webhooks with https://github.com/ncarlier/webhookd.    \nProtecting this setup is beyond the scope of this repository. It's not a question if you get hacked, but when.  \nConsider using an [nginx proxy](https://nginx.org/en/), [Let's Encrypt](https://letsencrypt.org) and [Duck DNS](https://www.duckdns.org).\n\n\u003c!--\n## create IFTTT Applets\n1. Create a [new IFTTT Applet](https://ifttt.com/create).\n2. Select '+This' -\u003e 'Amazon Alexa' or 'Google Assistant' -\u003e 'Say a specific/simple phrase'.\n3. Select '+That' -\u003e 'Webhooks' -\u003e 'Make a web request'.\nURL ```https://\u003cYOUR-HA\u003e/api/webhook/\u003cYOUR-WEBHOOK-ID\u003e```\nMethod: ```POST```.\n--\u003e\n\n## credits \n\nAll rights of the original authors reserved. \n\n[Creative Commons Zero v1.0 Universal license](https://github.com/defcon24bit/record-and-replay-RF-remote/tree/master/LICENSE)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefcon24bit%2Frecord-and-replay-RF-remote","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefcon24bit%2Frecord-and-replay-RF-remote","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefcon24bit%2Frecord-and-replay-RF-remote/lists"}