openhab-addons/bundles/org.openhab.binding.mqtt.homie
Cody Cutrer 22b28bf674
[mqtt.generic] separate command parsing from cached value updating (#12238)
* [mqtt.generic] separate command parsing from cached value updating

fixes #12150

Previously, Value.update would parse the command, _and_ update the cached
value with that command. Which means that when sending a command towards
MQTT (instead of processing an update from MQTT), the cached value was
unintentionally updated. This prevented the REFRESH command from returning
the most recent value received from the device.

Separating the two concerns also makes the test more obvious what they are
testing, and vastly simplified a kludgy workaround that RollershutterValue
was using to be able to process Commands that aren't States.

Signed-off-by: Cody Cutrer <cody@cutrer.us>

* [mqtt.generic] split Value::parseCommand into parseMessage

so that a particular value type subclass can have varying implementations
if it desires

---------

Signed-off-by: Cody Cutrer <cody@cutrer.us>
2023-03-07 19:33:17 +01:00
..
src [mqtt.generic] separate command parsing from cached value updating (#12238) 2023-03-07 19:33:17 +01:00
NOTICE Fix links and NOTICE files (#9860) 2021-01-18 21:49:06 +01:00
pom.xml fix spotless after release (#14014) 2022-12-19 15:22:17 +01:00
README.md [Documentation] Markdown improvements f to m (#13866) 2022-12-08 21:36:05 +01: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