rospogrigio / localtuya

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

Minco M6 Thermostat climate entity stays at `unknown` after setup #1046

Open JeeCee1 opened 2 years ago

JeeCee1 commented 2 years ago

The problem

After successfully adding the above thermostat (through the cloud API) the entity in HA always stays at unknown.

Environment

Steps to reproduce

  1. Install local Tuya
  2. Add new device via cloud API. I only configured ID (DP 1), name, Setpoint (DP 2) and Current Temp (DP 3).
  3. Device successfully installs (see logs below)

Configuration configuration.yaml or config_flow

DP dump

If the HA logs are not sufficient, please let me know and I'll try to get a dump.

Provide Home Assistant taceback/logs

2022-09-23 09:45:31.629 INFO (MainThread) [homeassistant.components.climate] Setting up climate.localtuya
2022-09-23 09:45:31.635 DEBUG (MainThread) [custom_components.localtuya.climate] Initialized climate [US-Living-Thermostat]
2022-09-23 09:45:31.637 DEBUG (MainThread) [custom_components.localtuya.climate] [bf6...wpe] Adding climate.us_living_thermostat with configuration: {'id': 1, 'friendly_name': 'US-Living-Thermostat', 'target_temperature_dp': 2, 'current_temperature_dp': 3, 'platform': 'climate'}
2022-09-23 09:45:31.637 DEBUG (MainThread) [custom_components.localtuya.climate] [bf6...wpe] Restoring state for entity: US-Living-Thermostat - state: False
2022-09-23 09:45:31.652 DEBUG (MainThread) [custom_components.localtuya.common] [bf6...wpe] Connecting to 192.168.60.70
2022-09-23 09:45:31.659 DEBUG (MainThread) [custom_components.localtuya.common] [bf6...wpe] Retrieving initial state
2022-09-23 09:45:31.659 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Sending command status (device type: type_0a)
2022-09-23 09:45:31.660 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Send payload: b'{"gwId":"XXXXXXXXXXXXXXXXXXXXXX","devId":"XXXXXXXXXXXXXXXXXXXXXX"}'
2022-09-23 09:45:31.663 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Waiting for sequence number 0
2022-09-23 09:45:31.670 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Dispatching message TuyaMessage(seqno=0, cmd=10, retcode=0, payload=b"RU>\x1a\xd2^\xc8%d\x14\xa5t\x86Svm\x81\x86\xdd\xbdmV\xd8\x0e\xb1&0>\xc9'\x8f\xf7s\\\x1f\xe3\x11 \xf5\x92\xa6\xcbx\xdf\xed\xf8\x13\x80\xec\x8a\xea\xb5\xfdp\x1c\x91Wk\xb7+\x16\xf4\x05\x17\x97\x87\xff\xd9\xad\x0bJ\x06\x05\xb7r\x80\xe2\x1a\xbfi\xffOyG\xf2\xa8\x0b\xe9\xe2\xf0:\xf0\xfc\xc8\x95\xec\x07\xf0ts\xbd\xef\xc0\x99\xfa\xa9\xea\x02V'C\xb9|\x86#O\x83\xb5\xdf\x1a\\\xc1\x80n\xb2\xd3\x18\xe8\xb30\x91j\xdb\xbc\xa2\x96\x0b\x95\x11\xdf\x03j$vY;\xa48\x8c\x10T\x18\xb89\xb9\x15\xa0 '\xf5\x0e`\xd2%\xbe\xc4\x97\r\x86\x85=\xb8\xd0\xe2\x15S", crc=692963189)
2022-09-23 09:45:31.670 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Dispatching sequence number 0
2022-09-23 09:45:31.672 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Decrypted payload: {"dps":{"1":false,"2":0,"3":113,"4":"hot","5":"0","8":false,"13":true,"16":0,"20":-20,"21":60,"25":"1","26":false,"31":false,"41":"3","42":"1","101":false,"105":5,"107":35}}
2022-09-23 09:45:31.672 DEBUG (MainThread) [custom_components.localtuya.climate] [bf6...wpe] Attempting to restore state for entity: US-Living-Thermostat
2022-09-23 09:45:31.672 DEBUG (MainThread) [custom_components.localtuya.climate] [bf6...wpe] No current state for entity
2022-09-23 09:45:31.672 DEBUG (MainThread) [custom_components.localtuya.climate] [bf6...wpe] Entity US-Living-Thermostat (DP 1) - Restoring state: False
2022-09-23 09:45:31.672 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Sending command set (device type: type_0a)
2022-09-23 09:45:31.673 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Send payload: b'{"devId":"XXXXXXXXXXXXXXXXXXXXXX","uid":"XXXXXXXXXXXXXXXXXXXXXX","t":"1663919131","dps":{"1":false}}'
2022-09-23 09:45:31.680 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Waiting for sequence number 1
2022-09-23 09:45:31.683 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Started heartbeat loop
2022-09-23 09:45:31.683 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Sending command heartbeat (device type: type_0a)
2022-09-23 09:45:31.683 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Send payload: b'{}'
2022-09-23 09:45:31.685 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Waiting for sequence number -100
2022-09-23 09:45:31.691 DEBUG (MainThread) [custom_components.localtuya.climate] [bf6...wpe] Entity US-Living-Thermostat - Additional attributes: {'raw_state': False}
2022-09-23 09:45:31.693 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Dispatching message TuyaMessage(seqno=1, cmd=7, retcode=0, payload=b'', crc=2768611604)
2022-09-23 09:45:31.693 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Dispatching sequence number 1
2022-09-23 09:45:31.703 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Decrypted payload: {}
2022-09-23 09:45:31.737 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2022-09-23 09:45:31.737 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Got heartbeat response
2022-09-23 09:45:31.737 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Dispatching message TuyaMessage(seqno=0, cmd=8, retcode=0, payload=b'3.3\x00\x00\x00\x00\x00\x00\x1b+\x00\x00\x00\x01RU>\x1a\xd2^\xc8%d\x14\xa5t\x86Svmr\xafZMB\xe3\x00\xad\xa15$\x9c\rs\x1b\xee\xe7>\x014?;\x02\x98z\x80\x1b\xdd\x0b[\x89@\xd89,\xe1\xc2\xc9!\x06z\t\x08\x16$\x04\x1fa', crc=1486650490)
2022-09-23 09:45:31.737 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Got status update
2022-09-23 09:45:31.744 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Decrypted payload: {"dps":{"1":false},"type":"query","t":1663919130}
2022-09-23 09:45:31.745 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Decrypted payload: {}
2022-09-23 09:45:41.746 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Sending command heartbeat (device type: type_0a)
2022-09-23 09:45:41.747 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Send payload: b'{}'
2022-09-23 09:45:41.749 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Waiting for sequence number -100
2022-09-23 09:45:41.766 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Dispatching message TuyaMessage(seqno=0, cmd=9, retcode=0, payload=b'', crc=2958142211)
2022-09-23 09:45:41.766 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Got heartbeat response
2022-09-23 09:45:41.768 DEBUG (MainThread) [custom_components.localtuya.pytuya] [bf6...wpe] Decrypted payload: {}

Additional information

When I change settings on the thermostat they show up in the logs here, and when I control the thermostat through the Tuya app it also shows up in the logs, so the connection is working. It just doesn't make its way into HA.

Via the "official" Cloud Tuya integration it is fully working.

Thanks for any help!

JeeCee1 commented 1 year ago

Anyone?