Rollershutter MQTT

Hi,

i have a WiFi Rollershutter and would include it via MQTT

This is the doc of the RollerShutter

### MQTT in Roller mode

When configured to operate in roller mode, MQTT topics used by Shelly Switch are:

* `shellies/shellyswitch-<deviceid>/roller/0`  reports the current state:  `open` ,  `close`  while in motion,  `stop`  when not moving.
* `shellies/shellyswitch-<deviceid>/roller/0/command`  accepts  `open` ,  `close`  and  `stop` .

I’m too stupid to put it on properly. maybe someone can help me :)?

shellies/shellyswitch-32B62F/roller/0 -> gets the actual State
shellies/shellyswitch-32B62F/roller/0/command:open -> open the shutter
shellies/shellyswitch-32B62F/roller/0/command:close -> close the shutter
shellies/shellyswitch-32B62F/roller/0/command:stop -> stop the shutter

See:

Thanks for the link. I know the MQTT-Tutorial. I have problems to create the rollershutter item. I dont knwo the correct mqtt line.

{mqtt=">[mqttBroker:shellies/shellyswitch/roller/0:command:*:default]", autoupdate="false"}

This wont work.

What shelly model do you have and refer to:
http://shelly-api-docs.shelly.cloud/#mqtt-support

You forgot the shelly id in the mqtt topic
You will need a String item to send the tree commands and possibly a transformation

String ShellyRollerShutter { mqtt=">[mqttBroker:shellies/shellyswitch-32B62F/roller/0/command:command:*:default],<[mqttBroker:shellies/shellyswitch-32B62F/roller/0:state:default]"

I have the Shelly Switch. In mqttLens i saw that the item should work. but it sends the false commands.

I receive UP, DOWN, STOP instead of open, close and stop.

Use a MAP transform

Create a file in the transform folder called shelly.map
with the following content:

UP=open
DOWN=close
STOP=stop

Change the item to:

Rollershutter ShellyRollerShutter { mqtt=">[mqttBroker:shellies/shellyswitch-32B62F/roller/0/command:command:*:MAP(shelly.map)],<[mqttBroker:shellies/shellyswitch-32B62F/roller/0:state:default]"

Thanks for your fast help.
I have found the problem by myself.

With this item i have no problems:

Rollershutter Wohnzimmer_Rolladen_Tuer “Wohnzimmertür” (gWohnzimmer) {mqtt=">[mqttBroker:shellies/shellyswitch-32B62F/roller/0/command:command:*:MAP(shelly.map)]"}

But if i use the hardwarebuttons i dont get the status in openhab.

that’s because your MQTT item has only an outbound configuration (only sends stuff to MQTT)
To be able to get updates from the device, you need to add an inbound conf also that subscribes to a topic that is updated from the endpoint

Se Vincent’s recommendation above (part with < sign)

If i use this part, i dont get the status… i dont know why…

<[mqttBroker:shellies/shellyswitch-32B62F/roller/0:state:MAP(shelly.map)]

This is the logmessage:

2018-11-05 20:58:57.087 [WARN ] [b.core.events.EventPublisherDelegate] - given new state is NULL, couldn't post update for 'Wohnzimmer_Rolladen_Tuer'

Every few seconds

what is the message payload that the endpoint is publishing to the status topic? (check with your mqttLens)

i dont know which information do you need.

Is it enough?

since the endpoint is not reporting a percent status, you won’t be able to get the proper status in OH2 (using a Rollershutter Item)

It seems that the 3 possible status messages that it reports are: OPEN, CLOSE, STOP

You could get them into a String item but they would be (nearly) useless also…

I would stick with what Vincent proposed (without a state):

Rollershutter Wohnzimmer_Rolladen_Tuer "Wohnzimmertür" (gWohnzimmer) {mqtt=">[mqttBroker:shellies/shellyswitch-32B62F/roller/0/command:command:*:MAP(shelly.map)]"}

and then wait for tasmota to publish a newer version that reports properly the state of the Roller Shutter Mode for Shelly 2 :slight_smile:

Next firmware will report the % State.
Via HTTP i get the last direction now.

// http://192.168.178.73/roller/0

{
  "state": "stop",
  "power": 0.00,
  "is_valid": true,
  "safety_switch": false,
  "stop_reason": "normal",
  "last_direction": "close"
}

next f/w from Shelly or Tasmota?
this is good news!

Next official shelly2 firmware. according to the plan, the new firmware will be released this month

well then you will need to wait till then to get a proper status in an OH2 Rollershutter item
The state of a Rollershutter Item is a number (0-100) so you can’t use any of the existing info that is being reported.

can i map close to 0 and open to 100?

sure you can. use the same map file as above and add these 2 mappings

close=0
open=100

but you will still get an error when the device will publish a stop message (which will be the most common/often one). Workaround this by adding yet another map :slight_smile:

close=0
open=100
stop=? (0 or 100?) :) 
1 Like