rospogrigio / localtuya

local handling for Tuya devices
GNU General Public License v3.0
2.84k stars 545 forks source link

Zemismart Roller Shade Motor always unavailable #217

Closed clyra closed 3 years ago

clyra commented 3 years ago

Hi all,

I'm trying to configure a Zemismart wifi roller shade motor for 38mm tube but it always appear as unavailable in HA interface. Clicking on the entity and using the slider to set position works, but up/down/stop buttons do not. I tried all options of open_close_stop commands without success. DPS 3 seems to report current position and DPS 2 is used to set position. Tuyadebug report this while in opened position:

python test.py ebd3aed397cc278xxx 192.168.0.201 xxxxx

INFO:localtuya:localtuya version 1.0.0 INFO:localtuya:Python 3.8.6 (default, Nov 23 2020, 08:48:27) [GCC 9.3.0] on linux INFO:localtuya:Using pytuya version '8.1.0' INFO:localtuya:Detecting list of available DPS of device ebd3aed397cc278be3obha [192.168.0.201], protocol 3.3. DEBUG:localtuya.pytuya:Sending command status (device type: type0a) DEBUG:localtuya.pytuya:paylod=b'{"gwId":"ebd3aed397cc278xxx","devId":"ebd3aed397cc278xxx"}' DEBUG:localtuya.pytuya:DATA RECEIVED! DEBUG:localtuya.pytuya:decode > payload=b"s'w\xe6\xcc\xdd\xcc\x03vr\x13=\x914L\xa1\xef\t\xc0`\xc8\xa8\xd1pdvs\t\xcfa\xb1\xfb\x93<\xe0\xac0\xd4fxJ(=\xb8\x97\xb2\xe4\xe1\xfe\x0er}\x9cY\x7f\x8dBP\xa2\x82\xab2A>W\xf3g\xec\xb5\xa0(\x9a\xb4O)|uaM" DEBUG:localtuya.pytuya:decrypted result='{"dps":{"1":"stop","2":0,"3":100,"5":"forward","7":"closing","12":0}}' AVAILABLE DPS ARE [{'1': 'stop', '2': 0, '3': 100, '5': 'forward', '7': 'closing', '12': 0}] INFO:localtuya:COMPLETE response from device ebd3aed397cc278xxx [192.168.0.201].

deviceInfo returned OK

TuyaDebug (Tuya DPs dump) [1.0.0]

Device ebd3aed397cc278xxx at 192.168.0.201 key xxxxxx protocol 3.3 dev_type type_0a: DPS [1] VALUE [stop] DPS [2] VALUE [0] DPS [3] VALUE [100] DPS [5] VALUE [forward] DPS [7] VALUE [closing] DPS [12] VALUE [0]

Closed position report the same but DPS [3] VALUE [0]. Am I missing something?

Thanks for all work on tuyalocal.

aprets commented 3 years ago

If this is anything like the Zemismart motor I have (not tube), you sound like you need something like my config (#215). I am not sure what your config looks like, but I believe the open_close_stop should apply to DPS 1 for you. So maybe something like

- host: ...
  device_id: ...
  local_key: ...
  friendly_name: Working Blinds
  protocol_version: "3.3"
  entities:
    - platform: cover
      friendly_name: Working Blinds
      id: 1 # this is what open_close_stop use, not sure if you had this as 2 or something else
      commands_set: open_close_stop
      positioning_mode: position
    # position_inverted: true # not sure if you need this
      current_position_dp: 3
      set_position_dp: 2

will work?

clyra commented 3 years ago

Hi,

Thanks!!! The docs sugests to use "2" as the "id" (which I did), but "1" works better!