{"id":15043675,"url":"https://github.com/hobbyquaker/rpi2mqtt","last_synced_at":"2025-04-15T00:29:45.058Z","repository":{"id":57150931,"uuid":"42388894","full_name":"hobbyquaker/rpi2mqtt","owner":"hobbyquaker","description":"Connect RaspberryPi GPIOs and 1-Wire temperature sensors to MQTT :cake::radio_button::satellite:","archived":false,"fork":false,"pushed_at":"2018-01-05T10:01:35.000Z","size":20,"stargazers_count":22,"open_issues_count":2,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-26T21:03:59.965Z","etag":null,"topics":["1-wire","gpio","iot","makers","mqtt","raspberrypi","smarthome"],"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":"2015-09-13T08:29:49.000Z","updated_at":"2023-09-08T17:01:35.000Z","dependencies_parsed_at":"2022-08-27T05:52:22.161Z","dependency_job_id":null,"html_url":"https://github.com/hobbyquaker/rpi2mqtt","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%2Frpi2mqtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobbyquaker%2Frpi2mqtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobbyquaker%2Frpi2mqtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobbyquaker%2Frpi2mqtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hobbyquaker","download_url":"https://codeload.github.com/hobbyquaker/rpi2mqtt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248983645,"owners_count":21193611,"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":["1-wire","gpio","iot","makers","mqtt","raspberrypi","smarthome"],"created_at":"2024-09-24T20:49:25.036Z","updated_at":"2025-04-15T00:29:45.041Z","avatar_url":"https://github.com/hobbyquaker.png","language":"JavaScript","funding_links":[],"categories":["Interfaces"],"sub_categories":["Makers"],"readme":"# rpi2mqtt\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/rpi2mqtt.svg)](http://badge.fury.io/js/rpi2mqtt)\n[![Dependency Status](https://img.shields.io/gemnasium/hobbyquaker/rpi2mqtt.svg?maxAge=2592000)](https://gemnasium.com/github.com/hobbyquaker/rpi2mqtt)\n[![Build Status](https://travis-ci.org/hobbyquaker/rpi2mqtt.svg?branch=master)](https://travis-ci.org/hobbyquaker/rpi2mqtt)\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 Connect RaspberryPi GPIOs and 1-Wire temperature sensors to MQTT 🍰🔘📡\n\n\n## Install\n\nPrerequisite: Node.js version 6.0 or above. I suggest to use https://github.com/tj/n to install a recent version of\nNode.js.  \n\nInstall rpi2mqtt:\n`$ sudo npm install -g rpi2mqtt`\n\nTo run rpi2mqtt in background and start on system boot I suggest to use [PM2](https://github.com/Unitech/pm2).\n\n\n## Usage\n\n````\nUsage: rpi2mqtt [options]\n\nOptions:\n  -c, --config         use config file                                                          [default: \"~/.pi2mqtt/config.json\"]\n  -l, --log            log to file                                                              [default: \"~/.pi2mqtt/daemon.log\"]\n  -v, --verbosity      possible values: \"error\", \"info\", \"debug\"                                [default: \"error\"]\n  -a, --alias          alias topics. can be used multiple times. See examples                 \n  -i, --in, --input    use gpio as input. can be used multiple times. See examples            \n  -o, --out, --output  use gpio as output. can be used multiple times. See examples           \n  -p, --payload        type of the mqtt payload. possible values are \"plain\" and \"json\"         [default: \"plain\"]\n  -r, --retain         publish with retain flag                                               \n  -t, --status-topic   topic prefix for status messages                                         [default: \"hostname/status/\"]\n  -z, --set-topic      topic prefix for set messages                                            [default: \"hostname/set/\"]\n  -x, --testament      topic for connect and last will message                                  [default: \"connected\"]\n  -u, --url            broker url. See https://github.com/mqttjs/MQTT.js#connect-using-a-url    [default: \"mqtt://127.0.0.1\"]\n  -s, --w1-wait        seconds to wait before reading /sys/bus/w1/devices/                      [default: 30]\n  -n, --w1-interval    polling interval for 1-wire temperature sensors in seconds               [default: 30]\n  -w, --w1-disable     disable 1-wire                                                         \n  -h, --help           show help                                                              \n  --version            Show version number     \n  \n  Examples:\n    index.js -w -i 17 -i 18 -o 23             Disable 1-Wire, use GPIO17/18 as\n                                              inputs and GPIO23 as output\n    index.js -t -o 17 -a                      Use 1-wire and GPIO17 as output. Set\n    w1/28-0000002981762:Temperature/Garden    mqtt topic aliases and remove topic\n    -a gpio/17:Light/Garden                   prefix\n                        \n````\n\n\n## MQTT Topics\n\nDefault prefix is the hostname. You can disable the topic prefix with empty option --topic\n\n### 1-Wire Temperature Sensors (DS1820) \n\n`\u003cprefix\u003e/status/w1/\u003c1-wire-serial\u003e`\n\nBy default status topic is `\u003chostname\u003e/status`, this can be changed through the command-line option `--status-topic`.\n\nExample: `raspberry/status/w1/28-000005908b0e`\n\n\n### GPIO Input\n\n`\u003cstatus-topic\u003e/gpio/\u003cgpio-number\u003e`\n\nExample: `raspberry/status/gpio/17`\n\n### GPIO Output\n\n`\u003cset-topic\u003e/gpio/\u003cgpio-number\u003e`\n\nBy default the set topic is `\u003chostname\u003e/set`, this can be changed through the command-line option `--set-topic`.\n\nExample: `raspberry/set/gpio/23`\n\nThe payload can be a plain number (`0`, `1`) or the strings `false` and `true`. \n\n\n### Aliases\n\nYou can set individual topics with the --alias option.   \nExample: `rpi2mqtt -a w1/28-000005908b0e:Temperature/Garden`\n\nIf you want to use spaces in the topic use quotes around the whole -a option, like e.g. \n`-a \"w1/28-0000012345:Temperature Garden\"`.\n\nMind that aliases don't affect the configured prefix. So `rpi2mqtt -o 17 -a gpio/17:Light/Garden -t Raspberry5` would \nresult in topic `Raspberry5/Light/Garden` for GPIO 17.\n\n### Ideas/Todo\n\n* Integrate https://github.com/hobbyquaker/piplate2mqtt\n* PiFace\n* Displays\n* uart/spi/i2c?\n\n## License\n\nMIT Copyright (c) Sebastian Raff\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%2Frpi2mqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhobbyquaker%2Frpi2mqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhobbyquaker%2Frpi2mqtt/lists"}