smarthomej / addons

SmartHome/J addons for openHAB
Eclipse Public License 2.0
62 stars 26 forks source link

re-open of issue 319 - tuya bulb not working properly #577

Closed JacekKac closed 7 months ago

JacekKac commented 7 months ago

https://github.com/smarthomej/addons/issues/319 i have the same problem tried on different protovol versions 3.1 and 3.3 openhab-cli info

Version: 4.2.0-SNAPSHOT (#4035)

 Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
2024-04-14 12:01:00.869 [TRACE] [ssories.HomekitCharacteristicFactory] - getKeyFromMapping: characteristic Dummy, state off, mapping {OFF=off, HEAT=heat, COOL=COOL}
2024-04-14 12:05:13.036 [WARN ] [.internal.local.handlers.TuyaDecoder] - bf541f534610c30095es6v/192.168.0.17:6668 failed to parse JSON: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
2024-04-14 12:07:15.632 [WARN ] [.internal.local.handlers.TuyaDecoder] - bf541f534610c30095es6v/192.168.0.17:6668 failed to parse JSON: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
2024-04-14 12:07:24.950 [WARN ] [.internal.local.handlers.TuyaDecoder] - bf541f534610c30095es6v/192.168.0.17:6668 failed to parse JSON: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
2024-04-14 12:07:26.885 [WARN ] [.internal.local.handlers.TuyaDecoder] - bf541f534610c30095es6v/192.168.0.17:6668 failed to parse JSON: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
2024-04-14 12:09:59.968 [WARN ] [.internal.local.handlers.TuyaDecoder] - bf541f534610c30095es6v/192.168.0.17:6668 failed to parse JSON: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $

2024-04-14 12:13:47.409 [TRACE] [rnal.local.handlers.HeartbeatHandler] - bf541f534610c30095es6v/192.168.0.17:6668: Received pong
2024-04-14 12:13:48.667 [TRACE] [.internal.local.handlers.TuyaDecoder] - bf541f534610c30095es6v/192.168.0.17:6668: Received encoded '000055AA00000000000000080000004B00000000332E330000000000002773000000016E04B614C373F3A8B85D1807ECDEB568ABB8718F5E74E3E3C59F1CD457B2C20F84D8D403AD02D301A5F84B92BE44C2BA4178CE800000AA55'
2024-04-14 12:13:48.669 [TRACE] [.internal.local.handlers.TuyaDecoder] - bf541f534610c30095es6v/192.168.0.17:6668: Decoded raw payload: BE48DA9DC1DC2DBA97345C0DE81D9C24C753C28E0A7CE656236C3C395F1A06F67843484B17025D0D5D8EF1F75C92CD2D
2024-04-14 12:13:48.670 [WARN ] [.internal.local.handlers.TuyaDecoder] - bf541f534610c30095es6v/192.168.0.17:6668 failed to parse JSON: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
2024-04-14 12:13:49.264 [TRACE] [.internal.local.handlers.TuyaDecoder] - udpListener: Received encoded '000055AA00000000000000130000009C0000000023D01E5FEF56833314CEF60FB086ED33A4F52933251CE533155FD66B3DD8EBF2E2B3CE47E6910A5D3C14B8C7D62BBA8339CA06E7012CB25BE848A8D29A757227C2FB8459B1155FC75D4BF6699F92CBA4C0BA520148045E7605FA0498DFEA5AAB32908AD1626E2D7503771CF82556470E82B84964D4378EBADF3514B9C898D1186EDA8EEA40E93B1E3FC14A2570E182790BDD93C10000AA55'
2024-04-14 12:13:49.266 [TRACE] [.internal.local.handlers.TuyaDecoder] - udpListener: Decoded raw payload: 7B226970223A223139322E3136382E302E3137222C2267774964223A2262663534316635333436313063333030393565733676222C22616374697665223A322C2261626C696C7479223A302C22656E6372797074223A747275652C2270726F647563744B6579223A226B65797467356B713867766B76396468222C2276657273696F6E223A22332E33227D0505050505
2024-04-14 12:13:49.267 [DEBUG] [.internal.local.handlers.TuyaDecoder] - udpListener: Received MessageWrapper{commandType=UDP_NEW, content='DiscoveryMessage{ip='192.168.0.17', deviceId='bf541f534610c30095es6v', active=2, ability=0, mode=0, encrypt=true, productKey='keytg5kq8gvkv9dh', version='3.3', token= true, wf_cfg=true}'}
2024-04-14 12:13:49.272 [TRACE] [.internal.local.handlers.TuyaDecoder] - udpListener: Received encoded '000055AA00000000000000130000009C0000000023D01E5FEF56833314CEF60FB086ED33A4F52933251CE533155FD66B3DD8EBF2E2B3CE47E6910A5D3C14B8C7D62BBA8339CA06E7012CB25BE848A8D29A757227C2FB8459B1155FC75D4BF6699F92CBA4C0BA520148045E7605FA0498DFEA5AAB32908AD1626E2D7503771CF82556470E82B84964D4378EBADF3514B9C898D1186EDA8EEA40E93B1E3FC14A2570E182790BDD93C10000AA55'
2024-04-14 12:13:49.273 [TRACE] [.internal.local.handlers.TuyaDecoder] - udpListener: Decoded raw payload: 7B226970223A223139322E3136382E302E3137222C2267774964223A2262663534316635333436313063333030393565733676222C22616374697665223A322C2261626C696C7479223A302C22656E6372797074223A747275652C2270726F647563744B6579223A226B65797467356B713867766B76396468222C2276657273696F6E223A22332E33227D0505050505
2024-04-14 12:13:49.274 [DEBUG] [.internal.local.handlers.TuyaDecoder] - udpListener: Received MessageWrapper{commandType=UDP_NEW, content='DiscoveryMessage{ip='192.168.0.17', deviceId='bf541f534610c30095es6v', active=2, ability=0, mode=0, encrypt=true, productKey='keytg5kq8gvkv9dh', version='3.3', token= true, wf_cfg=true}'}
2024-04-14 12:13:54.449 [TRACE] [.internal.local.handlers.TuyaDecoder] - udpListener: Received encoded '000055AA00000000000000130000009C0000000023D01E5FEF56833314CEF60FB086ED33A4F52933251CE533155FD66B3DD8EBF2E2B3CE47E6910A5D3C14B8C7D62BBA8339CA06E7012CB25BE848A8D29A757227C2FB8459B1155FC75D4BF6699F92CBA4C0BA520148045E7605FA0498DFEA5AAB32908AD1626E2D7503771CF82556470E82B84964D4378EBADF3514B9C898D1186EDA8EEA40E93B1E3FC14A2570E182790BDD93C10000AA55'
2024-04-14 12:13:54.454 [TRACE] [.internal.local.handlers.TuyaDecoder] - udpListener: Decoded raw payload: 7B226970223A223139322E3136382E302E3137222C2267774964223A2262663534316635333436313063333030393565733676222C22616374697665223A322C2261626C696C7479223A302C22656E6372797074223A747275652C2270726F647563744B6579223A226B65797467356B713867766B76396468222C2276657273696F6E223A22332E33227D0505050505
2024-04-14 12:13:54.456 [DEBUG] [.internal.local.handlers.TuyaDecoder] - udpListener: Received MessageWrapper{commandType=UDP_NEW, content='DiscoveryMessage{ip='192.168.0.17', deviceId='bf541f534610c30095es6v', active=2, ability=0, mode=0, encrypt=true, productKey='keytg5kq8gvkv9dh', version='3.3', token= true, wf_cfg=true}'}
2024-04-14 12:13:54.470 [TRACE] [.internal.local.handlers.TuyaDecoder] - udpListener: Received encoded '000055AA00000000000000130000009C0000000023D01E5FEF56833314CEF60FB086ED33A4F52933251CE533155FD66B3DD8EBF2E2B3CE47E6910A5D3C14B8C7D62BBA8339CA06E7012CB25BE848A8D29A757227C2FB8459B1155FC75D4BF6699F92CBA4C0BA520148045E7605FA0498DFEA5AAB32908AD1626E2D7503771CF82556470E82B84964D4378EBADF3514B9C898D1186EDA8EEA40E93B1E3FC14A2570E182790BDD93C10000AA55'
2024-04-14 12:13:54.472 [TRACE] [.internal.local.handlers.TuyaDecoder] - udpListener: Decoded raw payload: 7B226970223A223139322E3136382E302E3137222C2267774964223A2262663534316635333436313063333030393565733676222C22616374697665223A322C2261626C696C7479223A302C22656E6372797074223A747275652C2270726F647563744B6579223A226B65797467356B713867766B76396468222C2276657273696F6E223A22332E33227D0505050505
2024-04-14 12:13:54.474 [DEBUG] [.internal.local.handlers.TuyaDecoder] - udpListener: Received MessageWrapper{commandType=UDP_NEW, content='DiscoveryMessage{ip='192.168.0.17', deviceId='bf541f534610c30095es6v', active=2, ability=0, mode=0, encrypt=true, productKey='keytg5kq8gvkv9dh', version='3.3', token= true, wf_cfg=true}'}

UID: tuya:tuyaDevice:bf541f534610c30095es6v
label: LED 9W RGB E-27 Spectrum SMART 1
thingTypeUID: tuya:tuyaDevice
configuration:
  pollingInterval: 0
  protocol: "3.1"
  productId: dquzdo1wremwobbz
  deviceId: bf541f534610c30095es6v
  localKey: d0cc00dde683a085
channels:
  - id: control_data
    channelTypeUID: tuya:string
    label: control_data
    configuration:
      dp: 28
  - id: scene_data
    channelTypeUID: tuya:string
    label: scene_data
    configuration:
      dp: 25
  - id: colour_data
    channelTypeUID: tuya:color
    label: colour_data
    configuration:
      dp: 24
      dp2: 20
  - id: bright_value
    channelTypeUID: tuya:dimmer
    label: bright_value
    configuration:
      min: 10
      dp: 22
      max: 1000
      dp2: 20
  - id: temp_value
    channelTypeUID: tuya:dimmer
    label: temp_value
    configuration:
      dp: 23
      max: 1000
      min: 0
  - id: work_mode
    channelTypeUID: tuya:string
    label: work_mode
    configuration:
      dp: 21
      range: white,colour,scene,music
  - id: countdown_1
    channelTypeUID: tuya:number
    label: countdown_1
    configuration:
      dp: 26
      max: 86400
      min: 0
J-N-K commented 7 months ago

Indeed the decoded payload makes no sense. Maybe the priovate key changed? Did you try deleting and re-adding the device?

JacekKac commented 7 months ago

you mean re-adding in the tuya app ?

JacekKac commented 7 months ago

@J-N-K i re-add it and now bridge is online, but bulb "config pending wairint for ip address"

JacekKac commented 7 months ago

ok, i remove the thing and add it again - the device key is now diffferent and it;s working ok