MQTT2 in openHAB 2.4, Rollershutter / MAP

Hi,

can someone point me on the right direction how I would set up a MQTT thing in the new MQTT binding when having a Rollershutter item that used to work the following way:

Rollershutter Rollladen_EG_Kueche_Tuer "Rollladen KĆ¼chentĆ¼r [%d %%]" <rollershutter> (gRolllaedenKueche) {mqtt=">[mosquitto:shellies/shellyswitch-135267/roller/0/command:command:*:MAP(shellies.map)], <[mosquitto:shellies/shellyswitch-135267/roller/0/pos:state:default]"}

I canā€™t seem to find an example of how to use a map file in a new MQTT thing. If it matters at all, the shellies.map looks like this (only some of the entries are relevant for the rollershutter though):

OFF=off
ON=on
off=OFF
on=ON
UP=open
DOWN=close
STOP=stop
close=0
open=100
stop=? (0 or 100?) :) 
0=close
100=open

Thanks in advance.

I believe you can use the transformationPattern within the thing file for this.

Example

Type switch : RollerShutter "RollerShutter" [ stateTopic="tele/sonoff/SENSOR", transformationPattern="MAP:your.map"]

And I would actually use a Type switch? What about the position the device returns in the stateTopic?

I tried the following:

Thing mqtt:topic:shelly1_rollladen_kuechentuer_topics "Shelly 1 Rollladen KĆ¼chentĆ¼r" {
        Channels:
            Type switch : rollershutter [ stateTopic="shellies/shellyswitch-135267/roller/0/pos", commandTopic="shellies/shellyswitch-135267/roller/0/command", transformationPattern="MAP:shellies.map" ]
    }
Rollershutter Rollladen_EG_Kueche_Tuer "Rollladen KĆ¼chentĆ¼r [%d %%]" <rollershutter> (gRolllaedenKueche) { channel="mqtt:topic:shelly1_rollladen_kuechentuer_topics:rollershutter" }

I canā€™t control the shutters that way. Log says:

2018-12-27 19:01:56.740 [WARN ] [nal.handler.AbstractMQTTThingHandler] - Channel rollershutter not supported

Typo, sorry about that. It should be Rollershutter not switch.

Not sure on that part, Iā€™m still using the 1.x binding, but I can help search for an answer.

@sirpreis found something regarding Rollershutters and mqtt 2.4 that might interest you.

And this:

Looks like you may have to wait until after the holidays for some things to work properly.:expressionless:

Sorry I couldnā€™t help more.

2 Likes

Thank you very much, that helped! :slight_smile:

You can use a Number channel for a Rollershutter item
You can use a tranformation ONLY on the inbound topic
Transformation outbound are not yet supported

A workaround is to use the MQTT action
or stick with v1 for some items.
I have some items with v2 and others with v1 because of this

Ok, thanks. Guess we have to wait for the new binding to become more ā€œmatureā€.

From my point of view it seems a little ā€œprematureā€ to release something that canā€™t replace the old one. openHAB even disables the old binding when upgrading from 2.3 to 2.4, which makes it even more irritating.

Go to PaperUI and turn on legacy bindings. After that you should be able to install the old 1.x mqtt.

Yea, I did that, but I had to look for it. Unneccessary, from my point of view, to make it so complicated.

Yes, itā€™s a lesson learned for the next big upgrade. It has been acknowledged that this was a mistake and will be taken into account.

Just a question. On v1 i had a map that transformed 1 to ON and 0 to OFF. Can it be done on MQTT v2 if not how would i do that

1 Like