[SOLVED] Problem with MQTT2 and Sonoff T1 (Tasmota forked)

Hi guys,

I ran into a strange problem with a Sonoff T1 EU 2 gang with flashed Tasmota fork by Stefan Bode and MQTT2. The fork has additionally support for rollershutters which I want to use.

The embedded MQTT broker is currently used and works fine.

My mqtt.things file:

Bridge mqtt:broker:broker "Mosquitto" [ host="localhost", port=1883, secure=false, username="someuser", password="somepassword", clientID="openHAB2" ]
{ 
   Thing topic sonoff-DEXXXX "T1 #2" {
        Type rollershutter : blinds "Rollo2" [ stateTopic="stat/sonoff-DEXXXX/SHUTTER1", commandTopic="cmnd/sonoff-DEXXXX/backlog", up="shutteropen", down="shutterclose", stop="shutterstop" ]
    }
}

The .items:

Rollershutter T1 "Snoff T1" { channel="mqtt:topic:broker:sonoff-DEXXXX:blinds" }

The sitemap:

sitemap hometest label="meine Testumgebung" {

	Frame label="Test mit Switch" {
		Switch item=T1
	}
}

The problem now is: The state is reported from time to time but I’m not able to send commands. When I click on UP for example the following is logged:

019-02-27 21:47:33.318 [ome.event.ItemCommandEvent] - Item 'T1' received command UP

2019-02-27 21:47:33.324 [nt.ItemStatePredictedEvent] - T1 predicted to become UP

==> /var/log/openhab2/openhab.log <==

2019-02-27 21:47:33.328 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.handleCommand()' on 'org.openhab.binding.mqtt.generic.internal.handler.GenericThingHandler@1730ed7': Cannot call update() with custom stop/move/up/down

java.lang.IllegalStateException: Cannot call update() with custom stop/move/up/down

	at org.openhab.binding.mqtt.generic.internal.values.RollershutterValue.update(RollershutterValue.java:62) ~[?:?]

	at org.openhab.binding.mqtt.generic.internal.generic.ChannelState.publishValue(ChannelState.java:322) ~[?:?]

	at org.openhab.binding.mqtt.generic.internal.handler.AbstractMQTTThingHandler.handleCommand(AbstractMQTTThingHandler.java:123) ~[?:?]

	at sun.reflect.GeneratedMethodAccessor102.invoke(Unknown Source) ~[?:?]

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [134:org.openhab.core:2.5.0.201902220301]

	at org.eclipse.smarthome.core.internal.common.InvocationHandlerSync.invoke(InvocationHandlerSync.java:59) [134:org.openhab.core:2.5.0.201902220301]

	at com.sun.proxy.$Proxy160.handleCommand(Unknown Source) [218:org.openhab.binding.mqtt.generic:2.5.0.201902222355]

	at org.eclipse.smarthome.core.thing.internal.profiles.ProfileCallbackImpl.handleCommand(ProfileCallbackImpl.java:75) [184:org.openhab.core.thing:2.5.0.201902220301]

	at org.eclipse.smarthome.core.thing.internal.profiles.SystemDefaultProfile.onCommandFromItem(SystemDefaultProfile.java:49) [184:org.openhab.core.thing:2.5.0.201902220301]

	at sun.reflect.GeneratedMethodAccessor101.invoke(Unknown Source) ~[?:?]

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]

	at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [134:org.openhab.core:2.5.0.201902220301]

	at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [134:org.openhab.core:2.5.0.201902220301]

	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]

	at java.lang.Thread.run(Thread.java:748) [?:?]

Similar effect by clicking DOWN or STOP.

Sending “cmnd/sonoff-DEXXXX/backlog shutteropen” directly on the Tasmota Console the device works as expected:

21:54:13 CMD: cmnd/sonoff-DEXXXX/backlog shutteropen
21:54:13 Start shutter in right direction 1
21:54:14 MQT: stat/sonoff-DEXXXX/RESULT = {"POWER1":"ON"}
21:54:14 MQT: stat/sonoff-DEXXXX/POWER1 = ON
21:54:14 MQT: stat/sonoff-DEXXXX/RESULT = {"shutteropen1":0}
21:54:14 Shutter 0: Real Pos: 0, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 0.5  [s]
21:54:14 Shutter 0: Real Pos: 2700, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 1.4  [s]
21:54:15 Shutter 0: Real Pos: 4700, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 2.3  [s]
21:54:16 Shutter 0: Real Pos: 6700, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 3.3  [s]
21:54:18 Shutter 0: Real Pos: 8800, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 4.4  [s]
21:54:18 Shutter 0: Real Pos: 10700, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 5.3  [s]
21:54:19 Shutter 0: Real Pos: 12700, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 6.3  [s]
21:54:21 Shutter 0: Real Pos: 14800, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 7.4  [s]
21:54:22 Shutter 0: Real Pos: 16800, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 8.4  [s]
21:54:23 Shutter 0: Real Pos: 18800, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 9.4  [s]
21:54:24 Shutter 0: Real Pos: 20800, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 10.4  [s]
21:54:25 Shutter 0: Real Pos: 22800, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 11.4  [s]
21:54:26 Shutter 0: Real Pos: 24800, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 12.4  [s]
21:54:27 Shutter 0: Real Pos: 26800, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 13.4  [s]
21:54:28 Shutter 0: Real Pos: 28800, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 14.4  [s]
21:54:28 Shutter 0: Real Pos: 30700, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 15.4  [s]
21:54:29 Shutter 0: Real Pos: 32700, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 16.4  [s]
21:54:30 Shutter 0: Real Pos: 34700, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 17.4  [s]
21:54:31 Shutter 0: Real Pos: 36700, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 18.4  [s]
21:54:32 Shutter 0: Real Pos: 38700, Target 40000, source: Shutter, start-pos: 0 %, direction: 1, rtcshutter: 19.4  [s]
21:54:33 MQT: stat/sonoff-DEXXXX/SHUTTER1 = 0
21:54:33 MQT: stat/sonoff-DEXXXX/RESULT = {"POWER1":"OFF"}
21:54:33 MQT: stat/sonoff-DEXXXX/POWER1 = OFF
21:54:33 MQT: tele/sonoff-DEXXXX/RESULT = {"SHUTTER-1":{"position":0, "direction":0}}

The goal is to control the blinds via openHAB. I’m running openHAB 2.5.0~S1534-1 (Build #1534) on a RaspberryPi 3 Mod. B

Did I miss something? Hints and suggestions are very welcome…
Thanks in advance

Ingo

I’m afraid the rollershutter channel is a bit broken at the moment. I didn’t get the concept when I first implemented the binding. It should be possible to use a dimmer item instead and send a number as a temporary solution.

Cheers David

1 Like

Hi David,

thanks for your reply. The workaround using a dimmer item works for now. This is the current mqtt.thing:

Bridge mqtt:broker:broker "Mosquitto" [ host="localhost", port=1883, secure=false, username="someuser", password="somepassword", clientID="openHAB2" ]
{
    // T1 Testschalter 2 mit Stefan Bode Fork
    Thing topic sonoff-DEXXXX "T1 #2" {
        Type rollershutter : blinds "Rollo2" [ stateTopic="stat/sonoff-DEXXXX/SHUTTER1", commandTopic="cmnd/sonoff-DEXXXX/shutterposition" ]
    }

I’m looking forward to the final version the rollershutter channel is working.

Regards Ingo