TuYa TS0601_cover Rollershutter Configuration Help

Hello! :slight_smile:

I’m trying to figure out how to make these roller shutters work, I’m not having much luck…

default.items

Rollershutter   Highlight_Blind         "Highlight Blind [%d%%]"        <blinds>                (FamilyRoom)                                    {channelhannel="mqtt:topic:openhabBroker:highlight_blind:state"}

default.things

Thing topic highlight_blind "Blind" @ "Family Room Highlight Blind"
  {
        Channels:
        Type number : position "Position of this cover" [ stateTopic = "zigbee2mqtt/highlight_blind/position", commandTopic = "zigbee2mqtt/highlight_blind/set/position", value_max="100", value_min="0" ]
Type number : motor_speed "Motor Speed" [ stateTopic = "zigbee2mqtt/highlight_blind/motor_speed", commandTopic = "zigbee2mqtt/highlight_blind/set/motor_speed", max=255, min=0 ]
        Type switch : state "Power" [ stateTopic = "zigbee2mqtt/highlight_blind/state", commandTopic = "zigbee2mqtt/highlight_blind/set/state", on="CLOSED", off="OPEN" ]
        Type number : linkquality "linkquality" [ stateTopic = "zigbee2mqtt/highlight_blind/linkquality" ]
  }

Nothing reported in the logs or the zigbee2mqtt log.txt.

I cant seem to get anything to work with these settings?

If you have nothing at all, the first step would be to fix your logging, or more likely, your log viewing method.

Next would be install MQTT binding, see that initialises.

Next missing message would be the binding establishing a connection to your broker.

Hi Rossko57,

Thank you for responding! :slight_smile:

The MQTT binding is fine. I’m using zigbee2mqtt for this device and there is nothing reported in the log.txt file. When I say nothing I mean nothing, no errors, not position updates etc…

Connection to broker is fine too as there is other MQTT devices working without problems too. Light switches, temp sensors, motion devices all working and reporting outputs correctly to the log.txt

My output log from Http://localopenhabserver:9001 when I try to press the switch buttons on the openhab app is…

2021-08-18 21:08:01.555 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Highlight_Blind' received command UP

2021-08-18 21:08:01.565 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Highlight_Blind' predicted to become UP

2021-08-18 21:08:12.020 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Highlight_Blind' received command UP

2021-08-18 21:08:12.034 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Highlight_Blind' predicted to become UP

2021-08-18 21:08:14.356 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Highlight_Blind' received command DOWN

2021-08-18 21:08:14.366 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Highlight_Blind' predicted to become DOWN

2021-08-18 21:08:14.373 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Highlight_Blind' changed from 0 to 100

2021-08-18 21:08:18.190 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Highlight_Blind' received command STOP

But no movement on the blind…

I switched “Rollershutter” to “Dimmer” in my default.items file and found that the device would respond and move but only when half opened it would close but not open once shut.

I dont know what is the problem and I’m not sure how to fix it but my gut feeling is that there is a problem with my default.items or default.things files… please let me know if there is any other info or information that would be helpful for me to post?

Many thanks, I’ve come to this forum a couple of times looking for help and everyone has always been so helpful. Appreciate it.

Excellent, we’ve come a long way from ‘nothing’.

Your events.log shows normal enough openHAB internal activity for a Rollershutter.

Next step would be wondering if anything gets sent out to MQTT. Using a third party tool like mqtt.fx or mosquitto_sub, you can monitor if openHAB is publishing what you expect.

There’s a catch. What is it that you do expect? i.e. what do you think should be published to zigbee2mqtt/highlight_blind/set/state when you press UP?
I think you may need to find out what your blind wants for instructions.

I think the first source of trouble is that you’ve linked a Rollershutter Item to a switch type channel. Item commands UP/DOWN/STOP are not going to be of any interest to a channel expecting ON/OFF commands.

I’m not sure exactly how to respond because I’m starting to get to the edge of my understanding/knowledge here.

In my openhab app I have a up arrow, ‘X’, down arrow when I apply the “Rollershutter” type. I expect that I can press the up arrow and the blind will go up until it reaches its up limit or the ‘X’ is pressed.

