PaulAnnekov / tuyaha

Implements the special Tuya Home Assistant API.
Other
141 stars 106 forks source link

Tuya humidity/temperature sensor is recognized as switch #62

Closed Ikke-dus-nl closed 3 years ago

Ikke-dus-nl commented 3 years ago

Hi, I have a humidity/temperature sensor from Tuya. When I add this to HA it's recognized as switch. The outcome of the python script is: Got devices { 'header': {'code': 'SUCCESS', 'payloadVersion': 1}, 'payload': { 'devices': [ { 'data': {'online': True, 'state': False}, 'dev_type': 'switch', 'ha_type': 'switch', 'icon': 'https://images.tuyaeu.com/smart/program_category_icon/wsdcg.png', 'id': 'bf9996f02b0f65d4f4urak', 'name': 'Temperature Humidity Sensor'}], 'scenes': []}} How can I get te dev_type or ha_type to temperature sensor ?

luigdima commented 3 years ago

I have exactly the same problem :'(

mario595 commented 3 years ago

Same here...I wonder if there would be a fix for it without Tuya involvement.

loglux commented 3 years ago

The same

Getting devices
Got devices
{   'header': {'code': 'SUCCESS', 'payloadVersion': 1},
    'payload': {   'devices': [   {   'data': {'online': True, 'state': False},
                                      'dev_type': 'switch',
                                      'ha_type': 'switch',
                                      'icon': 'https://images.tuyaeu.com/smart/program_category_icon/wsdcg.png',
                                      'id': 'bf890f3b16dc3be1c6aijl',
                                      'name': 'Temperature Humidity Sensor'}],
                   'scenes': []}}
loglux commented 3 years ago

https://www.aliexpress.com/item/1005001736449244.html?spm=a2g0s.9042311.0.0.27424c4dtqhwxv

loglux commented 3 years ago

https://community.home-assistant.io/t/tuya-wifi-temperature-and-humidity-detect/269034/8

Slyszer commented 3 years ago

Yeah same here. Temp & Humid sensor showing up as a switch in HA. Can anybody help us get the temp sensor into the tuya api?

loglux commented 3 years ago

Please, send a message to Tuya as it described here.

sspalla commented 3 years ago

+1 here. Been looking for alternatives, still no luck :(

Any updates will be more than welcome :)

AdrianTindeche commented 3 years ago

Hi guys, I have exactly the same issue, i.e. either running the script you mentioned, or adding the temp & humidity sensor in HA, the temp sensor is recognized as a switch.

I understand that you (Paul Annenkov) cloned the abandoned Tuya API package and developed this tuyaha package, so I'm puzzled why you point to write an email to the unresponsive tuyasmart@tuya.com, once they abandoned it and you took it over...

As a side note, the script you recommend to run does not work for the Smart Life app, or at least not for me (neither in HA also). In Google Play store the Smart Life app I see (and installed) is from Volcano Technologies (https://play.google.com/store/apps/details?id=com.tuya.smartlife) and not from Tuya Inc, though the web address of the app points to tuya.com.

PaulAnnekov commented 3 years ago

why you point to write an email to the unresponsive tuyasmart@tuya.com

  1. That was an email of an account which developed original library. And developer of original library is Tuya Inc.
  2. This email doesn't auto-respond with "account doesn't exist", so at least this it still exists. Maybe somebody even reads it, just don't reply.

What do you propose?

the script you recommend to run does not work for the Smart Life app

Why it should? That script is for debug and partially mimics requests from the library.

PaulAnnekov commented 3 years ago

Write an email to Tuya, we can't fix it on our side.

AdrianTindeche commented 3 years ago

It would be good to read my whole sentences, and not part of them. Obviously, the author of tuyapy HA Python library is Tuya Inc, I can read that on their pypi.org page.

When you say "Cloned from the abandoned package tuyapy v0.1.3. This package implements a Tuya API endpoint that was specially designed for Home Assistant.", I take it that not only you simply cloned the abandoned tuyapi just for "bug fixing" of some of their existing functions, but you will develop on top of it and add new functions/sensors/whatever. But it looks like it's not the case.

I used the script exactly for the purpose mentioned by you (debug), i.e "(How) to check whether the API this library using can control your device?".

Anyway, I take it that your library is only meant only for bug fixing and nothing more.

Thanks for your contribution.

loglux commented 3 years ago

If Tuyya abandoned the library, it does make no sense to contact them. It's a time to abandon Tuya and switch to other more flexible or hackable producers.

All my Tuya WiFi smart plugs have already flashed to Tasmota. Zigbee devices linked to ZHA or Zigbee2mqtt. That is only one temperature sensors which I can give up on. I'm just not going to buy new Tuya WiFi devices.

I'm going to remove tuya plugin from HA and forget about it.

ollo69 commented 3 years ago

You must just keep in mind that all the fix implemented here should be considered as "work-around" for the TuyaAPI limitation because we are not able to work on API and Tuya at this moment is not interested to do this (we don't what future will reserve...). There are a lot of cheap devices available in the market that use Tuya, this library and related HA integration would like to help less advanced users in the integration of such devices. Advanced users should found alternative solution that solve all TuyaAPI limitation.

philhzss commented 3 years ago

https://github.com/tuya/tuya-home-assistant/issues/5#issuecomment-855518808

It looks like they are working on it? I've only been using Home Assistant for a few days but just stumbled upon this, looks promising since it's an official Tuya repo (I think)

PaulAnnekov commented 3 years ago

Wow, that's awesome. Tuya finally decided to handle bad integration with HA. I hope this custom component will be merged with HA Tuya component some day.