{"id":20563396,"url":"https://github.com/pilotak/mqtt-relay","last_synced_at":"2025-04-14T14:42:41.801Z","repository":{"id":91903438,"uuid":"92958668","full_name":"pilotak/MQTT-relay","owner":"pilotak","description":"Universal MQTT wifi relay ","archived":false,"fork":false,"pushed_at":"2017-07-02T21:19:27.000Z","size":22,"stargazers_count":7,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T03:41:20.910Z","etag":null,"topics":["arduino","dht22","ds18b20","esp32","esp8266","home-automation","homeassistant","mqtt","relay-board","sonoff","temperature-sensor"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pilotak.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-05-31T15:07:49.000Z","updated_at":"2021-09-12T03:43:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"3dd7f894-f168-444c-a6e5-5959ebd913ce","html_url":"https://github.com/pilotak/MQTT-relay","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/pilotak%2FMQTT-relay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2FMQTT-relay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2FMQTT-relay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pilotak%2FMQTT-relay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pilotak","download_url":"https://codeload.github.com/pilotak/MQTT-relay/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248898630,"owners_count":21179806,"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":["arduino","dht22","ds18b20","esp32","esp8266","home-automation","homeassistant","mqtt","relay-board","sonoff","temperature-sensor"],"created_at":"2024-11-16T04:18:05.146Z","updated_at":"2025-04-14T14:42:41.796Z","avatar_url":"https://github.com/pilotak.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MQTT relay\nYet another custom code to control Sonoff and other custom relay boards built around ESP8266 and ESP32.\n\nThe main goals are:\n- Universal for Sonoff and other custom maed relay boards with ESP8266 and ESP32\n- All setting is in one file so you have one file for each device but with completely different behaviour\n- Button reading is interrupt based debounce, so you really don't miss a click even with delay used somewhere in code\n- Button has a short press and long press\n- You can define how many relays it has, also what is ON state wheter ```LOW``` or ```HIGH```\n- Different modes state LED indication\n- Remember last state during restart\n- Clearly MQTT controlled, ready to be controlled by Home Automation server, like [HomeAssistant](https://home-assistant.io/)\n\nIn order to compile, you need to install following library\n* PubSubClient (Imroy version) https://github.com/Imroy/pubsubclient\n\nBelow are examples of HomeAssistant configuration\n\n## Control relay\n```yaml\nswitch:\n  - platform: mqtt\n    name: \"sonoff_switch\"\n    command_topic: \"sonoff/relay0\"\n    state_topic: \"sonoff/relay0/state\"\n    payload_on: 'ON'\n    payload_off: 'OFF'\n    optimistic: false\n    qos: 1\n```\n\n## Temperature with couple of DS18B20\n```yaml\nsensor:\n  - platform: mqtt\n    state_topic: \"sonoff/temp0\"\n    name: \"Tepmerature 1\"\n    unit_of_measurement: \"°C\"\n  - platform: mqtt\n    state_topic: \"sonoff/temp1\"\n    name: \"Tepmerature 2\"\n    unit_of_measurement: \"°C\"\n```\n\n## Temperature and humidity with DHT22/DHT11\n```yaml\nsensor:\n  - platform: mqtt\n    state_topic: \"sonoff/temp\"\n    name: \"Tepmerature\"\n    unit_of_measurement: \"°C\"\n  - platform: mqtt\n    state_topic: \"sonoff/humidity\"\n    name: \"Humidity\"\n    unit_of_measurement: \"%\"\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilotak%2Fmqtt-relay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpilotak%2Fmqtt-relay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpilotak%2Fmqtt-relay/lists"}