milo526 / homebridge-tuya-web

Hoobs and Homebridge plugin for Tuya devices using Home Assistant Tuya Web Api
MIT License
219 stars 95 forks source link

Temperature Humidity Sensor not detected #437

Closed Kowa92 closed 2 years ago

Kowa92 commented 2 years ago

Hello,

the plugin doesn't recognize this Temperature Humidity Sensor...

This is a part of the log that your python test file (debug_discover.py) returns to me:

>>> %Run debug_discover.py
Getting credentials
Got credentials
{   'access_token': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    'expires_in': 864000,
    'refresh_token': 'xxxxxxxxxxxxxxxxxxxxxxxxx',
    'token_type': 'bearer'}
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/icon/ay1509430484182dhmed/1568711567fd83656b47e.png',
                                      'id': '22573240fcf5c4846e74',
                                      'name': 'Boiler'},
                                  {   'data': {'online': True, 'state': True},
                                      'dev_type': 'switch',
                                      'ha_type': 'switch',
                                      'icon': 'https://images.tuyaeu.com/smart/icon/ay15422864509092y6k8/1622259081104c41dc2b7.png',
                                      'id': 'bf47a5e3eede27afc7v38v',
                                      'name': 'RaspberryPi'}],
                   'scenes': []}}
!!! NOW REMOVE THIS FILE, SO YOUR CREDENTIALS (username, password) WON'T LEAK !!!

From these logs it is clear that the 2 switches are seen correctly but the temperature sensor has not been detected at all. Why this behavior?

Thanks!

milo526 commented 2 years ago

Sadly sensors are not exposed by Tuya through the API that this plugin uses (which is different from the API that for example the app on your phone uses), therefore we cannot expose them to homekit.