{"id":19973060,"url":"https://github.com/l1zle/shelly-thingspeak-bridge","last_synced_at":"2026-04-29T14:35:55.147Z","repository":{"id":230385107,"uuid":"776088149","full_name":"L1ZLe/Shelly-Thingspeak-Bridge","owner":"L1ZLe","description":"This JavaScript code establishes a connection between two MQTT brokers, one hosted by ThingSpeak and another by Shelly Plug S Plug S. It subscribes to specific topics on the Shelly Plug S broker to receive power and temperature data, then upon receiving both values, it publishes the data to the ThingSpeak broker for further processing.","archived":false,"fork":false,"pushed_at":"2024-03-22T16:57:22.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T09:30:07.438Z","etag":null,"topics":["internet-of-things","iot","mqtt","shelly","shelly-plugs","thingspeak"],"latest_commit_sha":null,"homepage":"https://thingspeak.com/channels/2481106","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/L1ZLe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-03-22T16:53:07.000Z","updated_at":"2024-04-25T19:44:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"08d158e0-b9e1-49c9-935f-3a070f18bfe1","html_url":"https://github.com/L1ZLe/Shelly-Thingspeak-Bridge","commit_stats":null,"previous_names":["l1zle/shelly-thingspeak-bridge"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L1ZLe%2FShelly-Thingspeak-Bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L1ZLe%2FShelly-Thingspeak-Bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L1ZLe%2FShelly-Thingspeak-Bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L1ZLe%2FShelly-Thingspeak-Bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/L1ZLe","download_url":"https://codeload.github.com/L1ZLe/Shelly-Thingspeak-Bridge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241405870,"owners_count":19957918,"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":["internet-of-things","iot","mqtt","shelly","shelly-plugs","thingspeak"],"created_at":"2024-11-13T03:10:10.054Z","updated_at":"2026-04-29T14:35:50.108Z","avatar_url":"https://github.com/L1ZLe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MQTT Bridge between ThingSpeak and Shelly Plug S\n\n## Description\n\nThis JavaScript code establishes a connection between two MQTT brokers, one hosted by ThingSpeak and another by Shelly Plug S Plug S. It subscribes to specific topics on the Shelly Plug S broker to receive power and temperature data, then upon receiving both values, it publishes the data to the ThingSpeak broker for further processing.\n\n## Installation\n\n1. Clone the repository or download the JavaScript file.\n2. Ensure you have Node.js installed on your system.\n3. Install the MQTT module using npm:\n   ```\n   npm install mqtt\n   ```\n\n## Usage\n\n1. Install and run Mosquitto MQTT broker:\n\n   - Download and install Mosquitto from [https://mosquitto.org/download/](https://mosquitto.org/download/).\n   - Start Mosquitto using the command (run as administrator):\n     ```\n     net start mosquitto\n     ```\n\n2. Configure the MQTT options for both ThingSpeak and Shelly Plug S brokers in the code.\n3. Run the JavaScript file:\n   ```\n   node bridge.js\n   ```\n\n## How it Works\n\n1. **Initialization**: The code first imports the MQTT module and defines MQTT options for both ThingSpeak and Shelly Plug S brokers.\n2. **Connection Setup**: It establishes connections to both brokers using the specified options.\n3. **Subscription**: The code subscribes to specific topics on the Shelly Plug S broker to receive power and temperature data.\n4. **Message Handling**: When messages are received from the Shelly Plug S broker, it extracts the data, stores it, and publishes it to the ThingSpeak broker when both power and temperature values are received.\n5. **Error Handling**: The code handles any connection errors that may occur.\n\n## Connecting Shelly Plug S to MQTT using MQTT.fx (Optional)\n\nTo connect Shelly Plug S devices to an MQTT broker using MQTT.fx (you can also use mosquitto as an alternative), follow these steps for MQTT.fx:\n\n1. **Install MQTT.fx**: Download and install MQTT.fx on your laptop from [https://www.softblade.de](https://www.softblade.de).\n2. **Configure MQTT Broker**: Open MQTT.fx and go to the \"Settings\" tab. Enter your IP address as the server address (we will use your laptop's IP address as an example), select the port (1883).\n3. **Connect Device and Laptop**: Ensure both your Shelly Plug S device and laptop are connected to the same network.\n4. **Access Shelly Plug S Device**: Log in to the Shelly Plug S device's web interface.\n5. **Navigate to MQTT Settings**: In the settings menu, find the MQTT settings section.\n6. **Configure MQTT Settings**: Enter the MQTT broker's IP address and port(your_laptop's_IP:1883). You dont need to enter the username and password.\n7. **Topic Configuration**: Back to MQTT.fx to define topics to subscribe to.\n8. **Save Settings**: Apply the changes and save the MQTT settings on both MQTT.fx and the Shelly Plug S device.\n\n## Support\n\nFor help, please open an issue on the GitHub repository or contact [oundel.store@gmail.com](mailto:oundel.store@gmail.com).\n\n## Authors and Acknowledgment\n\nThis code was written by Sami EL Yaagoubi.\n\n## License\n\nThis project is licensed under the [MIT License](https://opensource.org/licenses/MIT).\n\n## Project Status\n\nDevelopment for this project is currently active.\n\nFeel free to contribute to the project by opening pull requests or issues.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl1zle%2Fshelly-thingspeak-bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fl1zle%2Fshelly-thingspeak-bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fl1zle%2Fshelly-thingspeak-bridge/lists"}