Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZM25RX-08/30 cover directions are reversed after 1.33.2 upgrade #19539

Closed
burnsie-la opened this issue Nov 3, 2023 · 23 comments · Fixed by Koenkk/zigbee-herdsman-converters#6492
Labels
problem Something isn't working

Comments

@burnsie-la
Copy link

What happened?

Since upgrading to 1.33.2 my Zemismart tubular blind closes when I send the OPEN command and vice versa. Changing the motor direction or using the Invert Cover options within Zigbee2MQTT had no effect. Setting the position of the cover using the 0-100 value works as expected.

Device type: EndDevice
Zigbee Model: TS0601
Zigbee Manufacturer: _TZE200_7eue9vhc
Description: Tubular motor

It seems to have started happening after the introduction of this PR: https://github.com/Koenkk/zigbee-herdsman-converters/pull/6341/files

What did you expect to happen?

The Close command should close the cover, the open command should open the cover.

How to reproduce it (minimal and precise)

Pair a _TZE200_7eue9vhc with Z2M.
Press Close in the Exposes tab of the device in the UI
The blind opens, instead of closes.

Zigbee2MQTT version

1.33.1

Adapter firmware version

7.1.1.0 build 273

Adapter

Home Assistant SkyConnect

Debug log

Topic: zigbee2mqtt/Top Floor Hallway Blind
log.txt

@burnsie-la burnsie-la added the problem Something isn't working label Nov 3, 2023
@burnsie-la burnsie-la changed the title ZM25RX-08/30 directions are reversed after 1.33.2 upgrade ZM25RX-08/30 cover directions are reversed after 1.33.2 upgrade Nov 3, 2023
@burnsie-la
Copy link
Author

This also seems to affect the _TZE200_bv1jcqqu version of the Zemismart ZM25RX-08/30

@Koenkk
Copy link
Owner

Koenkk commented Nov 3, 2023

@donbobka could you check this?

@donbobka
Copy link

donbobka commented Nov 4, 2023

@burnsie-la I've set state according to physical buttons (buttons at left side)+motor direction option=normal. Can you send the photo of your blinds? It's strange that internal invert option doesn't work

Open/close actually depends on multiple factors 🤔: left/right side, direction of blinds rolled onto tube (in my case is left + under)
image

@Koenkk, I don't think there is right way of installation and the best solution will change it back to keep it backwards compatible. Also maybe we should keep it as standard for tubular motor installation to keep open/close state consistent across all motors: like left side + rolled over (and then we have inverted option to invert it)

@Koenkk
Copy link
Owner

Koenkk commented Nov 4, 2023

@donbobka could you make a PR for that?

@burnsie-la
Copy link
Author

@burnsie-la I've set state according to physical buttons (buttons at left side)+motor direction option=normal. Can you send the photo of your blinds? It's strange that internal invert option doesn't work

Open/close actually depends on multiple factors 🤔: left/right side, direction of blinds rolled onto tube (in my case is left + under) image

@Koenkk, I don't think there is right way of installation and the best solution will change it back to keep it backwards compatible. Also maybe we should keep it as standard for tubular motor installation to keep open/close state consistent across all motors: like left side + rolled over (and then we have inverted option to invert it)

PXL_20231104_094608519
PXL_20231104_094558713

I have blinds that go in both directions, and they previously worked fine with Z2M. I originally set the motor direction and set points with the remote control, and the remote control still functions perfectly making all the blinds go up and down using the physical buttons as expected.

@KablammoNick
Copy link

Just to add to this - I have a mix of left/right roll-over blinds now doing the same. All are set to Open=100 in z2m, with the inverse set on the motor itself.
I have HA feed the blinds into both Google Home and HomeKit too - strangely HomeKit Open/Close works fine, however HA and GH do not.
Setting a % works correctly (80% = 80% open) in all three.
Using the RF remote works fine.

Zigbee2MQTT version
1.33.2

Adapter firmware version
20210708

Adapter
Sonoff ZBDongle-P

@TRusselo
Copy link

TRusselo commented Nov 13, 2023

I have had the problem since the past few updates. ZM25RX-08/30

cover position is correct, 0% is fully closed, 100% is fully open
but open/close is reversed.

when the cover is closed 0%, I get one option, Open, clicking open button does nothing.
If I open the cover to 10% clicking Open will Close the blind.

@TRusselo
Copy link

TRusselo commented Nov 13, 2023

oh.. and there is no working battery state for this motor, never worked. ZM25RX-08/30

@donbobka
Copy link

donbobka commented Nov 17, 2023

I'm back and tested with reverted state values, but it makes open/close action inverted for me 🤔 (different hardware/firmware revision? i see some visual differences: like on-off button).

[1, 'state', tuya.valueConverterBasic.lookup({ 'OPEN': tuya.enum(0), 'STOP': tuya.enum(1), 'CLOSE': tuya.enum(2) })],

If i set Motor direction to reverse to fix open/close actions, then buttons are inverted

@TRusselo @KablammoNick for the following setup (left side) image
If you set Motor direction to normal and click physical buttons, are directions of rotation same as in my video?

IMG_9791.mov

My current idea is to do same as for cover_position and invert open/close actions depending on parameter invert_cover. Something like that

const valueConverterBasic = {
  lookup: (map, fallbackValue) => {
      return {
          to: (v, meta) => utils.getFromLookup(v, typeof map == "function" ? map(meta.options) : map),
          from: (v, meta, options) => {
              m = typeof map == "function" ? map(options) : map
              const value = Object.entries(m).find((i) => i[1].valueOf() === v);
              if (!value) {
                  if (fallbackValue !== undefined) return fallbackValue;
                  throw new Error(`Value '${v}' is not allowed, expected one of ${Object.values(m)}`);
              }
              return value[0];
          },
      };
  },
};
[1, 'state', valueConverterBasic.lookup((options) => options.invert_cover ? { 'OPEN': tuya.enum(2), 'STOP': tuya.enum(1), 'CLOSE': tuya.enum(0) } : { 'OPEN': tuya.enum(0), 'STOP': tuya.enum(1), 'CLOSE': tuya.enum(2) })],

