{"id":13801728,"url":"https://github.com/microhomie/microhomie","last_synced_at":"2025-08-21T19:24:32.668Z","repository":{"id":215170570,"uuid":"114628599","full_name":"microhomie/microhomie","owner":"microhomie","description":"MicroPython implementation of the Homie MQTT convention for IoT.","archived":false,"fork":false,"pushed_at":"2021-01-18T13:33:28.000Z","size":982,"stargazers_count":79,"open_issues_count":3,"forks_count":19,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-04-22T12:33:05.041Z","etag":null,"topics":["conventions","esp32","esp8266","framework","home-automation","homie","iot","micropython","mqtt"],"latest_commit_sha":null,"homepage":"https://www.microhomie.com/en/master/","language":"Python","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/microhomie.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","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-18T10:38:23.000Z","updated_at":"2024-08-04T00:06:33.847Z","dependencies_parsed_at":null,"dependency_job_id":"581265ba-b376-49e9-bd83-0570f6475273","html_url":"https://github.com/microhomie/microhomie","commit_stats":null,"previous_names":["microhomie/microhomie"],"tags_count":34,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microhomie%2Fmicrohomie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microhomie%2Fmicrohomie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microhomie%2Fmicrohomie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microhomie%2Fmicrohomie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microhomie","download_url":"https://codeload.github.com/microhomie/microhomie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251734546,"owners_count":21635155,"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":["conventions","esp32","esp8266","framework","home-automation","homie","iot","micropython","mqtt"],"created_at":"2024-08-04T00:01:26.463Z","updated_at":"2025-04-30T15:50:36.827Z","avatar_url":"https://github.com/microhomie.png","language":"Python","funding_links":[],"categories":["Libraries"],"sub_categories":["Communications"],"readme":"==========\nMicrohomie\n==========\n\n|build-status|\n\nMicrohomie is a MicroPython framework for `Homie \u003chttps://github.com/homieiot/convention\u003e`_, a lightweight MQTT convention for the IoT. Main target for Microhomie is the ESP8266 device and has been well tested and used on ESP32.\n\nMicrohomie v3 implements `Homie v4.0.0 \u003chttps://github.com/homieiot/convention/releases/tag/v4.0.0\u003e`_.\n\nRead the `Microhomie documentation \u003chttps://microhomie.readthedocs.io\u003e`_ to get started.\n\nLearn from our examples until we have a \"howto build nodes\" section in the documentation or join the #microhomie channel on the `MicroPython Slack community \u003chttps://slack-micropython.herokuapp.com/\u003e`_ and chat with us.\n\nBinaries can be verified with `minisign \u003chttps://jedisct1.github.io/minisign/\u003e`_ and the following public key:\n\n.. code-block::\n\n    RWTwPeRvouNzP+mcL1t7QDTnKz96i3Kuf95fjpE28szMq8OTycMmiTzX\n\n\nUpdate from v2\n--------------\n\nMicrohomie v3 has some breaking changes you should be aware of before update.\n\n* Microhomie v3 only supports the new LFS2 filesystem. For update you must erase and reflash your device.\n* You may need to update your asyncio coroutines as of the new Micropython asyncio v3. Peter Hinch's has a great `asyncio v3 update guide \u003chttps://github.com/peterhinch/micropython-async/blob/master/v3/README.md\u003e`_\n* New asyncio V3 primitives from Peter Hinch `micropython-async \u003chttps://github.com/peterhinch/micropython-async\u003e`_ for switch and pushbutton.\n* The ``utils`` module was refactored to ``homie.network``.\n\n\nMicroPython changes\n-------------------\n\n* **btree** and vfat support disabled to save some space\n* AccessPoint SSID changed to `Microhomie-MAC` with the secret `microhomiE`\n* inisetup.py writes a custom boot.py\n\n\nInstall\n-------\n\nDownload the `latest image \u003chttps://github.com/microhomie/microhomie/releases\u003e`_ and flash it like any MicroPython image to your ESP8266 device. I.E:\n\n.. code-block:: shell\n\n    esptool --port PORT --baud 460800 write_flash --flash_size=detect --verify -fm dio 0x0 microhomie-esp8266-VERSION.bin\n\nMake your changes in ``settings.example.py`` and copy this file as ``settings.py`` to your device. You can now test our example nodes from ``examples/``, just copy the ``main.py`` to your device. Start with the ``examples/led`` node to turn on and off the on-board LED.\n\n\nExample\n-------\n\nThis is a basic example to power the on-board LED from an ESP8266 development board:\n\n.. code-block:: python\n\n    import settings\n\n    from machine import Pin\n\n    from homie.node import HomieNode\n    from homie.device import HomieDevice\n    from homie.property import HomieProperty\n    from homie.constants import BOOLEAN, FALSE, TRUE\n\n\n    # Reversed values map for the esp8266 boards on-board LED\n    ONOFF = {FALSE: 1, TRUE: 0}\n\n\n    # Initialize the pin for the onboard LED\n    LED = Pin(2, Pin.OUT, value=1)\n\n\n    # The on_message handler to power the led\n    def toggle_led(topic, payload, retained):\n        LED(ONOFF[payload])\n\n\n    def main():\n        # Initialize the Homie device\n        device = HomieDevice(settings)\n\n        # Initialize the Homie node for the on-board LED\n        led_node = HomieNode(id=\"led\", name=\"On-board LED\", type=\"LED\",)\n\n        # Initialize the Homie property to power on/off the led\n        led_power = HomieProperty(\n            id=\"power\",\n            name=\"Power\",\n            settable=True,\n            datatype=BOOLEAN,\n            default=FALSE,\n            on_message=toggle_led,\n        )\n\n        # Add the power property to the node\n        led_node.add_property(led_power)\n\n        # Add the led node to the device\n        device.add_node(led_node)\n\n        # Run\n        device.run_forever()\n\n\n    if __name__ == \"__main__\":\n        main()\n\n\n\nBuild esp8266 image\n-------------------\n\nTo build your own Microhomie image for the ESP8266 device, run:\n\n\n.. code-block:: shell\n\n    make bootstrap\n    make\n    make deploy PORT=/dev/ttyUSBX\n\n\nKnown issues\n------------\n\n* No SSL support for now\n\n\n.. |build-status| image:: https://readthedocs.org/projects/microhomie/badge/?version=master\n    :target: http://microhomie.readthedocs.io/en/master/?badge=master\n    :alt: Documentation Status\n\n\nIncluded libraries\n------------------\n\n* `mqtt_as.py \u003chttps://github.com/peterhinch/micropython-mqtt\u003e`_ by Peter Hinch but we use the `patched version \u003chttps://github.com/kevinkk525/micropython-mqtt\u003e`_ from Kevin Köck. Kevins version has support for a keyword based configuration and unsubscribe.\n* asyncio V3 primitives from Peter Hinch `micropython-async \u003chttps://github.com/peterhinch/micropython-async/tree/master/v3\u003e`_ repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrohomie%2Fmicrohomie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrohomie%2Fmicrohomie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrohomie%2Fmicrohomie/lists"}