{"id":20081266,"url":"https://github.com/depuits/pi-mqtt-led","last_synced_at":"2026-04-10T07:02:31.110Z","repository":{"id":28710266,"uuid":"115247901","full_name":"depuits/pi-mqtt-led","owner":"depuits","description":"Led control using JSON and MQTT designed for Home Assistant","archived":false,"fork":false,"pushed_at":"2024-06-19T02:17:26.000Z","size":615,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-13T01:35:58.488Z","etag":null,"topics":["assistant","json","light","mqtt","pigpio","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/depuits.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-24T07:43:13.000Z","updated_at":"2022-11-14T08:09:25.000Z","dependencies_parsed_at":"2025-01-13T01:43:46.003Z","dependency_job_id":null,"html_url":"https://github.com/depuits/pi-mqtt-led","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/depuits%2Fpi-mqtt-led","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/depuits%2Fpi-mqtt-led/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/depuits%2Fpi-mqtt-led/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/depuits%2Fpi-mqtt-led/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/depuits","download_url":"https://codeload.github.com/depuits/pi-mqtt-led/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241511677,"owners_count":19974443,"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":["assistant","json","light","mqtt","pigpio","raspberry-pi"],"created_at":"2024-11-13T15:34:07.091Z","updated_at":"2025-12-31T01:04:40.025Z","avatar_url":"https://github.com/depuits.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Raspberry pi MQTT light using JSON for Home Assistant\nLed control using JSON and MQTT designed for [Home Assistant](https://home-assistant.io/). This module was based on the [ESP8266 module](https://github.com/corbanmailloux/esp-mqtt-rgb-led) but written from scratch to be used on a Raspberry pi.\n\n## Installation/Configuration\n\nTo set this system up, you need to configure the [MQTT JSON light](https://home-assistant.io/components/light.mqtt_json/) component in Home Assistant and set up a light to control. This guide assumes that you already have Home Assistant set up and running. If not, see the installation guides [here](https://home-assistant.io/getting-started/).\n\n### The Home Assistant Side\n1. In your `configuration.yaml`, add the following, depending on the supported features of the light:\n\n```yaml\n # Only one color:\nlight:\n  - platform: mqtt\n    schema: json\n    name: mqtt_json_light_1\n    state_topic: \"home/json_brightness\"\n    command_topic: \"home/json_brightness/set\"\n    brightness: true\n    effect: true\n    effect_list: [flash]\n    optimistic: false\n    qos: 0\n\n# RGB:\nlight:\n  - platform: mqtt\n    schema: json\n    name: mqtt_json_light_2\n    state_topic: \"home/rgb1\"\n    command_topic: \"home/rgb1/set\"\n    brightness: true\n    rgb: true\n    effect: true\n    effect_list: [colorfade_slow, colorfade_fast, flash]\n    optimistic: false\n    qos: 0\n\n# RGBW:\nlight:\n  - platform: mqtt\n    schema: json\n    name: mqtt_json_light_3\n    state_topic: \"home/rgbw1\"\n    command_topic: \"home/rgbw1/set\"\n    brightness: true\n    rgb: true\n    white_value: true\n    effect: true\n    effect_list: [colorfade_slow, colorfade_fast, flash]\n    optimistic: false\n    qos: 0\n```\n2. Set the `name`, `state_topic`, and `command_topic` to values that make sense for you.\n3. Restart Home Assistant. Depending on how you installed it, the process differs. For a Raspberry Pi All-in-One install, use `sudo systemctl restart home-assistant.service` (or just restart the Pi).\n\n### The Light Side\nThis module depends on the [pigpio](https://www.npmjs.com/package/pigpio) library. Before installing this module, you should install the [pigpio C library](https://github.com/joan2937/pigpio). More detailed instructions can be found [here](https://www.npmjs.com/package/pigpio#step-1---install-the-pigpio-c-library).\n\n#### Steps\n1. Install [pigpio C library](https://github.com/joan2937/pigpio).\n2. Install module dependencies: `npm i`.\n3. Update the config: edit the `config/default.js` file or create local config according to [node-config](https://github.com/lorenwest/node-config/wiki/Configuration-Files).\n4. Run the module directly using `npm start` or use a process manager like [pm2](https://github.com/Unitech/pm2).\n\n#### Wiring\nFor an RGB LED strip using N-MOSFETs for control, you'll want to wire it similar to this:\n**The resistors should be connected to the gate of the mosfet and not the drain which is displayed in the image**\n![RGB Wiring](pi_rgb_led_bb.png)\n\n## Differences from ESP8266 module\n* Missing flash effect\n* Colorfade can receive transition time\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdepuits%2Fpi-mqtt-led","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdepuits%2Fpi-mqtt-led","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdepuits%2Fpi-mqtt-led/lists"}