openhab-addons/bundles/org.openhab.binding.mqtt.homie
Cody Cutrer 923fb12b7d
[mqtt.homie] handle exceptions parsing attributes (#12254)
fixes #10711

technically this code is in mqtt.generic, but it's only used by Homie.

in particular, if an incoming string doesn't match an enum, this will now
just ignore the value instead of raising an exception to be caught somewhere inside
of Hive MQTT, and eventually timing out and logging that mandatory topics weren't
received, instead of logging a pointer to the actual problem. this makes it so that
if there's a homie $datatype openhab doesn't understand (like duration), it will be
able to get to the point of just choosing a string channel

also did some minor debug logging cleanup for mqtt:
 * fixed a typo
 * when logging homie device name from the thing handler, use the config deviceid,
   since we likely don't have the attributes from MQTT yet

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2022-02-23 13:38:00 +01:00
..
src [mqtt.homie] handle exceptions parsing attributes (#12254) 2022-02-23 13:38:00 +01:00
NOTICE Fix links and NOTICE files (#9860) 2021-01-18 21:49:06 +01:00
pom.xml pom update from http to https reference (#11833) 2021-12-23 19:40:44 +01:00
README.md added migrated 2.x add-ons 2020-09-21 03:37:19 +02:00

MQTT Homie Binding

NOTE: This binding is provided by the MQTT binding, and therefore no explicit installation is necessary beyond installing the MQTT binding.

Devices that follow the Homie convention 3.x and better are auto-discovered and represented by this binding and the Homie Thing.

Find the next table to understand the topology mapping from Homie to the Framework:

Homie Framework Example MQTT topic
Device Thing homie/super-car
Node Channel Group homie/super-car/engine
Property Channel homie/super-car/engine/temperature

System trigger channels are supported using non-retained properties, with enum data type and with the following formats:

  • Format: "PRESSED,RELEASED" -> system.rawbutton
  • Format: "SHORT_PRESSED,DOUBLE_PRESSED,LONG_PRESSED" -> system.button
  • Format: "DIR1_PRESSED,DIR1_RELEASED,DIR2_PRESSED,DIR2_RELEASED" -> system.rawrocker