sirpreis
(Mario Preis)
December 27, 2018, 5:08pm
1
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.
H102
(CM6.5 H102)
December 27, 2018, 5:46pm
2
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"]
sirpreis
(Mario Preis)
December 27, 2018, 6:03pm
3
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
H102
(CM6.5 H102)
December 27, 2018, 6:06pm
4
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.
H102
(CM6.5 H102)
December 27, 2018, 6:19pm
5
@sirpreis found something regarding Rollershutters and mqtt 2.4 that might interest you.
eclipse-archived:master
← davidgraeff:mqttrollershutter
Why? UpDownType implements State, so updates are valid (and correspond to 0 and … 100).
And this:
A rollershutter is a percentage value for openHAB internally. Put aside that stop was wrongly implemented by me and a fix is on the way (after everybody returned from holidays), UP and DOWN will send the target percentage. This might not be clear from the docu (create an Issue if so).
If your shelly wants “stop”, “up” and “down” you should define a switch with those three commands instead. (Can only be done textual on item level unfortunately)
Looks like you may have to wait until after the holidays for some things to work properly.
Sorry I couldn’t help more.
2 Likes
sirpreis
(Mario Preis)
December 27, 2018, 6:29pm
6
Thank you very much, that helped!
vzorglub
(Vincent Regaud)
December 28, 2018, 12:08pm
7
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
sirpreis
(Mario Preis)
December 30, 2018, 11:14am
8
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.
H102
(CM6.5 H102)
December 30, 2018, 1:48pm
9
Go to PaperUI and turn on legacy bindings. After that you should be able to install the old 1.x mqtt.
sirpreis
(Mario Preis)
December 30, 2018, 1:53pm
10
Yea, I did that, but I had to look for it. Unneccessary, from my point of view, to make it so complicated.
vzorglub
(Vincent Regaud)
December 30, 2018, 5:32pm
11
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.
allen
(Allen)
March 29, 2019, 7:41am
12
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