rospogrigio / localtuya

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

"Cover" entity unavailable #311

Open fahad-hasan opened 3 years ago

fahad-hasan commented 3 years ago

I have been trying to get a tuya garage door opener to work using Localtuya integration but no success yet. I have tried 3.1/3.2/master versions and combination of different ID/DPs but still no success. My lights work just fine and shows up with the correct state but the Garage Door opener doesnt. However, it works perfectly in the SmartLife app as well as using the Tuya cloud integration (shows up as a switch, so no door sensor but state works).

Any help is much appreciated. [

Screen Shot 2021-01-13 at 2 04 31 pm

](url)

Screen Shot 2021-01-13 at 2 08 43 pm

EDIT: Found some debug logs in HA which may be helpful?

Exception in _update_handler when dispatching 'localtuya_bf1a6cbfb4c6f7015enrcf': ({'1': True, '2': 0, '3': False, '4': 20, '5': 60},) Traceback (most recent call last): File "/config/custom_components/localtuya/common.py", line 239, in _update_handler self.status_updated() File "/config/custom_components/localtuya/cover.py", line 199, in status_updated if self._state.isupper(): AttributeError: 'bool' object has no attribute 'isupper'
Exception in _update_handler when dispatching 'localtuya_bf1a6cbfb4c6f7015enrcf': ({'1': True, '2': 0, '3': True, '4': 20, '5': 0},) Traceback (most recent call last): File "/config/custom_components/localtuya/common.py", line 239, in _update_handler self.status_updated() File "/config/custom_components/localtuya/cover.py", line 199, in status_updated if self._state.isupper(): AttributeError: 'bool' object has no attribute 'isupper'
fahad-hasan commented 3 years ago

The state seems to be working after downgrading to 3.0.1 but the open/close/on/off is not working. At the moment I am using a combination of tuya local and cloud to make it functional but any help to make it all local will be highly appreciated. Thanks!

ezz-91 commented 3 years ago

I have the same Issue, Garage Door Works Fine in 3.0.1, but any version after its broken. device shows unavailable

fahad-hasan commented 3 years ago

I have solved it by adding a separate sensor entity and a switch entity instead of a cover under the integration. Then I added a custom cover entity in the yaml combining both of them. So far working good.

jrunning commented 3 years ago

I have solved it by adding a separate sensor entity and a switch entity instead of a cover under the integration.

I had the same problem with my "NPL"-brand garage door opener and this worked for me as well. Thanks!

P.S. I think I can figure out how to add the custom cover entity but it might help others if you posted your configuration here.

fahad-hasan-ratul commented 3 years ago

P.S. I think I can figure out how to add the custom cover entity but it might help others if you posted your configuration here.

I actually had it documented for a mate of mine here. https://imgur.com/gallery/CsVw1DO