Skip to content

Johboh/HomeAssistantEntities

Repository files navigation

HomeAssistantEntities

PlatformIO CI ESP-IDF CI Arduino IDE GitHub release Clang-format

Arduino (using Arduino IDE or PlatformIO) and ESP-IDF (using Espressif IoT Development Framework or PlatformIO) compatible library for providing sensors and actuators to Home Assistant using MQTT.

Home Assistant has a well defined way of defining sensors and actuators using MQTT. This library register a device with one or mulitple sensors and provide a way to publish new values for them, as well as listen for commands from Home Assistant.

Currently supported sensors*

  • Atmospheric Preassure (cbar, bar, hPa, mmHg, inHg, kPa, mbar, Pa, psi)
  • Boolean
  • Binary sensor (Generic sensor, with any supported device class using a device class from HaDeviceClasses.h)
  • Brightness (%)
  • Carbon Dioxide (ppm)
  • Current (a, mA)
  • Door (open/closed)
  • Humidity (%)
  • Json (raw "json"-sensor)
  • Lock (locked/unlocked)
  • Motion (detected/not detected)
  • Number (with any unit and device class)
  • Particulate matter (μg/m³)
  • Power (mW, W, kW, MW, GW, TW)
  • Sound (detected/not detected)
  • String (raw "String"-sensor)
  • Temperature (°C, °F, K)
  • Timestamp
  • Text
  • Unit Concentration (parts per volume)
  • Volatile organic compounds (µg/m³, ppb)
  • Voltage (V = 1, mV, µV)
  • Weight (kg, g, mg, ug, oz, lb, st)
  • Sensor (Generic sensor, with any supported device class and unit of measurement using a device class from HaDeviceClasses.h)

Currently supported actuators (and sensors)*

  • Cover (open/opening, close/closing, position)
  • Button
  • Event
  • Fan
  • Light (brightness, color temperature, rgb, effect)
  • Select
  • Switch (on/off)

*If you can't find a sensor/actuator you need, either use the genric sensor, create a pull request to add one or raise an issue on GitHub and we'll add it to this library.

Installation

PlatformIO (Arduino or ESP-IDF):

Add the following to lib_deps:

   Johboh/HomeAssistantEntities@^8.0.17

You also need a MQTT library and a JSON library. See Dependencies section. Suggestion:

   johboh/MQTTRemote@^6.0.2
   bblanchon/ArduinoJson@^7.1.0

Arduino IDE

Search for HomeAssistantEntities by johboh in the library manager. You also need a MQTT library and a JSON library. See Dependencies section. Suggestion: MQTTRemote by johboh and ArduinoJson by bblanchon.

Espressif IoT Development Framework:

In your existing idf_component.yml or in a new idf_component.yml next to your main component:

dependencies:
  johboh/homeassistantentities:
    version: ">=8.0.17"

You also need a MQTT library. See Dependencies section. Suggestion:

  johboh/mqttremote:
    version: ">=6.0.2"

Examples

Functionallity verified on the following platforms and frameworks

Newer version most probably work too, but they have not been verified.

Dependencies

About

Arduino library for Home Assistant entities for MQTT

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages