TheAgentK / tuya-mqtt

Nodejs-Script to combine tuyaapi and openhab via mqtt
MIT License
173 stars 81 forks source link

Sudenly wrong responses from tuya device #78

Closed JacekKac closed 2 years ago

JacekKac commented 2 years ago

Device: thermostate = configured and working both in the app, tuya-cli set/get. I get strange strings to mqqt server and then to openhab:

To Reproduce Steps to reproduce the behavior:

  1. Change on app or via tuya-cli
  2. DEBUG=* node tuya-mqtt.js
TuyAPI   payload: '3.3\u0000\u0000\u0000\u0000\u0000\u0000�\u001d\u0000\u0000\u0000\u0001\u0017���QGn\u0012��\u0000\u0019\u0012�!���0�\u001dN���#-0��\u0000h��h�|\b���eL/�A5',
  TuyAPI   leftover: false,
  TuyAPI   commandByte: 8,
  TuyAPI   sequenceN: 0
  TuyAPI } +0ms
  tuya-mqtt:tuyapi Received string data from device bfb80f70b6e3a8a205e0ru -> 33QGn0N0hheLA5 +5m
  TuyAPI Pinging 192.168.0.157 +2s
  TuyAPI Received data: 000055aa00000000000000090000000c00000000b051ab030000aa55 +96ms
  TuyAPI Parsed: +0ms
  TuyAPI { payload: false, leftover: false, commandByte: 9, sequenceN: 0 } +0ms
  TuyAPI Pong from 192.168.0.157 +3ms
  TuyAPI Pinging 192.168.0.157 +10s
  TuyAPI Received data: 000055aa00000000000000090000000c00000000b051ab030000aa55 +5ms
  TuyAPI Parsed: +0ms
  TuyAPI { payload: false, leftover: false, commandByte: 9, sequenceN: 0 } +1ms
  TuyAPI Pong from 192.168.0.157 +0ms
  TuyAPI Received data: 000055aa00000000000000080000004b00000000332e33000000000000ad1e0000000155b8969f10f864f32ff99094ed3e030db551bd74b13818f9e9f260c1128a23d89b162158edc0694492ea6a54f980712652343f0c0000aa55 +340ms
  TuyAPI Parsed: +1ms
  TuyAPI {
  TuyAPI   payload: '3.3\u0000\u0000\u0000\u0000\u0000\u0000ďż˝\u001e\u0000\u0000\u0000\u0001U���\u0010ďż˝dďż˝/����>\u0003\rďż˝Qďż˝tďż˝8\u0018���`ďż˝\u0012ďż˝#Řu0016!X��iD��jT��q&',

  TuyAPI   leftover: false,
  TuyAPI   commandByte: 8,
  TuyAPI   sequenceN: 0
  TuyAPI } +0ms
  tuya-mqtt:tuyapi Received string data from device bfb80f70b6e3a8a205e0ru -> 33UdQt8XiDjTq +13s
  TuyAPI Pinging 192.168.0.157 +10s
  TuyAPI Received data: 000055aa00000000000000090000000c00000000b051ab030000aa55 +53ms
  TuyAPI Parsed: +0ms
  TuyAPI { payload: false, leftover: false, commandByte: 9, sequenceN: 0 } +1ms
  TuyAPI Pong from 192.168.0.157 +0ms

Devices.conf


[
 {
    name: 'thermostat',
    id: 'bfb80f70b6e3a8a205e0ru',
    key: 'e1208bfb20d6cc82',
    template: {
      state: {
        key: 1,
        type: 'bool'
      },
      TargetTemp: {
        key: 2,
        type: 'float',
        topicMin: 1,
        topicMax: 100,
        stateMath: '/2',
        commandMath: '*2'
      },
      CurrentTemp: {
        key: 3,
        type: 'float',
        topicMin: 1,
        topicMax: 100,
        stateMath: '/2',
        commandMath: '*2'
      },
      FloorTemp: {
        key: 102,
        type: 'float',
        topicMin: 1,
        topicMax: 100,
        stateMath: '/2',
        commandMath: '*2'
       }

       }

 }
]
JacekKac commented 2 years ago

ah didnt update the device key in devices.conf