smarthomej / addons

SmartHome/J addons for openHAB
Eclipse Public License 2.0
59 stars 23 forks source link

Smart lock online but no item updates. #567

Closed smvsousa closed 2 months ago

smvsousa commented 5 months ago

Hi,

I've got a Tuya smart lock that I'm trying to integrate with OH4.1. Followed the cloud discovery process and device was detected as a general tuya device. Channels were created as per iot.tuya portal. The smart lock uses a low power wifi module meaning it goes offline when lock not used. Everything looks good, except for the fact that channels/items are always NULL. Nothing is updated.

Could you provide some guidance on what might be wrong?

Thanks a lot!

Logs and thing code below.

And OH's thing and channels:

image image
UID: tuya:tuyaDevice:bff9180fc5ae8d7765te0e
label: SmartLock
thingTypeUID: tuya:tuyaDevice
configuration:
  pollingInterval: 0
  protocol: "3.4"
  productId: bxq2o60gxhh2ben6
  deviceId: bff9180fc5ae8d7765te0e
  ip: 192.168.2.48
  localKey: *************
channels:
  - id: battery_state
    channelTypeUID: tuya:string
    label: battery_state
    description: null
    configuration:
      dp: 11
      range: high,medium,low,poweroff
  - id: unlock_fingerprint
    channelTypeUID: tuya:number
    label: unlock_fingerprint
    description: null
    configuration:
      dp: 1
      max: 999
      min: 0
  - id: alarm_lock
    channelTypeUID: tuya:string
    label: alarm_lock
    description: null
    configuration:
      dp: 8
      range: wrong_finger,wrong_password,wrong_card,wrong_face,tongue_bad,too_hot,unclosed_time,tongue_not_out,pry,key_in,low_battery,power_off,shock
  - id: unlock_password
    channelTypeUID: tuya:number
    label: unlock_password
    description: null
    configuration:
      dp: 2
      max: 999
      min: 0
  - id: unlock_face
    channelTypeUID: tuya:number
    label: unlock_face
    description: null
    configuration:
      dp: 6
      max: 999
      min: 0
  - id: unlock_hand
    channelTypeUID: tuya:number
    label: unlock_hand
    description: null
    configuration:
      dp: 23
      max: 999
      min: 0
  - id: unlock_app
    channelTypeUID: tuya:number
    label: unlock_app
    description: null
    configuration:
      dp: 15
      max: 999
      min: 0
  - id: unlock_request
    channelTypeUID: tuya:number
    label: unlock_request
    description: null
    configuration:
      dp: 9
      max: 90
      min: 0
  - id: hijack
    channelTypeUID: tuya:switch
    label: hijack
    description: null
    configuration:
      dp: 16
  - id: unlock_card
    channelTypeUID: tuya:number
    label: unlock_card
    description: null
    configuration:
      dp: 5
      max: 999
      min: 0
  - id: unlock_finger_vein
    channelTypeUID: tuya:number
    label: unlock_finger_vein
    description: null
    configuration:
      dp: 24
      max: 999
      min: 0
  - id: doorbell
    channelTypeUID: tuya:switch
    label: doorbell
    description: null
    configuration:
      dp: 19
  - id: unlock_temporary
    channelTypeUID: tuya:number
    label: unlock_temporary
    description: null
    configuration:
      dp: 3
      max: 999
      min: 0
  - id: unlock_dynamic
    channelTypeUID: tuya:number
    label: unlock_dynamic
    description: null
    configuration:
      dp: 4
      max: 999
      min: 0
