@David_Graeff First, thank you very much for taking on the much-requested OpenHab 2.x MQTT binding! That was really somthing that was missing terribly from OpenHab so far. I have to admit, I did not test the binding so far, because it seems it is not yet included in milestone builds… So everything I say here is deduced only from the documentation and this thread. Please correct me if I misunderstand anything.
Now, in my use cases (RFLink-to-mqtt bridge, zigbee2mqtt bridge, ESPEasy sensors & actuators) I have two issues:
- Several nodes do not send individual topics for its sensor value, but send one JSON-encoded array containing all information. E.g. topic /RFLink/sensors/Alecto V1/00bc
{"Family":"Alecto V1","ID":"00bc","TEMP":17.1,"HUM":67,"BAT":"OK"}
Currently, I’m using a OpenHab item like:
mqtt="<[mqtt:/RFLink/sensors/Alecto V1/00bc:state:JS(MQTT_BatteryState.js)]"
mqtt="<[mqtt:/RFLink/sensors/Alecto V1/00bc:state:JSONPATH($.TEMP)]"
If I understand the documentation correctly, this is not possible with your new mqtt binding?
- Some of the devices connected via MQTT provide commands that allow switching devices on/off. There is typically a dedicated mqtt topic for each device whereyou can send your commands to. E.g. my ESPEasy-based humidifier:
Switch Venta_Power "Venta LW45 Ein/Aus" <power> (power) { mqtt="<[mqtt:/Venta/Venta/cmd:command:ON:ventapower 1], >[mqtt:/Venta/Venta/cmd:command:OFF:ventapower 0], <[mqtt:/Venta/Venta/Power:state:MAP(OnOffBinary.map)]" }
Number Venta_Level "Venta LW45 Level" <power> (power) { mqtt=">[mqtt:/Venta/Venta/cmd:command:*:ventalevel ${command}], <[mqtt:/Venta/Venta/Level:state:default]" }
Of my Sonoff S20 plug (running tasmota):
Switch Power_SonoffS20 "Strom Sonoff S20" <poweroutlet> (power)
{ mqtt=">[mqtt:/sensors/sonoff/s20/cmnd/POWER:command:*:default],
<[mqtt:/sensors/sonoff/s20/stat/POWER:state:default]" }
It would be great if the mqtt binding could also support those actions of the old mqtt binding.