https://github.com/lbuque/micropython-home-assistant
Home Assistant MQTT integration for MicroPython
https://github.com/lbuque/micropython-home-assistant
esp32 home-assistant micropython mqtt
Last synced: about 1 year ago
JSON representation
Home Assistant MQTT integration for MicroPython
- Host: GitHub
- URL: https://github.com/lbuque/micropython-home-assistant
- Owner: lbuque
- License: mit
- Created: 2024-04-14T07:07:38.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2025-02-19T16:29:50.000Z (over 1 year ago)
- Last Synced: 2025-03-19T18:51:18.328Z (over 1 year ago)
- Topics: esp32, home-assistant, micropython, mqtt
- Language: Python
- Homepage:
- Size: 187 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MicroPython Home Assistant integration 🏠
MHA allows to integrate an Micropython based device with Home Assistant using MQTT.
## Features
* Two-way communication (state reporting and command execution)
* MQTT discovery (device is added to the Home Assistant panel automatically)
* MQTT Last Will and Testament
* Support for custom MQTT messages (publishing and subscribing)
* Auto reconnect with MQTT broker
* Reporting availability (online/offline states) of a device
## Supported HA types
| Home Assistant type | Supported |
| ----------------------- | :--------: |
| [Alarm control panel][] | ❌ |
| [Binary sensor][] | ✅ |
| [Button][] | ❌ |
| [Camera][] | ❌ |
| [Cover][] | ❌ |
| [Device tracker][] | ❌ |
| [Device trigger][] | ❌ |
| [Event][] | ❌ |
| [Fan][] | ❌ |
| [Humidifier][] | ❌ |
| [Image][] | ❌ |
| [HVAC][] | ❌ |
| [Lawn mower][] | ❌ |
| [Light][] | ❌ |
| [Lock][] | ❌ |
| [Number][] | ❌ |
| [Scene][] | ❌ |
| [Select][] | ❌ |
| [Sensor][] | ❌ |
| [Siren][] | ❌ |
| [Switch][] | ✅ |
| [Update][] | ❌ |
| [Tag scanner][] | ❌ |
| [Text][] | ❌ |
| [Vacuum][] | ❌ |
| [Valve][] | ❌ |
| [Water heater][] | ❌ |
[Alarm control panel]: https://www.home-assistant.io/integrations/alarm_control_panel.mqtt/
[Binary sensor]: https://www.home-assistant.io/integrations/binary_sensor.mqtt/
[Button]: https://www.home-assistant.io/integrations/button.mqtt/
[Camera]: https://www.home-assistant.io/integrations/camera.mqtt/
[Cover]: https://www.home-assistant.io/integrations/cover.mqtt/
[Device tracker]: https://www.home-assistant.io/integrations/device_tracker.mqtt/
[Device trigger]: https://www.home-assistant.io/integrations/device_trigger.mqtt/
[Event]: https://www.home-assistant.io/integrations/event.mqtt/
[Fan]: https://www.home-assistant.io/integrations/fan.mqtt/
[Humidifier]: https://www.home-assistant.io/integrations/humidifier.mqtt/
[Image]: https://www.home-assistant.io/integrations/image.mqtt/
[HVAC]: https://www.home-assistant.io/integrations/climate.mqtt/
[Lawn mower]: https://www.home-assistant.io/integrations/lawn_mower.mqtt/
[Light]: https://www.home-assistant.io/integrations/light.mqtt/
[Lock]: https://www.home-assistant.io/integrations/lock.mqtt/
[Number]: https://www.home-assistant.io/integrations/number.mqtt/
[Scene]: https://www.home-assistant.io/integrations/scene.mqtt/
[Select]: https://www.home-assistant.io/integrations/select.mqtt/
[Sensor]: https://www.home-assistant.io/integrations/sensor.mqtt/
[Siren]: https://www.home-assistant.io/integrations/siren.mqtt/
[Switch]: https://www.home-assistant.io/integrations/switch.mqtt/
[Update]: https://www.home-assistant.io/integrations/update.mqtt/
[Tag scanner]: https://www.home-assistant.io/integrations/tag.mqtt/
[Text]: https://www.home-assistant.io/integrations/text.mqtt/
[Vacuum]: https://www.home-assistant.io/integrations/vacuum.mqtt/
[Valve]: https://www.home-assistant.io/integrations/valve.mqtt/
[Water heater]: https://www.home-assistant.io/integrations/water_heater.mqtt/
## Examples
| Example | Description |
| ------------------------------------------ | ------------------------------------------------- |
| [Binary sensor](examples/binary_sensor.py) | Using the binary sensor as a door contact sensor. |
| [Switch](examples/switch.py) | The LED that's controlled by the Home Assistant. |
## Compatible platform
Here is the list of platform on which the library was tested:
- Micropython
- Python3
## Donate
If you think this project is helpful to you, you can donate to us to encourage the project to continue to develop and become more complete.
- PayPal
[](https://paypal.me/lbuque?country.x=C2&locale.x=zh_XC)
- WeChat

- Alipay