2024-02-02 19:31:48.409 [DEBUG] [nding.tuya.internal.local.TuyaDevice] - bff9180fc5ae8d7765te0e/192.168.2.48:6668: Failed to connect: Connection refused: /192.168.2.48:6668
2024-02-02 19:31:48.410 [DEBUG] [a.internal.handler.TuyaDeviceHandler] - [tuya:ir-controller] stop ir learning
2024-02-02 19:31:53.417 [DEBUG] [.internal.local.handlers.TuyaEncoder] - bff9180fc5ae8d7765te0e/192.168.2.48:6668: Sending payload 2E5DBD9C50852ACC351EE902E80BC94A
2024-02-02 19:31:53.420 [TRACE] [.internal.local.handlers.TuyaEncoder] - bff9180fc5ae8d7765te0e/192.168.2.48:6668: Sending encoded '000055AA000000010000000300000044AB382A1E36F56AAE1925D5766F0177EBDE4414A1896C9BB70F635F0D71033C21FB653C6F5194BAE4F7104EEA3E8FF5D179C4ECC304B7618D77A57ACE32780B460000AA55'
2024-02-02 19:31:53.422 [DEBUG] [al.local.handlers.TuyaMessageHandler] - bff9180fc5ae8d7765te0e/192.168.2.48:6668: Connection established.
2024-02-02 19:31:53.441 [TRACE] [.internal.local.handlers.TuyaDecoder] - bff9180fc5ae8d7765te0e/192.168.2.48:6668: Received encoded '000055AA00000001000000030000002C00000001877BB2C9725C123DD64E54175EB74B1FDE4414A1896C9BB70F635F0D71033C21C52F0F450000AA55'
2024-02-02 19:31:53.444 [WARN ] [.internal.local.handlers.TuyaDecoder] - bff9180fc5ae8d7765te0e/192.168.2.48:6668: Checksum failed for message: calculated 0697BBA46075A10591C6796C8753D27CFC9AD42B862C5A06B11145B984AE0A76, found 725C123DD64E54175EB74B1FDE4414A1896C9BB70F635F0D71033C21C52F0F45
2024-02-02 19:31:53.425 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:tuyaDevice:bff9180fc5ae8d7765te0e' changed from OFFLINE to ONLINE
2024-02-02 19:31:54.282 [TRACE] [.internal.local.handlers.TuyaDecoder] - udpListener: Received encoded '000055AA00000000000000130000009C0000000097B93FEE4B69C95FEEB3D33BDA352952CAE3BCBB97B7AB171D606A47F0EE7132CB64D0726F59CBF10FF63730D7A89C6F374A4F1089F4EBB29FDCB11904D8703EC2FB8459B1155FC75D4BF6699F92CBA4C0BA520148045E7605FA0498DFEA5AAB3CE6FD8A0452D2B20DA957F6EC39BAA2D3E5D2D1D1F8CE1780D0AC42F237C8BA6EDA8EEA40E93B1E3FC14A2570E182796F76C3350000AA55'
2024-02-02 19:31:54.283 [TRACE] [.internal.local.handlers.TuyaDecoder] - udpListener: Decoded raw payload: 7B226970223A223139322E3136382E322E3438222C2267774964223A2262666639313830666335616538643737363574653065222C22616374697665223A322C2261626C696C7479223A302C22656E6372797074223A747275652C2270726F647563744B6579223A22627871326F3630677868683262656E36222C2276657273696F6E223A22332E33227D0505050505
2024-02-02 19:31:54.284 [DEBUG] [.internal.local.handlers.TuyaDecoder] - udpListener: Received MessageWrapper{commandType=UDP_NEW, content='DiscoveryMessage{ip='192.168.2.48', deviceId='bff9180fc5ae8d7765te0e', active=2, ability=0, mode=0, encrypt=true, productKey='**************', version='3.3', token= true, wf_cfg=true}'}
2024-02-02 19:32:03.434 [DEBUG] [.internal.local.handlers.TuyaEncoder] - bff9180fc5ae8d7765te0e/192.168.2.48:6668: Sending HEART_BEAT, payload {protocol=5, t=1706898723, data={ctype=0, dps=, cid=bff9180fc5ae8d7765te0e}}
2024-02-02 19:32:03.436 [TRACE] [.internal.local.handlers.TuyaEncoder] - bff9180fc5ae8d7765te0e/192.168.2.48:6668: Sending encoded '000055AA000000020000000900000084112EFDD607E8A24D7A93E974E699726AA355669FD147C4DDF8BCD2EBC89C0028486DD31A034B3F5091E1B5F3B5AAB9F86F8A11D92A173D6075575E6BBF4CD08265563A74351117D7830991ED2DE07BE586A823F0580479ADC6CF2C681DFEDB333CF727DD5F32512FA1EDE4E9B23865C17DD6776653E722AC8A025B7BE8A793430000AA55'
2024-02-02 19:32:13.444 [DEBUG] [.internal.local.handlers.TuyaEncoder] - bff9180fc5ae8d7765te0e/192.168.2.48:6668: Sending HEART_BEAT, payload {protocol=5, t=1706898733, data={ctype=0, dps=, cid=bff9180fc5ae8d7765te0e}}
2024-02-02 19:32:13.446 [TRACE] [.internal.local.handlers.TuyaEncoder] - bff9180fc5ae8d7765te0e/192.168.2.48:6668: Sending encoded '000055AA000000030000000900000084112EFDD607E8A24D7A93E974E699726ADFEE2333888B1805839C1D0B95819B42486DD31A034B3F5091E1B5F3B5AAB9F86F8A11D92A173D6075575E6BBF4CD08265563A74351117D7830991ED2DE07BE586A823F0580479ADC6CF2C681DFEDB3376CEB34C5932663B2E93937C9B196A03D43654F548CA3650EA01B8AFFE2F46B60000AA55'
2024-02-02 19:32:23.456 [DEBUG] [.internal.local.handlers.TuyaEncoder] - bff9180fc5ae8d7765te0e/192.168.2.48:6668: Sending HEART_BEAT, payload {protocol=5, t=1706898743, data={ctype=0, dps=, cid=bff9180fc5ae8d7765te0e}}
2024-02-02 19:32:23.458 [TRACE] [.internal.local.handlers.TuyaEncoder] - bff9180fc5ae8d7765te0e/192.168.2.48:6668: Sending encoded '000055AA000000040000000900000084112EFDD607E8A24D7A93E974E699726A031434C79E1F7D6FC1D8C507D5144945486DD31A034B3F5091E1B5F3B5AAB9F86F8A11D92A173D6075575E6BBF4CD08265563A74351117D7830991ED2DE07BE586A823F0580479ADC6CF2C681DFEDB336CFD27705BEFCC98FA3DEF97C831903D0125B99D8E18849BC92A77E40262F8EE0000AA55'
2024-02-02 19:32:30.696 [TRACE] [ding.tuya.internal.cloud.TuyaOpenAPI] - Sending to 'https://openapi.tuyaeu.com/v1.0/users/eu17066378260765WFVe/devices?from=&page_no=1&page_size=100': Method = {GET}, Headers = {Accept-Encoding: gzip, User-Agent: Jetty/9.4.52.v20230823, sign: B93F41B892DFA04BE194167B64E51571F14425A119E9F0381D6C5F96078F47F6, client_id: r5mqc5peqmma9f8ucdu9, t: 1706898750694, Signature-Headers: client_id, sign_method: HMAC-SHA256, access_token: ***************************}, Content = {null}
2024-02-02 19:32:31.009 [TRACE] [a.internal.cloud.TuyaContentListener] - Received from 'https://openapi.tuyaeu.com/v1.0/users/eu17066378260765WFVe/devices?from=&page_no=1&page_size=100': Code = {200}, Headers = {Content-Type: application/json;charset=UTF-8, Content-Length: 1125, Connection: keep-alive, Date: Fri, 02 Feb 2024 18:32:30 GMT, Access-Control-Allow-Credentials: true, Access-Control-Allow-Headers: , Access-Control-Allow-Headers: access_token,Content-Type, Access-Control-Allow-Methods: POST, Access-Control-Allow-Methods: OPTIONS, Access-Control-Allow-Methods: GET, Access-Control-Allow-Methods: DELETE, Access-Control-Allow-Methods: PUT, Access-Control-Allow-Origin: https://iot.tuya.com, Gateway-Info: highway, Server: Sec, Strict-Transport-Security: max-age=31536000}, Content = {{"result":[{"active_time":1706831541,"biz_type":0,"category":"ms","create_time":1706831541,"icon":"smart/icon/ay1547457421489gOxPi/c5a832c6cf05fafec2a40a5afc4aef3a.png","id":"bff9180fc5ae8d7765te0e","ip":"82.154.139.106","lat":"38.7100","local_key":"******************","lon":"-9.2000","model":"","name":"SmartLock","online":true,"owner_id":"182266022","product_id":"bxq2o60gxhh2ben6","product_name":"SmartLock","status":[{"code":"unlock_fingerprint","value":2},{"code":"unlock_password","value":1},{"code":"unlock_temporary","value":0},{"code":"unlock_dynamic","value":980},{"code":"unlock_card","value":0},{"code":"unlock_face","value":0},{"code":"alarm_lock","value":"wrong_finger"},{"code":"unlock_request","value":0},{"code":"battery_state","value":"medium"},{"code":"unlock_app","value":970},{"code":"hijack","value":false},{"code":"doorbell","value":false},{"code":"unlock_hand","value":0},{"code":"unlock_finger_vein","value":0}],"sub":false,"time_zone":"+00:00","uid":"eu17066378260765WFVe","update_time":1706898709,"uuid":"c97eb61811b2955a"}],"success":true,"t":1706898750982,"tid":"6caa1c30c1f911eeb4711ef527e2ea42"}}
2024-02-02 19:32:31.012 [TRACE] [ding.tuya.internal.cloud.TuyaOpenAPI] - Sending to 'https://openapi.tuyaeu.com/v1.0/iot-03/devices/factory-infos?device_ids=bff9180fc5ae8d7765te0e': Method = {GET}, Headers = {Accept-Encoding: gzip, User-Agent: Jetty/9.4.52.v20230823, sign: D5D4E72592130C8D2CA0B464A1F0F34CAA2B1FB7C71CA686A7BA89532DA1A63F, client_id: r5mqc5peqmma9f8ucdu9, t: 1706898751011, Signature-Headers: client_id, sign_method: HMAC-SHA256, access_token: 559ad1ec561b1ee30bf378b3c7f5cbde}, Content = {null}
2024-02-02 19:32:31.100 [TRACE] [a.internal.cloud.TuyaContentListener] - Received from 'https://openapi.tuyaeu.com/v1.0/iot-03/devices/factory-infos?device_ids=bff9180fc5ae8d7765te0e': Code = {200}, Headers = {Content-Type: application/json;charset=UTF-8, Content-Length: 187, Connection: keep-alive, Date: Fri, 02 Feb 2024 18:32:31 GMT, Access-Control-Allow-Credentials: true, Access-Control-Allow-Headers: , Access-Control-Allow-Headers: access_token,Content-Type, Access-Control-Allow-Methods: POST, Access-Control-Allow-Methods: OPTIONS, Access-Control-Allow-Methods: GET, Access-Control-Allow-Methods: DELETE, Access-Control-Allow-Methods: PUT, Access-Control-Allow-Origin: https://iot.tuya.com, Gateway-Info: highway, Server: Sec, Strict-Transport-Security: max-age=31536000}, Content = {{"result":[{"id":"bff9180fc5ae8d7765te0e","mac":"d8d668580401","sn":"100133092006F1","uuid":"c97eb61811b2955a"}],"success":true,"t":1706898751074,"tid":"6cbc229fc1f911ee847d96852008b4f4"}}
2024-02-02 19:32:31.102 [TRACE] [ding.tuya.internal.cloud.TuyaOpenAPI] - Sending to 'https://openapi.tuyaeu.com/v1.1/devices/bff9180fc5ae8d7765te0e/specifications': Method = {GET}, Headers = {Accept-Encoding: gzip, User-Agent: Jetty/9.4.52.v20230823, sign: 70ECC8D7C383EED7CC5D8F9B1A0C14E9EB0A8FD29ECEA9FB0F486E774BDE77A7, client_id: r5mqc5peqmma9f8ucdu9, t: 1706898751101, Signature-Headers: client_id, sign_method: HMAC-SHA256, access_token: 559ad1ec561b1ee30bf378b3c7f5cbde}, Content = {null}
2024-02-02 19:32:31.187 [TRACE] [a.internal.cloud.TuyaContentListener] - Received from 'https://openapi.tuyaeu.com/v1.1/devices/bff9180fc5ae8d7765te0e/specifications': Code = {200}, Headers = {Content-Type: application/json;charset=UTF-8, Content-Length: 1750, Connection: keep-alive, Date: Fri, 02 Feb 2024 18:32:31 GMT, Access-Control-Allow-Credentials: true, Access-Control-Allow-Headers: , Access-Control-Allow-Headers: access_token,Content-Type, Access-Control-Allow-Methods: POST, Access-Control-Allow-Methods: OPTIONS, Access-Control-Allow-Methods: GET, Access-Control-Allow-Methods: DELETE, Access-Control-Allow-Methods: PUT, Access-Control-Allow-Origin: https://iot.tuya.com, Gateway-Info: highway, Server: Sec, Strict-Transport-Security: max-age=31536000}, Content = {{"result":{"category":"ms","functions":[],"status":[{"code":"unlock_fingerprint","dp_id":1,"type":"Integer","values":"{\"unit\":\"\",\"min\":0,\"max\":999,\"scale\":0,\"step\":1}"},{"code":"unlock_password","dp_id":2,"type":"Integer","values":"{\"min\":0,\"max\":999,\"scale\":0,\"step\":1}"},{"code":"unlock_temporary","dp_id":3,"type":"Integer","values":"{\"min\":0,\"max\":999,\"scale\":0,\"step\":1}"},{"code":"unlock_dynamic","dp_id":4,"type":"Integer","values":"{\"min\":0,\"max\":999,\"scale\":0,\"step\":1}"},{"code":"unlock_card","dp_id":5,"type":"Integer","values":"{\"min\":0,\"max\":999,\"scale\":0,\"step\":1}"},{"code":"unlock_face","dp_id":6,"type":"Integer","values":"{\"min\":0,\"max\":999,\"scale\":0,\"step\":1}"},{"code":"alarm_lock","dp_id":8,"type":"Enum","values":"{\"range\":[\"wrong_finger\",\"wrong_password\",\"wrong_card\",\"wrong_face\",\"tongue_bad\",\"too_hot\",\"unclosed_time\",\"tongue_not_out\",\"pry\",\"key_in\",\"low_battery\",\"power_off\",\"shock\"]}"},{"code":"unlock_request","dp_id":9,"type":"Integer","values":"{\"min\":0,\"max\":90,\"scale\":0,\"step\":1}"},{"code":"battery_state","dp_id":11,"type":"Enum","values":"{\"range\":[\"high\",\"medium\",\"low\",\"poweroff\"]}"},{"code":"unlock_app","dp_id":15,"type":"Integer","values":"{\"min\":0,\"max\":999,\"scale\":0,\"step\":1}"},{"code":"hijack","dp_id":16,"type":"Boolean","values":"{}"},{"code":"doorbell","dp_id":19,"type":"Boolean","values":"{}"},{"code":"unlock_hand","dp_id":23,"type":"Integer","values":"{\"min\":0,\"max\":999,\"scale\":0,\"step\":1}"},{"code":"unlock_finger_vein","dp_id":24,"type":"Integer","values":"{\"min\":0,\"max\":999,\"scale\":0,\"step\":1}"}]},"success":true,"t":1706898751160,"tid":"6cca180bc1f911ee8dbf8219ab76da64"}}
2024-02-02 19:32:32.997 [TRACE] [ding.tuya.internal.cloud.TuyaOpenAPI] - Sending to 'https://openapi.tuyaeu.com/v1.0/token/cd2ef10c24bd29895e70b1b3fa9efd04': Method = {GET}, Headers = {Accept-Encoding: gzip, User-Agent: Jetty/9.4.52.v20230823, sign: C27A5513BCA9302F9C5115C158E287318FE97AFC5A7966A1787F69CCEFD34D3E, client_id: r5mqc5peqmma9f8ucdu9, t: 1706898752995, Signature-Headers: client_id, sign_method: HMAC-SHA256, access_token: ********************}, Content = {null}
2024-02-02 19:32:33.074 [TRACE] [a.internal.cloud.TuyaContentListener] - Received from 'https://openapi.tuyaeu.com/v1.0/token/cd2ef10c24bd29895e70b1b3fa9efd04': Code = {200}, Headers = {Content-Type: application/json;charset=UTF-8, Content-Length: 235, Connection: keep-alive, Date: Fri, 02 Feb 2024 18:32:33 GMT, Access-Control-Allow-Credentials: true, Access-Control-Allow-Headers: , Access-Control-Allow-Headers: access_token,Content-Type, Access-Control-Allow-Methods: POST, Access-Control-Allow-Methods: OPTIONS, Access-Control-Allow-Methods: GET, Access-Control-Allow-Methods: DELETE, Access-Control-Allow-Methods: PUT, Access-Control-Allow-Origin: https://iot.tuya.com, Gateway-Info: highway, Server: Sec, Strict-Transport-Security: max-age=31536000}, Content = {{"result":{"access_token":"******************","expire_time":7200,"refresh_token":"*******************","uid":"eu17066378260765WFVe"},"success":true,"t":1706898753048,"tid":"6deb0fb8c1f911ee8eb5fe6a6f85d0cd"}}
2024-02-02 19:32:33.076 [DEBUG] [ding.tuya.internal.cloud.TuyaOpenAPI] - Got token: Token{accessToken='**********************', refreshToken='**********************', uid='eu17066378260765WFVe', expire=7200', expireTimestamp=1706905953048}
2024-02-02 19:32:33.466 [DEBUG] [al.local.handlers.TuyaMessageHandler] - bff9180fc5ae8d7765te0e/192.168.2.48:6668: Connection terminated.
2024-02-02 19:32:33.467 [DEBUG] [a.internal.handler.TuyaDeviceHandler] - [tuya:ir-controller] stop ir learning
2024-02-02 19:32:33.468 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'tuya:tuyaDevice:bff9180fc5ae8d7765te0e' changed from ONLINE to OFFLINE
2024-02-02 19:32:40.471 [DEBUG] [nding.tuya.internal.local.TuyaDevice] - bff9180fc5ae8d7765te0e/192.168.2.48:6668: Failed to connect: connection timed out: /192.168.2.48:6668
2024-02-02 19:32:40.472 [DEBUG] [a.internal.handler.TuyaDeviceHandler] - [tuya:ir-controller] stop ir learning
stale[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.