Not sure exactly what my blind wants for instructions but I copied this info from the zigbee2mqtt log when it was pairing and tried to use it for my things file config info 2021-07-13 23:47:47: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"definition":{"description":"Curtain motor/roller blind motor/window pusher/tubular motor","exposes":[{"features":[ {"access":3,"name":"state","property":"state","type":"binary","value_off":"CLOSE","value_on":"OPEN"}, {"access":3,"description":"Position of this cover","name":"position","property":"position","type":"numeric","value_max":100,"value_min":0}],"type":"cover"}, {"features":[{"access":3,"description":"Motor speed","name":"motor_speed","property":"motor_speed","type":"numeric","value_max":255,"value_min"0}], "name":"options","property":"options","type":"composite"}, {"access":1,"description":"Link quality (signal strength)","name":"linkquality","property":"linkquality","type":"numeric","unit":"lqi","value_max":255,"value_min":0}],"model":"TS0601_cover","supports_ota":false,"vendor":"TuYa"},"friendly_name":"0x5c0272fffee16d8c","ieee_address":"0x5c0272fffee16d8c","status":"successful","supported":true},"type":"device_interview"}' info 2021-07-13 23:47:48: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_successful","meta":{"description":"Curtain motor/roller blind motor/window pusher/tubular motor","friendly_name":"0x5c0272fffee16d8c","model":"TS0601_cover","supported":true,"vendor":"TuYa"},"type":"pairing"}'
I’m a bit lost on what I’ve linked my rollershutter item to as I have linked it the position channel and it wants a value from 0 - 100 as per the info above. It is strange that if I change it to a Dimmer type it sortof works but if I move the slider too far along I get a error number out of range, which i can post the exact message if needed.

Update…

After installing and playing with mqtt explorer. I’ve found that I can publish a value between 1-99 and the blind will move in the correctly.

So it leads me back to my original to thoughts that there is a problem with my default.items config?

021-08-19 23:39:59.232 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Highlight_Blind' received command DOWN

2021-08-19 23:39:59.243 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Highlight_Blind' predicted to become DOWN

2021-08-19 23:40:01.335 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Highlight_Blind' received command UP

2021-08-19 23:40:01.344 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Highlight_Blind' predicted to become UP

2021-08-19 23:40:01.350 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Highlight_Blind' changed from 100 to 0

That is output from the log file. But there is no movement on the blind and nothing reported in the log.txt file from the mqtt.

What am I doing wrong?

Openhab always a journey to figure it out, but a very exciting one!!!

Good start, finding out what to publish.

Why should there be? If your blind wants 1-99, commands UP/DOWN will not do.

You can create a rule to listen out for UP/DOWN commands, and reinterpret them as … something else. What would be best here, always 1 or 99?
You can do this with a transformation in your MQTT channel instead.

Or leave it as it is, and put your Item on your UI as a slider, so that you get numeric commands to begin with.

I’ve changed my default.items to… {channel=“mqtt:topic:openhabBroker:highlight_blind:position”}

So i think it should be expecting to receive a value 1-99 rather than UP/DOWN?

How does the rollershutter type work then? I would have expected the rollershutter controls to be in the UI to be up/stop/down and it would travel in either direction until it hit the limit switch at top or bottom or you press the stop button? So I guess if you pressed up it would publish 1 and it would go up until it hit the top limit switch?

How does you control what those buttons publish? Or what am I still missing?

That"s fine.
But what does your rollershutter accept? They’re not all alike. Some have position control, some have start/stop, some have both.

The openHAB rollershutter Item is not intelligent. If you command it UP, it passes that to the binding. If the binding doesn’t know what to do with UP (say you are using a number channel) then it won’t do anything. If it does pass it out to the device, the device needs to understand UP.

If something else needs doing instead, that’s fine we can do it with rules and/or transformations.
None of that can happen until you know what to send.

