This should work. The mentioned PR is already merged since a while. You need 2.5M1 at least. If it still not work you need to issue another bug report stating your configuration etc.
But just FYI: MQTT development is on hold at the moment until the ESH reintegration has been completed.
Iâm migrating an OH2.0 to OH2.5M1 as a docker container but run into the same issue.
old default.items:
Rollershutter r12 (gRoll_boven_all) { mqtt=">[xxx:/rolluik/r/12/u:command:UP:30],>[primus:/rolluik/r/12/d:command:DOWN:30],>[xxx:/rolluik/r/12/s:command:STOP:0],<[xxx:/rolluik/h/12:state:default]", autoupdate=âfalseâ } /* gang */
I wrote my own rollershutter interface with arduino & pubsubclient (16 devices). As you can see, it expects /rolluik/r/12/u, d or s and the amount of seconds. The arduino publishes the state in percent on /rolluik/h/12 on a regular interval.
new default.items:
Rollershutter r12 { channel=âmqtt:topic:mosquitto:rollershutters:r12â }
events.log when clicking each button:
[ome.event.ItemCommandEvent] - Item âr12â received command DOWN
[nt.ItemStatePredictedEvent] - r12 predicted to become DOWN
[vent.ItemStateChangedEvent] - r12 changed from 0 to 100
[ome.event.ItemCommandEvent] - Item âr12â received command STOP
[ome.event.ItemCommandEvent] - Item âr12â received command UP
[nt.ItemStatePredictedEvent] - r12 predicted to become UP
[vent.ItemStateChangedEvent] - r12 changed from 100 to 0
I only see the values change in the Paper UI (d: 100, s: no change, u: 0) there is nothing published on mqtt itself. This is probably related to the error below, I might need to change my code above
openhab.log when clicking a button:
[ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method âThingHandler.handleCommand()â on âorg.eclipse.smarthome.binding.mqtt.generic.internal.handler.GenericThingHandler@2168d4â: Cannot call update() with custom stop/move/up/down
java.lang.IllegalStateException: Cannot call update() with custom stop/move/up/down
What do I have to change in my new code to at least already publish something in mqtt? Can I get some example code? If the above should work, I can create a PR.
And whatâs the best next step here?
wait for transformations to work on outgoing messages?
try to make it work via buttons and rules? like:
val mqttActions = getActions("mqtt", "mqtt:broker:mosquitto")
mqttActions.publishMQTT("topic", "payload")
rewrite my rollershutter arduino code? (really? nah. Perhaps in the future to comply to homie v3)
stick with the mqtt 1 binding for the rollershutters for now?
I havenât tried it myself, I have only added a test case that tested for the STOP command and if a percentage value is accepted. I will start MQTT development end of the week again and fix all the accumulated problems.
Just make sure to open an Issue on Github, describing exactly which commands work and which donât.
Hey! I Have the same problem.
Is there still any solution?
I migrated OH to 2.5M1 to try if there is a new âstopâ-state for the rollershutter-item. But it seams like it is not working basically.
Thanks a lot. So I am a little bit confused now. What do I have to do to get it working with your changes?
I downloaded this file and put it into the openhab2-addons directory.
It seem to install the MQTT binding from this location, but the embedded broker did not work. In my Generic MQTT Thing I am not able to select any broker.
I also tried the latest build of OH, but it has to many bugs right now for daily use.
The tl;dr: The issue is fixed but cannot be used at the moment, until the buildsystem migration has finished, openhab-core is repaired and the remaining buildsystem related problems with the mqtt binding are resolved.
I have the same problem like the other guys above me. Im new in OpenHab and did not understand it right. In the actual Snapshot it was fixed and the mqtt send up down stop ?
For example what i need. I have create a Thing like this ::
Rollershutter WZ_Jalousie_links "Wohnzimmer li [%d %%]" <blinds> (Jalousien, WZ_Jalousien) {channel="mqtt:topic:embedded-mqtt-broker:wzlinks:WZ_Jalousie_links"}
My commandTopic i need for the blinds is
/JaroFB/set up 1, for example. When the Dongle read this the blind will move.
1 is my blind channel, so blind 2, 3 and so on.
So what the mqtt is sending you know 0, 0, 100 with this the blind can do nothing.
When the new Build is out 2.5.0 M2 it works like i need it ? Did he send then
Or is there a way i can do this on another way ? What i have is a rule file they worked with astro binding and move my blinds random everyday. I use groups for each room.
Hi Stefan. I use rollershutter-switches with the mqtt-tuya script. I adapted the script for now. But with this solution I only can use Up and Down Switch not the Stop Switch of my rollershutter-switches. Thats a little bit pitty. I am still waiting for 2.5M2 with the upgraded rollerhutter profile.
Sorry for the late answer.
I have installed the 2.5m2 version hoping the rollershutter now would work as it did for the 1.x binding but that is not the case. I have a switch commanding the shutter and the MQTT messages coming out via the binding now is 0, STOP, 100 (was earlier UP, STOP, DOWN).
Will this be changed back to UP,STOP,DOWN in a coming release or are the new messages the correct output?
With the exception of the rollershutter the new MQTT binding is working well for me so many thanks for a great job.
Actually different people demand for different outputs and I do not know what the idiomatic openhab-like way is. Could you maybe create a github issue for discussion and express your thoughts and why you think that your idea could be beneficial?