{"id":20576808,"url":"https://github.com/hobbyquaker/aqara2mqtt","last_synced_at":"2025-04-14T18:23:04.068Z","repository":{"id":57183024,"uuid":"147700954","full_name":"hobbyquaker/aqara2mqtt","owner":"hobbyquaker","description":"Attach Aqara Smart Hubs to MQTT","archived":false,"fork":false,"pushed_at":"2018-09-28T17:43:44.000Z","size":152,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-13T21:17:46.766Z","etag":null,"topics":["aqara","mqtt","smarthome","xiaomi"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/hobbyquaker.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":"2018-09-06T16:18:46.000Z","updated_at":"2024-03-13T09:12:51.000Z","dependencies_parsed_at":"2022-09-14T06:11:07.917Z","dependency_job_id":null,"html_url":"https://github.com/hobbyquaker/aqara2mqtt","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/hobbyquaker%2Faqara2mqtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobbyquaker%2Faqara2mqtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobbyquaker%2Faqara2mqtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobbyquaker%2Faqara2mqtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hobbyquaker","download_url":"https://codeload.github.com/hobbyquaker/aqara2mqtt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248933876,"owners_count":21185554,"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":["aqara","mqtt","smarthome","xiaomi"],"created_at":"2024-11-16T05:46:59.355Z","updated_at":"2025-04-14T18:23:04.043Z","avatar_url":"https://github.com/hobbyquaker.png","language":"JavaScript","funding_links":[],"categories":["Interfaces"],"sub_categories":["Smart Home Hardware Interfaces"],"readme":"# aqara2mqtt\n\n[![mqtt-smarthome](https://img.shields.io/badge/mqtt-smarthome-blue.svg)](https://github.com/mqtt-smarthome/mqtt-smarthome)\n[![NPM version](https://badge.fury.io/js/aqara2mqtt.svg)](http://badge.fury.io/js/aqara2mqtt)\n[![dependencies Status](https://david-dm.org/hobbyquaker/aqara2mqtt/status.svg)](https://david-dm.org/hobbyquaker/aqara2mqtt)\n[![Build Status](https://travis-ci.org/hobbyquaker/aqara2mqtt.svg?branch=master)](https://travis-ci.org/hobbyquaker/aqara2mqtt)\n[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n[![License][mit-badge]][mit-url]\n\n\u003e Attach [Aqara](https://www.aqara.com/en/products.html) Smart Hubs to MQTT\n\n### Install\n\n`$ sudo npm install -g aqara2mqtt`\n\nSee [Domoticz Wiki](https://www.domoticz.com/wiki/Xiaomi_Gateway_(Aqara)#Adding_the_Xiaomi_Gateway_to_Domoticz) on how \nto enable local network access to the Gateway.\n\n\n### Usage \n\n```\nUsage: aqara2mqtt [options]\n\nOptions:\n  -v, --verbosity  possible values: \"error\", \"warn\", \"info\", \"debug\"\n                                                               [default: \"info\"]\n  -n, --name       instance name. used as topic prefix        [default: \"aqara\"]\n  -k, --insecure   allow ssl connections without valid certificate     [boolean]\n  -u, --url        mqtt broker url (may contain user/password)\n                                                   [default: \"mqtt://127.0.0.1\"]\n  -d, --devices    json file with sid to name mappings\n  -h, --help       Show help                                           [boolean]\n  --version        Show version number                                 [boolean]\n```\n\n\n### Device file\n\nYou can use a json file that defines mappings from sids to names via the `--devices` option. Example:\n```javascript\n{\n    \"1234567890abcdef\": \"WindowSensor1\",\n    \"2222222222abcdef\": \"LeakSensor1\",\n    \"3333333333abcdef\": \"LeakSensor2\",\n    \"9876543210fedc\": {\n        \"name\": \"Gateway1\",\n        \"password\": \"ABCDEF1234567890\"\n    }\n}\n```\n\nIf you don't define a gateway password you will still receive status reports, but you will not be able to set the LED\nor play sounds on the gateway.\n\n### Supported Devices\n\nAll Switches, all Sensors (Cube, Weather, Vibration, Motion, Leak, Door/Window, Smoke) and the Gateway itself. As of \ntoday you _can't_ control plugs, the air condition controller and the curtain actuator.\n\n### Topics published by aqara2mqtt\n\nA few examples, not a complete listing, sids anonymised:\n\n```\naqara/status/MotionKeller/offline {\"val\":false,\"ts\":1536254115426}\naqara/status/MotionKeller/motion {\"val\":true,\"ts\":1536253676785,\"aqara\":{\"type\":\"motion\",\"sid\":\"158d0000000000\"}}\naqara/status/MotionKeller/brightness {\"val\":\"21\",\"ts\":1536253676785,\"aqara\":{\"type\":\"motion\",\"sid\":\"158d0000000000\"}}\naqara/status/Gateway/bri {\"val\":0,\"ts\":1536253741804,\"aqara\":{\"sid\":\"7811d0000000\",\"ip\":\"172.16.23.107\"}}\naqara/status/Gateway/color {\"val\":\"#000000\",\"ts\":1536253741804,\"aqara\":{\"sid\":\"7811d0000000\",\"ip\":\"172.16.23.107\"}}\naqara/status/Cube/battery {\"val\":64,\"voltage\":2.965,\"low\":false,\"ts\":1536252097696,\"aqara\":{\"type\":\"cube\",\"sid\":\"158d0000000000\"}}\naqara/status/Cube/alert {\"val\":true,\"ts\":1536254074965,\"aqara\":{\"type\":\"cube\",\"sid\":\"158d0000000000\"}}\naqara/status/DoorBad/offline {\"val\":false,\"ts\":1536254090481}\naqara/status/DoorBad/magnet {\"val\":false,\"ts\":1536254090482,\"aqara\":{\"type\":\"magnet\",\"sid\":\"158d0000000000\"}}\naqara/status/Cube/rotate {\"time\":500,\"val\":36,\"ts\":1536254398355,\"aqara\":{\"type\":\"cube\",\"sid\":\"158d0000000000\"}}\naqara/status/Cube/free_fall {\"val\":true,\"ts\":1536254403533,\"aqara\":{\"type\":\"cube\",\"sid\":\"158d0000000000\"}}\naqara/status/Cube/tap_twice {\"val\":true,\"ts\":1536254409346,\"aqara\":{\"type\":\"cube\",\"sid\":\"158d0000000000\"}}\naqara/status/Switch1/offline {\"val\":false,\"ts\":1536254412160}\naqara/status/Switch1/battery {\"val\":99,\"voltage\":3.095,\"low\":false,\"ts\":1536254412161,\"aqara\":{\"type\":\"switch\",\"sid\":\"158d0000000000\"}}\naqara/status/Switch1/press {\"val\":true,\"ts\":1536254412161,\"aqara\":{\"type\":\"switch\",\"sid\":\"158d0000000000\"}}\naqara/status/Switch1/press_double {\"val\":true,\"ts\":1536254415962,\"aqara\":{\"type\":\"switch\",\"sid\":\"158d0000000000\"}}\n```\n\n\n### Topics subscribed by aqara2mqtt\n\nYou can address a gateway by its sid or (if defined in device file) by its name.\n\n* aqara/set/_gateway_/bri `0` - `100`\n* aqara/set/_gateway_/color `#rrggbb` e.g. `#0099FF`\n* aqara/set/_gateway_/volume `0` - `100`\n* aqara/set/_gateway_/sound \n  * `0` - Police car 1\n  * `1` - Police car 2\n  * `2` - Accident\n  * `3` - Countdown\n  * `4` - Ghost\n  * `5` - Sniper rifle\n  * `6` - Battle\n  * `7` - Air raid\n  * `8` - Bark\n  * `10` - Doorbell\n  * `11` - Knock at a door\n  * `12` - Amuse\n  * `13` - Alarm clock\n  * `20` - MiMix\n  * `21` - Enthusiastic\n  * `22` - GuitarClassic\n  * `23` - IceWorldPiano\n  * `24` - LeisureTime\n  * `25` - ChildHood\n  * `26` - MorningStreamLiet\n  * `27` - MusicBox\n  * `28` - Orange\n  * `29` - Thinker\n\n\n## License\n\nMIT © [Sebastian Raff](https://github.com/hobbyquaker)\n\n[mit-badge]: https://img.shields.io/badge/License-MIT-blue.svg?style=flat\n[mit-url]: LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhobbyquaker%2Faqara2mqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhobbyquaker%2Faqara2mqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhobbyquaker%2Faqara2mqtt/lists"}