{"id":16565268,"url":"https://github.com/domochip/megamqtt","last_synced_at":"2026-06-19T08:32:46.319Z","repository":{"id":106358326,"uuid":"179666201","full_name":"Domochip/MegaMQTT","owner":"Domochip","description":"Use an Arduino Mega through MQTT protocol to control your Home","archived":false,"fork":false,"pushed_at":"2019-12-30T13:51:40.000Z","size":223,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-08T00:45:45.676Z","etag":null,"topics":["mega","mqtt"],"latest_commit_sha":null,"homepage":"","language":"C++","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/Domochip.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":"2019-04-05T11:02:13.000Z","updated_at":"2019-12-30T13:51:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"791ff160-5016-4f1a-819f-dbbe0d4f272c","html_url":"https://github.com/Domochip/MegaMQTT","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Domochip/MegaMQTT","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domochip%2FMegaMQTT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domochip%2FMegaMQTT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domochip%2FMegaMQTT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domochip%2FMegaMQTT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Domochip","download_url":"https://codeload.github.com/Domochip/MegaMQTT/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domochip%2FMegaMQTT/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34523982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["mega","mqtt"],"created_at":"2024-10-11T20:46:38.851Z","updated_at":"2026-06-19T08:32:46.304Z","avatar_url":"https://github.com/Domochip.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MegaMQTT\n\nUse an Arduino Mega + Ethernet HAT to make Home Automation through MQTT  \nYou can automate : \n- Lights\n- Roller Shutter\n- Velux Roller Shutter\n- Temperature sensor (DS18B20)\n- PilotWire (French standard to \"pilot\" electric heater)\n- Single relay\n\n## What do you need ?\n\n### Hardware\n\n - An Arduino Mega 2560 ![Mega 2560](https://raw.github.com/Domochip/MegaMQTT/master/img/mega.jpg)\n - An Ethernet HAT (W5100) ![Ethernet HAT](https://raw.github.com/Domochip/MegaMQTT/master/img/W5100%20hat.jpg)\n - Some Relay boards for 110/220V ![Ethernet HAT](https://raw.github.com/Domochip/MegaMQTT/master/img/relay%20board.jpg)\n - (Power)\n - (Ethernet cable)\n\n### Software\n\n - Visual Studio Code\n - PlatformIO\n\n## Make It\n\nPlug Ethernet Hat on your Mega, power it and flash this sketch using VSCode/PlatformIO.\n\nFirst start is configured to use DHCP (or fallback to `192.168.1.177` if DHCP communication failed)\n\nHave a look at Serial output of your Mega and go to default webpage using IP\n\n## Set it up\n\nTo configure your system, you need to provide it a configuration JSON file like this example : \n\n```json\n{\n    \"System\": {\n        \"name\": \"MegaMQTT1\",\n        \"ip\": \"192.168.1.176\"\n    },\n    \"MQTT\": {\n        \"hostname\": \"192.168.1.19\",\n        \"port\": 1883,\n        \"username\": \"\",\n        \"password\": \"\",\n        \"baseTopic\": \"MegaMQTT\"\n    },\n    \"HADevices\": [\n        {\n            \"type\": \"RollerShutter\",\n            \"id\": \"VR0\",\n            \"pins\": [22,23,24,25],\n            \"travelTime\": 30,\n            \"invert\": true\n        },\n        {\n            \"type\": \"RollerShutter\",\n            \"id\": \"VR1\",\n            \"pins\": [26,27,28,29],\n            \"travelTime\": 35,\n            \"velux\": true\n        },\n        {\n            \"type\": \"Light\",\n            \"id\": \"L0\",\n            \"pins\": [2,11],\n            \"pushbutton\": false\n        },\n        {\n            \"type\": \"DS18B20Bus\",\n            \"id\": \"DSB0\",\n            \"pin\": 3\n        },\n        {\n            \"type\": \"PilotWire\",\n            \"id\": \"PW0\",\n            \"pins\": [30,31]\n        },\n        {\n            \"type\": \"DigitalOut\",\n            \"id\": \"D0\",\n            \"pin\": 13\n        }\n    ]\n}\n```\n\n## System\n\n|ID|Type/Size|Description|\n|--|--|--|\n|name|16 char|name of the mega to identify it only|\n|ip|Text|(optional) fix IP configuration (DHCP if empty or non existent)|\n\n## MQTT\n\n|ID|Type/Size|Description|\n|--|--|--|\n|hostname|32 char|ip or dns name of the MQTT broker|\n|port|integer|TCP port of the MQTT server (standard default is 1883)|\n|username|integer|(optional) MQTT username if required by broker|\n|password|integer|(optional) MQTT password if required by broker|\n|baseTopic|16 char|prefix used in all MQTT subscribe/publish|\n\n## HADevices\n\nHADevices are \"logical devices\" like a Roller Shutter or a Light\n\nYou can configure multiple devices of each type in the configuration JSON.\n\n### Light\n\nJSON requirements :  \n\n|ID|Type/Size|Description|\n|--|--|--|\n|type|fixed value|Light|\n|id|16 char|unique identifier of this HADevice|\n|pins|2 integers|array of pin numbers : [button,Light relay]|\n|pushbutton|boolean|(optional) true for push button (button with spring)|\n|invert|boolean|(optional) true to invert output|\n\nMQTT publication :  \n\n|topic|data|Description|\n|--|--|--|\n|{MQTT BaseTopic}/{HADevice ID}/state|0 \\| 1|0 : light is off ; 1 : light is on|\n\nMQTT subscribtion :  \n\n|topic|data|Description|\n|--|--|--|\n|{MQTT BaseTopic}/{HADevice ID}/command|0 \\| 1 \\| t|0 : power off light ; 1 : power on light ; toggle light|\n\n### RollerShutter\n\nJSON requirements :  \n\n|ID|Type/Size|Description|\n|--|--|--|\n|type|fixed value|RollerShutter|\n|id|16 char|unique identifier of this HADevice|\n|velux|boolean|(optional) true for Velux SSL or SML RollerShutter|\n|pins|4 integers|array of pin numbers : [buttonUp,buttonDown,Direction relay,Power relay]\u003cbr\u003e(velux type : [buttonUp,buttonDown,Roller Up relay,Roller Down relay])|\n|travelTime|integer|time in seconds for your Shutter to open completely|\n|invert|boolean|(optional) true to invert output|\n\nMQTT publication :  \n\n|topic|data|Description|\n|--|--|--|\n|{MQTT BaseTopic}/{HADevice ID}/state|0-\u003e100| position of the roller shutter (%)|\n\nMQTT subscribtion :  \n\n|topic|data|Description|\n|--|--|--|\n|{MQTT BaseTopic}/{HADevice ID}/command|0-\u003e100|Move the Roller Shutter to the desired position (%)|\n\nTODO : electric diagrams for normal and velux Roller Shutter\n\n### DS18B20Bus\n\nJSON requirements :  \n\n|ID|Type/Size|Description|\n|--|--|--|\n|type|fixed value|Light|\n|id|16 char|unique identifier of this HADevice|\n|pin|1 integer|pin number of the OneWire bus|\n\nMQTT publication :  \n\n|topic|data|Description|\n|--|--|--|\n|{MQTT BaseTopic}/temperatures/{ROMCode}/temperature|-55.00-\u003e125.00|temperature (°C)|\n\nIf multiple sensors are on the Bus, all temperatures are published.  \n\n### PilotWire\n\nJSON requirements :  \n\n|ID|Type/Size|Description|\n|--|--|--|\n|type|fixed value|Light|\n|id|16 char|unique identifier of this HADevice|\n|pins|2 integers|array of pin numbers : [Positive relay,Negative relay]|\n|invert|boolean|(optional) true to invert output|\n\nMQTT publication :  \n\n|topic|data|Description|\n|--|--|--|\n|{MQTT BaseTopic}/{HADevice ID}/state|0-\u003e99|current Order value (0-10 : Arrêt ; 11-20 : Hors Gel ; 21-50 : Eco ; 51-99 : Confor)|\n\nMQTT subscribtion :  \n\n|topic|data|Description|\n|--|--|--|\n|{MQTT BaseTopic}/{HADevice ID}/command|0-\u003e99|requested PiloteWire Order (0-10 : Arrêt ; 11-20 : Hors Gel ; 21-50 : Eco ; 51-99 : Confor)|\n\n### DigitalOut\n\nJSON requirements :  \n\n|ID|Type/Size|Description|\n|--|--|--|\n|type|fixed value|Light|\n|id|16 char|unique identifier of this HADevice|\n|pin|1 integer|pin number of the output to control|\n|invert|boolean|(optional) true to invert output|\n\nMQTT publication :  \n\n|topic|data|Description|\n|--|--|--|\n|{MQTT BaseTopic}/{HADevice ID}/state|0 \\| 1|0 : output is off ; 1 : output is on|\n\nMQTT subscribtion :  \n\n|topic|data|Description|\n|--|--|--|\n|{MQTT BaseTopic}/{HADevice ID}/command|0 \\| 1|0 : power off output ; 1 : power on output|","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomochip%2Fmegamqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdomochip%2Fmegamqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomochip%2Fmegamqtt/lists"}