info  2021-07-13 23:47:21: Device '0x5c0272fffee16d8c' joined
info  2021-07-13 23:47:21: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x5c0272fffee16d8c","ieee_address":"0x5c0272fffee16d8c"},"type":"device_joined"}'
info  2021-07-13 23:47:21: Starting interview of '0x5c0272fffee16d8c'
info  2021-07-13 23:47:21: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x5c0272fffee16d8c","ieee_address":"0x5c0272fffee16d8c","status":"started"},"type":"device_interview"}'
info  2021-07-13 23:47:21: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":{"friendly_name":"0x5c0272fffee16d8c"},"type":"device_connected"}'
info  2021-07-13 23:47:21: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_started","meta":{"friendly_name":"0x5c0272fffee16d8c"},"type":"pairing"}'
info  2021-07-13 23:47:21: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x5c0272fffee16d8c","ieee_address":"0x5c0272fffee16d8c"},"type":"device_announce"}'
info  2021-07-13 23:47:22: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"announce","meta":{"friendly_name":"0x5c0272fffee16d8c"},"type":"device_announced"}'
info  2021-07-13 23:47:47: Successfully interviewed '0x5c0272fffee16d8c', device has successfully been paired
info  2021-07-13 23:47:47: Device '0x5c0272fffee16d8c' is supported, identified as: TuYa Curtain motor/roller blind motor/window pusher/tubular motor (TS0601_cover)
info  2021-07-13 23:47:47: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"definition":{"description":"Curtain motor/roller blind motor/window pusher/tubular motor","exposes":[{"features":[
{"access":3,"name":"state","property":"state","type":"binary","value_off":"CLOSE","value_on":"OPEN"},
{"access":3,"description":"Position of this cover","name":"position","property":"position","type":"numeric","value_max":100,"value_min":0}],"type":"cover"},
{"features":[{"access":3,"description":"Motor speed","name":"motor_speed","property":"motor_speed","type":"numeric","value_max":255,"value_min"0}],
"name":"options","property":"options","type":"composite"},
{"access":1,"description":"Link quality (signal strength)","name":"linkquality","property":"linkquality","type":"numeric","unit":"lqi","value_max":255,"value_min":0}],"model":"TS0601_cover","supports_ota":false,"vendor":"TuYa"},"friendly_name":"0x5c0272fffee16d8c","ieee_address":"0x5c0272fffee16d8c","status":"successful","supported":true},"type":"device_interview"}'
info  2021-07-13 23:47:48: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"interview_successful","meta":{"description":"Curtain motor/roller blind motor/window pusher/tubular motor","friendly_name":"0x5c0272fffee16d8c","model":"TS0601_cover","supported":true,"vendor":"TuYa"},"type":"pairing"}'

That is the the logging from the mqtt log when it first paired, i did post that before but i didnt know how to post it correctly.

From this I would assume it has three channels…?

{"access":3,"name":"state","property":"state","type":"binary","value_off":"CLOSE","value_on":"OPEN"},

Switch that can take a OPEN/CLOSED ?

{"access":3,"description":"Position of this cover","name":"position","property":"position","type":"numeric","value_max":100,"value_min":0}],"type":"cover"},

Number that will accept position in numbers from 0-100

{"features":[{"access":3,"description":"Motor speed","name":"motor_speed","property":"motor_speed","type":"numeric","value_max":255,"value_min"0}],

Number that will accept motor speed in numbers from 0-100

If I send it numbers on the position channel from MQTT Explorer it works but cant get it working from the UI.

Ideas?

Good.

That’s no use then, that won’t send numbers.
If you must use that UI widget, then you’ll have to do work in rules or transformations to turn UP/DOWN into numbers,

Sounds good, let’s get that working properly.

Ok so I’ve changed the item to a dimmer

Dimmer          Highlight_Blind         "Highlight Blind"       <blinds>                (FamilyRoom)         {channel="mqtt:topic:openhabBroker:highlight_blind:state"}

I’ve figured out that position 0 is the blind physically closed and 100 is open.

If the blind is open I can close if by moving the dimmer slider to 0% but I cannot close it. If I move the slider I get this error in the mqtt logs…

error 2021-08-29 10:38:20: Publish 'set' 'position' to 'highlight_blind' failed: 'RangeError [ERR_OUT_OF_RANGE]: Command 0x5c0272fffee16d8c/1 manuSpecificTuya.setData({"status":0,"transid":144,"dp":2,"datatype":2,"length_hi":0,"length_lo":4,"data":[99,null,215,2748779068]}, {"sendWhenActive":false,"timeout":10000,"disableResponse":false,"disableRecovery":false,"disableDefaultResponse":true,"direction":0,"srcEndpoint":null,"reservedBits":0,"manufacturerCode":null,"transactionSequenceNumber":null,"writeUndiv":false}) failed (The value of "value" is out of range. It must be >= 0 and <= 255. Received 2748779068)'
info  2021-08-29 10:38:20: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"message":"Publish 'set' 'position' to 'highlight_blind' failed: 'RangeError [ERR_OUT_OF_RANGE]: Command 0x5c0272fffee16d8c/1 manuSpecificTuya.setData({\"status\":0,\"transid\":144,\"dp\":2,\"datatype\":2,\"length_hi\":0,\"length_lo\":4,\"data\":[99,null,215,2748779068]}, {\"sendWhenActive\":false,\"timeout\":10000,\"disableResponse\":false,\"disableRecovery\":false,\"disableDefaultResponse\":true,\"direction\":0,\"srcEndpoint\":null,\"reservedBits\":0,\"manufacturerCode\":null,\"transactionSequenceNumber\":null,\"writeUndiv\":false}) failed (The value of \"value\" is out of range. It must be >= 0 and <= 255. Received 2748779068)'","meta":{"friendly_name":"highlight_blind"},"type":"zigbee_publish_error"}'

