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

Trying to make sense out of Zemismart ZM16E-03/33 tubular motor #23545

Open
danielmmmm opened this issue Aug 7, 2024 · 0 comments
Open

Trying to make sense out of Zemismart ZM16E-03/33 tubular motor #23545

danielmmmm opened this issue Aug 7, 2024 · 0 comments
Labels
problem Something isn't working

Comments

@danielmmmm
Copy link

What happened?

I am one of those people who bought a Zemismart tubular motor without a remote, thinking it could be controlled using Zigbee alone. Unfortunately, I can't seem to set the upper and lower border for my motor.

The manufacturer name is _TZE200_fzo2pocs and the model was set to ZM25TQ. I guess I got one of the many Zemismart products with a wrong identification name, since it is a ZM16E-03/33 (powered from USB, unlike the battery powered ZM16EL-03/33). Since I can't seem to get an external converter to make z2m treat the _TZE200_fzo2pocs as a ZM16E-03/33, I edited the zemismart.js directly, pasting the ZM16EL-03/33 code over the ZM25TQ code:

        fingerprint: [{ modelID: 'TS0601', manufacturerName: '_TZE200_fzo2pocs' }],
        model: 'ZM25TQ',
        vendor: 'Zemismart',
        description: 'Tubular motor',
        fromZigbee: [tuya.fz.datapoints],
        toZigbee: [tuya.tz.datapoints],
        onEvent: tuya.onEventSetTime,
        options: [exposes.options.invert_cover()],
        configure: tuya.configureMagicPacket,
        exposes: [
            e.cover_position(),
            e.enum('reverse_direction', ea.STATE_SET, ['forward', 'back']).withDescription('Reverse the motor direction'),
            e.enum('border', ea.STATE_SET, ['up', 'down', 'up_delete', 'down_delete', 'remove_top_bottom']),
            e.enum('click_control', ea.STATE_SET, ['up', 'down']).withDescription('Single motor steps'),
            e.binary('motor_fault', ea.STATE, true, false),
        ],
        whiteLabel: [
            tuya.whitelabel('Zemismart', 'ZM16EL-03/33', 'Cover motor', ['_TZE200_fzo2pocs']),
        ],
        meta: {
            // All datapoints go in here
            tuyaDatapoints: [
                [1, 'state', tuya.valueConverterBasic.lookup({ OPEN: tuya.enum(0), STOP: tuya.enum(1), CLOSE: tuya.enum(2) })],
                [2, 'position', tuya.valueConverter.coverPosition],
                [3, 'position', tuya.valueConverter.raw],
                [5, 'reverse_direction', tuya.valueConverterBasic.lookup({ forward: tuya.enum(0), back: tuya.enum(1) })],
                [12, 'motor_fault', tuya.valueConverter.trueFalse1],
                [13, 'battery', tuya.valueConverter.raw],
                [
                    16,
                    'border',
                    tuya.valueConverterBasic.lookup({
                        up: tuya.enum(0),
                        down: tuya.enum(1),
                        up_delete: tuya.enum(2),
                        down_delete: tuya.enum(3),
                        remove_top_bottom: tuya.enum(4),
                    }),
                ],
                [20, 'click_control', tuya.valueConverterBasic.lookup({ up: tuya.enum(0), down: tuya.enum(1) })],
            ],
        },

However, I still can't set the border limits or the position. Looking at the z2m output, I found it doesn't make much sense:

MQTT publish: topic 'zigbee2mqtt/0x94b216fffee4afd5', payload '{"border":"up","click_control":"up","last_seen":"2024-08-07T01:31:25+02:00","linkquality":182,"motor_fault":true,"position":12,"reverse_direction":"forward","state":"OPEN"}'
MQTT publish: topic 'zigbee2mqtt/0x94b216fffee4afd5', payload '{"border":"up","click_control":"up","last_seen":"2024-08-07T01:32:36+02:00","linkquality":185,"motor_fault":true,"position":12,"reverse_direction":"forward","state":"OPEN"}'
MQTT publish: topic 'zigbee2mqtt/0x94b216fffee4afd5', payload '{"border":"up","click_control":"up","last_seen":"2024-08-07T01:32:36+02:00","linkquality":185,"motor_fault":true,"position":12,"reverse_direction":"forward","state":"OPEN"}'

Firstly, clicking the open button in the z2m web interface triggers sending the payload three times. In fact, any action will send a payload three times in a row.
Secondly, and I suspect this is the real problem, the payload always contains all possible messages at once. Instead of just sending e.g. "state":"OPEN", z2m sends "border":"up","click_control":"up",... too. It looks like just moving the roller blinds up or down will always set a new border, and therefore never effectively set any border.

I couldn't figure out how to send a payload through the web interface or how to do that using the PowerShell. But I managed to send messages using mosquitto_pub. Unfortunately, sending any message with mosquitto_pub will trigger the same z2m response of sending a full payload (three times). I tried mosquitto_pub -t zigbee2mqtt/0x94b216fffee4afd5/set -m "{\"state\": \"STOP\"}" and mosquitto_pub -t zigbee2mqtt/0x94b216fffee4afd5/set/state -m "STOP", which both make the motor stop, but both make z2m send the full {"border":"up","click_control":"up",...,"position":12,"reverse_direction":"forward","state":"OPEN"} payload?

What did you expect to happen?

No response

How to reproduce it (minimal and precise)

No response

Zigbee2MQTT version

1.39.1

Adapter firmware version

20221226

Adapter

zStack3x0

Setup

plain z2m on Windows 10

Debug log

No response

@danielmmmm danielmmmm added the problem Something isn't working label Aug 7, 2024
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

No branches or pull requests

1 participant