I try to integrate Dooya Rollershutters into openhab2. The motors are connected via 433MHz to a fhem installation with nanoCul Signalduino. From openhab I control them via “generic mqtt thing” (mosquitto Broker) with the following channels:
So I want to use the rollershutter item. Problem here are the commands:
up: 0
stop: 0
down: 100
they are for the fancy motors which support positions, unfortunately my motors doesn’t support those commands. Is it possible to map the controls to my MQTT commands and the state to the small shutter icon?
A few seconds search of this forum gives a few ways to identify versions, like bundle.list on the karaf console.
But that’s fine, assume as-it-comes version 2.4.0
There is a problem with roller STOP in 2.4.0 as I understand it, and you want to use that. 2.5 versions will have a STOP fix. There’s a “but”…
That’s by design, right or wrong.
Lots about it here
Me, I’d stick with 2.4 and set up a roller Item linked to nothing, and have a rule that listened for commands and issued MQTT acions directly. The rule can also make a guess about the expected position and update the roller Item state.
Maybe review when 2.5M2 is available.
Okay. could you help me with the rule syntax? I found different approaches but none of them work so far. I got:
rule "Shutter Wozi"
when
Item RollershutterWohnzimmer received command
then
switch (receivedCommand) {
case UP :
mqttActions.publishMQTT("set/fhem/Rolladen_Wohnzimmer/off")
// { mqtt=">[mosquitto:set/fhem/Rolladen_Wohnzimmer/off]}
case STOP :
mqttActions.publishMQTT("set/fhem/Rolladen_Wohnzimmer/stop")
//{ mqtt=">[mosquitto:set/fhem/Rolladen_Wohnzimmer/stop]}
case DOWN :
mqttActions.publishMQTT("set/fhem/Rolladen_Wohnzimmer/on")
//{ mqtt=">[mosquitto:set/fhem/Rolladen_Wohnzimmer/on]}
}
end
I already tried the commented lines, but there is no incoming message at mqtt broker. I also need an idea for implementing the shutter state in the rule.
Aren’t you supposed to have a payload, as well as a topic?
This is MQTT binding version 1 syntax and will never work with v2 binding. Careful looking at older guides.
I presume you mean something more than
RollershutterWohnzimmer.postUpdate(100)
?
If you have no feedback from the device, what can you do?
It would be possible to do complicated things with timers, to try and keep track of where it ought to be. Finding the 0 / 100 extremes would be tricky.
Nope, in the commandline it also works without a message payload.
mosquitto_pub -h IP -p 1883 -u User -P Password -t set/fhem/Rolladen_Wohnzimmer/on -m “”
I just could offer the state from fhem. It switches from open to close immediately after an “on” or “off” command is send to the actor. So the state is also updated, when a manual remote control sends the command. That would be enough for me.
Nice, now it works. I will post an update if the state works as well
rule "Shutter Wozi"
when
Item RollershutterWohnzimmer received command
then
val mqttActions=getActions("mqtt","mqtt:broker:mosquitto")
switch (receivedCommand) {
case UP :
mqttActions.publishMQTT("set/fhem/Rolladen_Wohnzimmer/off", "")
case STOP :
mqttActions.publishMQTT("set/fhem/Rolladen_Wohnzimmer/stop", "")
case DOWN :
mqttActions.publishMQTT("set/fhem/Rolladen_Wohnzimmer/on", "")
}
end
This was driving me insane, crazy idea changing how rollershutter works without keeping the old functionality. (I to had build devices around the way the old binding worked).
For info is here my rules:
rule “Awning”
when
Item GF_Awning received command
then
val mqttActions=getActions(“mqtt”,“mqtt:broker:mosquitto”)
switch (receivedCommand) {
case UP :
mqttActions.publishMQTT(“home/br/sb/markise”, “UP”)
case STOP :
mqttActions.publishMQTT(“home/br/sb/markise”, “STOP”)
case DOWN :
mqttActions.publishMQTT(“home/br/sb/markise”, “DOWN”)
}
end