It looks like it wants me to restrict the numbers to max value 255? How to do that?

It’s right there in your first post, on one channel -
max=255, min=0

You might first wonder about how you sent 2748779068 though. Waggling a slider connected to a Dimmer Item should produce commands 0 - 100, which you can check in your events.log.
And as you are looking at MQTT logs, just what did openHAB send out as payload?
Is the complaint coming from the device, and it is complaining about what zigbee2mqtt sent it?

From what I can tell the only two channels that have a max value of 255 is the linkquality and motor speed. The position channel has a max value of 100.

In my items file is MQTT broker should be calling the channel position not state, is this correct? I have changed my default.items file to read below.

Dimmer          Highlight_Blind         "Highlight Blind"       <blinds>                (FamilyRoom)         {channel="mqtt:topic:openhabBroker:highlight_blind:position"}

The events.log seems to be sending what we would expect?

2021-08-30 18:55:01.046 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Highlight_Blind' received command 100

2021-08-30 18:55:01.057 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Highlight_Blind' predicted to become 100

2021-08-30 18:55:01.064 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Highlight_Blind' changed from 71 to 100

2021-08-30 18:55:01.096 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Highlight_Blind' received command 100

2021-08-30 18:55:01.104 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Highlight_Blind' predicted to become 100

2021-08-30 18:55:01.799 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Highlight_Blind' changed from 100 to 0

How to tell who is complaining the device or zigbee2mqtt?

Sometimes like 1 in 20 it will magically get a position of 100 (open) when you move the slider and it will open. As I said before if it is open and you move the slider to 0 it will always close.

Your openHAB settings look good to me.

With the exception of the unknown channel parameters value_max="100", value_min="0" on your position channel, They’ll just get ignored, it’s no problem as Dimmer / Rollesrhutter Items are naturally 0-100 range.

Using your MQTT monitor, you should be able to see exactly what openHAB is sending to what topic.
0-100 we hope.
If the other end sees 2748779068 instead, it’s not an openHAB problem.

Events.log

2021-08-31 21:25:35.500 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Highlight_Blind' received command 80.0

2021-08-31 21:25:35.505 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Highlight_Blind' predicted to become 80.0

Opened up the MQTT monitor. This what it looks like openhab is actually sending. The requested position with the decimal point placed moved over one place.

0.80000000

Hopefully, we’re getting to the bottom of it now?

If you are going to use a Dimmer type Item, use a dimmer (percent) type channel.
Or use a Rollershutter Item and channel types (which also work in percent) but don’t send UP/DOWN commands unless you transform them to something numeric.

I honestly dont mind which one i use, I just want one to work. :frowning: Shouldnt it send a value like 80.000 rather than 0.800000? Or is that what you would expect to see?

I dont want to confuse things at this point but I was wondering would a setpoint item work because then I could manually enter the value?

A Dimmer type Item has a state 0-100, but it is a Percent type state, not quite a regular number type.
It’s legitimate to present 80% as 0.8 (of one) if converting to an ‘ordinary’ number, such as when linking a Dimmer Item to a number type channel.