[SOLVED] Rollershutter

Hello everybody, I’m David from Spain, and I am a begginner in OH2. I have added some Xioami things in my system, but now I am trying to add a Sonoff dual with Tasmota for the roller shutters and I have problems with the Things and Items. I putted Tasmota on my sonoff Dual, but I’m not sure how to put the Things and Items to control it. Any good person can help me please? I need to say that I checked the documentation before and other examples, but this is not an are that I control.

Thanks in advance and sorry for my English.

Hi and welcome,
Go to your paperui and add MQTT broker via Addons, if you already have one go to Configuration -> Things “+” and click MQTT Binding and if they are not autodiscovered (which default tasmota is not) click “ADD MANUALLY” -> Generic MQTT Thing select your broker and save it.
Then go to
Configuration -> Things and locate your newly created Thing, click on it and add channels you have, like type switch, configure topic which tasmota is using and command topic as well.
Save it
then click on newly created channel and click on blue dot, which will offer you an option to link it to an Item or create new one.

Name of that Item you then use in your sitemap file which you have to edit in some kind of editor on your OH server located in /conf/sitemaps/default.sitemap (you have to create new file there)

or you can do it completely in files if you like

/things/mqttbroker.things

Bridge mqtt:broker:home "Mosquitto MQTT Broker" [ 
  host="IP",
  secure=false,
  port=1883,
  qos=0,
  retain=false,
  clientid="random",
  keep_alive_time=30000,
  reconnect_time=60000,
  username="",
  password=""
]

/things/tasmota.things

Thing mqtt:topic:WallSwitchWorkroom "WallSwitch Light Workroom" (mqtt:broker:home) @ "Workroom" {
Channels:
    Type switch : switch        "Workroom Lights"   [ stateTopic="home/workroom/light/stat/POWER", commandTopic="home/workroom/light/cmnd/POWER", on="ON", off="OFF" ]
    Type string : wifi-ssid     "Wifi SSID"         [ stateTopic="home/workroom/light/tele/STATE", transformationPattern="JSONPATH:$.Wifi.SSId" ]
    Type string : wifi-rssi     "Wifi RSSI"         [ stateTopic="home/workroom/light/tele/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI" ]
    Type string : uptime        "Uptime"            [ stateTopic="home/workroom/light/tele/STATE", transformationPattern="JSONPATH:$.Uptime" ]
    Type string : time          "Time"              [ stateTopic="home/workroom/light/tele/STATE", transformationPattern="JSONPATH:$.Time" ]
    Type string : devicestate   "Device State"      [ stateTopic="home/workroom/light/tele/LWT" ]
} 

/items/workroom.items

Switch  WSwitch_Workroom    "Workroom Lights"  <light>      (gWSwitch, gLightsHome, gLights, FF_Workroom, gStoreChange) ["Switchable"]  { channel="mqtt:topic:WallSwitchWorkroom:switch" }
1 Like

Thanks kriznik, I was on holiday until now. I tried to do your recomendations, but not works.
I have this:
Bridge mqtt:broker:openhab2 “Mosquitto” [ host="", secure=false, port=“1883”, qos=1, retain=true,
clientID=" “, keep_alive_time=30000, reconnect_time=60000, username=” “, password=” "] {
Thing topic aticopersianadcha “Persiana derecha ático” @ “Ático” {
Channels:
Type switch : switch “Persiana ático” [ stateTopic=“stat/aticopersianadcha/POWER”, commandTopic=“stat/aticopersianadcha/POWER”, on=“ON”, off=“OFF” ]
Type string : wifi-ssid “Wifi SSID” [ stateTopic=“tele/aticopersianadcha/STATE”, transformationPattern=“JSONPATH:$.Wifi.SSId” ]
Type string : wifi-rssi “Wifi RSSI” [ stateTopic=“tele/aticopersianadcha/STATE”, transformationPattern=“JSONPATH:$.Wifi.RSSI” ]
Type string : uptime “Uptime” [ stateTopic=“tele/aticopersianadcha/STATE”, transformationPattern=“JSONPATH:$.Uptime” ]
Type string : time “Time” [ stateTopic=“tele/aticopersianadcha/STATE”, transformationPattern=“JSONPATH:$.Time” ]
Type string : devicestate “Device State” [ stateTopic=“tele/aticopersianadcha/LWT” ]

    }

}
And the Item is:
Group Atico “Atico” (Casa)

Switch Atico “Persiana [%s]” [“Lighting”] {channel="[mqtt:topic:openhab2:aticopersianadcha:switch]"}

But doesn’t work. I don’t know exactly how to put the things and items to control the rollershutter.

Attached detail of console:
MQT: stat/aticopersianadcha/RESULT = {“POWER2”:“ON”}
22:02:36 MQT: stat/aticopersianadcha/POWER2 = ON (retained)
MQT: stat/aticopersianadcha/RESULT = {“POWER1”:“ON”}
22:02:39 MQT: stat/aticopersianadcha/POWER1 = ON (retained)
MQT: tele/aticopersianadcha/LWT = Online (retained)
MQT: tele/aticopersianadcha/STATE
MQT: tele/aticopersianadcha/SENSOR

Thanks in advance.

Item names must be unique.
Groups are a type of Item.
So, you’ll need to change one of the names.

People often give Groups names beginning with g like gAtico, just to remind that it is a group.

Thanks a lot for the reply. Now I have running the rule with time cron and timer to open and close 100%. the question is how to open-close with percentatges, because I am using sonoff dual with tasmota,and uses One switch for open and one for close. Can you suggest any solution?

Thanks in advance.

use timers, count how many seconds it takes to have full down full up and then use it as “percentage” intervals

Thanks Kriznik, but in this case it is possible to solve as you mentioned, but the problem that I see is in the sitemap, I will have a lot of buttons (on for up 25%, on for down 25%… etc) isn’t it? there are any solution easiest than this?

You can make a dummy Rollershutter Item, unconnected to any hardware, and put that on your sitemap.
Rules can then listen to commands from UI (or other rules) and make the actions.

Thanks for your response, but I don’t know how to do this. Can you show me an exemple.

Thanks

Item DummyRoller

sitemap

Rollershutter item=DummyRoller

^^ selection will be probably better idea if you wanna have fixed values eg 10, 25, 50, etc

rule

when
item dummyroller changed
then
var percent = (dummyroller.state as number).intvalue

if(percent == 25) {
actualcontrollerforshutters.sendcommand(ON)
createtimer(xy) // seconds
actualcontrollerforshutters.sendcommand(OFF)
}
end

something like that.
you have to remap actual input from dummy to seconds which timer will be active

How do you create Items now, PaperUI?

PaperUI > Configuration > Items > +

“category” is a funny name for icon filename, if you want one.

Thinks: doesn’t Tasmota have a rollershutter mode that can manage this position timing for you?

I have exactly this version of Tasmota but I didn’t know how to create apercentatges. I will tri to understant the link that you mentioned to do the same and check if it works.
also, I am working with Visual studio format, not with Paper Ui

I checked this page and I thing that they did the % because T1 is with only one relay not two, can be?

Finally I achieve to put Tasmota Stefan in the sonoff dual and I configured the items, things and rules, but I have a problem with sitemap. I have % and fully open or fully close de blinds, but I don’t know how to put in sitemap STOP. Somebody can help me, please??

What are you using in your sitemap now?

Frame label="Habitación Suki Dave" {
        Text label="Persiana Suki Dave" icon="blinds" {
            Slider item=perSukiDaveUpDown icon="rollershutter"
            Switch item=perSukiDaveUpDown mappings=[0="Cerrado ", 25="25%",50="50%",  75="75%" , 100=" Abierto "]
            Switch item=perSukiDaveUpDown mappings=[0="Cerrar ", stop="Stop" , 100=" Abrir "]
        }

Have you tried a switch widget without mappings? And/or default?

Switch item=perSukiDaveUpDown
Default item=perSukiDaveUpDown

It doesn’t works. The arrows up and down and X (for Stop) appears, but works wrong. If I press arrow up, blind goes down and if I press X, goes down. Dont Stop.

Okay, so your Sonoff relays are wired wrong way round? Or translation in your channel is wrong? Or you need to set invert in your Sonoff?

openHAB uses 0% to represent “up” position.
I think the stefanbode firmware uses 0% as “open” by default.

What version of MQTT binding are you using? There have been changes. What MQTT message gets published for STOP? What does the Sonoff expect?