TUYA integration has a bug and I need help on how to best debug it

I’ve got a number of switches and just bought 2 lights by tuya. Everything works but fine on HA except for one light that is recognized as a switch. It looks and works identically to the other light in the smart life (tuya) app.

So i want to know if the problem is with the api call to their server on discovery of if HA is messing up in parsing the response. I’ve done my best to look at the raw comms but i don’t think it’s the raw comms as it has a homeassistant field added to it (ha_type).

This is what the light that is recognized as a light looks like in the response…

   'data': {
        'brightness': '25',
        'color_mode': 'colour',
        'online': False,
        'state': 'true',
        'color_temp': 1671
      },
      'name': 'Smart Bulb',
      'icon': 'https://images.tuyaus.com/smart/product_icon/dj.png',
      'id': '800061668caab5007512',
      'dev_type': 'light',
      'ha_type': 'light'
    }, {
      'data': {
        'online': True,
        'state': True
      },

and the light that is not recognized properly…

'data': {
        'online': True,
        'state': False
      },
      'name': 'Smart Bulb',
      'icon': 'https://images.tuyaus.com/smart/product_icon/dj.png',
      'id': '24887008d8bfc0dae643',
      'dev_type': 'switch',
      'ha_type': 'switch'
    }],

How do i get to the raw comms and see where the light is being set to a swtich in HA if that’s the case?

Any other advice on how to debug this would be great.

Thanks!
Reza

2 Likes

Replying here for completeness. After some long conversations with Tuya, they said it was the bulb manufacturer’s problem (Teckin). I contacted them and they eventually said it was a firmware bug in their light. They pushed out an update and that fixed it.

Strangest thing is that one light worked, one light didn’t, and they were packaged together. But the way they had the bulbs configured with Tuya was that one was a light and the other was a switch?! New firmware fixed it though and it popped right up in HA.

1 Like

I’m having the exact same problem with some Merkury bulbs. Was it a difficult process to convince Teckin to put out a firmware update? Any tips on how you explained it to them? I’m going to contact Merkury and try to get them to do the same as I’m not the only person dealing with this.

1 Like

Any advice as to how you got Teckin to address the issue? I’m going in circles with Merkury. I’ve sent them all of the information that I can including examples of the API responses etc but I can’t seem to make them understand that the problem is not in their particular app. They just keep telling me that they have confirmed that the bulbs are registered as lights.