PS.: I bought my blinds here

@KablammoNick
Copy link

I'm away for a few days but will have a suss when I get home.

@donbobka
Copy link

donbobka commented Nov 17, 2023

Also my motor with default options "motor_direction": "normal", "invert_cover": false: position 0 = fully open, position 100 = fully closed. For HA i have to enable invert_cover

@TRusselo
Copy link

changing the "motor direction" does not fix anything in home assistant for me. cant see any change when changing "motor direction" option

@donbobka
Copy link

donbobka commented Nov 18, 2023

@TRusselo Does motor give feedback when you change options: small movement up and down? Is your motor _TZE200_bv1jcqqu or _TZE200_7eue9vhc in Zigbee Manufacturer in zigbee2mqtt?

IMG_9805.mov

@donbobka
Copy link

Some photos of internals
IMG_9800
IMG_9802
IMG_9798
IMG_9796
IMG_9795
IMG_9794

@TRusselo
Copy link

@TRusselo Does motor give feedback when you change options: small movement up and down? Is your motor _TZE200_bv1jcqqu or _TZE200_7eue9vhc in Zigbee Manufacturer in zigbee2mqtt?

image

_TZE200_7eue9vhc
no reaction from motor when changing motor direction option. not like your video. nothing.

notes:
the up/down was correct couple months ago (or less)
battery % has never worked.

@donbobka
Copy link

donbobka commented Nov 18, 2023

I'll revert _TZE200_7eue9vhc here seems it has different protocol

P.S.: Actually i checked the code and it used same DP 5 for motor direction option

@burnsie-la
Copy link
Author

@TRusselo Does motor give feedback when you change options: small movement up and down? Is your motor _TZE200_bv1jcqqu or _TZE200_7eue9vhc in Zigbee Manufacturer in zigbee2mqtt?
IMG_9805.mov

I also get no feedback from the motor at all when changing the settings in Z2M. But I do if I reverse the motor direction using the RF remote that came with the device

@donbobka
Copy link

@burnsie-la 🤔 and your device is _TZE200_bv1jcqqu, isn't it. Did Z2M motor direction option worked before 1.33.1?

@burnsie-la
Copy link
Author

burnsie-la commented Nov 18, 2023

@burnsie-la 🤔 and your device is _TZE200_bv1jcqqu, isn't it. Did Z2M motor direction option worked before 1.33.1?

I have both _TZE200_bv1jcqqu and _TZE200_7eue9vhc, motor direction and battery never worked via Z2M for either. They seem to function the same.

Edit: I purchased mine from Zemismart https://www.zemismart.com/products/zm25rz01-30

@donbobka
Copy link

donbobka commented Nov 18, 2023

Seems i have an updated revision (just firmware?) that supports zigbee commands for motor direction/set limits.

PR with fix and small feature
PR with fix

@KablammoNick
Copy link

KablammoNick commented Nov 22, 2023

I'm back and tested with reverted state values, but it makes open/close action inverted for me 🤔 (different hardware/firmware revision? i see some visual differences: like on-off button).

[1, 'state', tuya.valueConverterBasic.lookup({ 'OPEN': tuya.enum(0), 'STOP': tuya.enum(1), 'CLOSE': tuya.enum(2) })],

If i set Motor direction to reverse to fix open/close actions, then buttons are inverted

@TRusselo @KablammoNick for the following setup (left side) image If you set Motor direction to normal and click physical buttons, are directions of rotation same as in my video?

No feedback from motor with settings changes... and changing motor_direction in Z2M makes no difference to the physical buttons on my blinds.

All blinds are TS0601 & _TZE200_7eue9vhc.
All blinds are roll-over, with motor side specified... however I can't remember which ones were inverted on the device at installation. I've made the assumption based off your video and flipping it to match roll-over, the ones with the motor on the right side are "correct" with physical up/down buttons.

Name			Model	Manufacturer		Motor Side	Z2M Invert Cover	Invert on Device	Z2M motor_direction
blind_backdoor_left	TS0601	_TZE200_7eue9vhc	Left		False			True			blank?
blind_backdoor_right	TS0601	_TZE200_7eue9vhc	Right		False			False			normal
blind_dining		TS0601	_TZE200_7eue9vhc	Left		False			True			blank?
blind_kitchen		TS0601	_TZE200_7eue9vhc	Right		False			False			normal
blind_sidedoor_left	TS0601	_TZE200_7eue9vhc	Left		False			True			blank?
blind_sidedoor_right	TS0601	_TZE200_7eue9vhc	Right		False			False			normal

EDIT: I'm getting myself confused but hope this info can help - it sounds like you're across a fix - happy to wait til that happens, and if you need more testing done am happy to help as best I can!

@TRusselo
Copy link

TRusselo commented Nov 22, 2023

Im confused why physical buttons have entered the conversation.
The problem is with logical buttons of the software zigbee2mqtt / home assistant ect

image

@donbobka
Copy link

donbobka commented Nov 22, 2023

@TRusselo logical buttons and physical buttons are connected (at least on my motor)

I'm back and tested with reverted state values, but it makes open/close action inverted for me 🤔

Hopefully this video from another PR explains it (still waiting for a few more motors to test it completely).

PR that reverts logical open/close action back has been already merged into master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants