-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Climates TypeError #28
Comments
climate.py When I change line 261 to something like this above the entity is available. Maybe it's just an JSON decode error. I could not get _LOGGER.debug messages in log for better debugging. However, after this change the state of the device is not showing up correctly. 2021-06-26 13:15:42 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved |
@panic2k I am having issues with my Kogan Branded Heater. It works in the Tuya v1 integration in that I can control the temperature and turn it on or off. After installing tuya v2 my other devices which work on v1 also seems to work in v2. My heater however shows as a device with zero entities and therefore I have no control of anything, so it is worse than v1. I have exactly the same error a your first one in my HA log about line 261. I also do not get any debug logs working using my usual method.
|
@SgtBatten Logs supported in v1.3. |
@tsutsuku I will gladly assist with this investigation. In the log I have found a few items which may be what you are referring to. If you are after a specific parameter please let me know.
|
Hi, I also have a 'qn' heater. It only responds to limited commands so it also sees the same errors above for any command that the API does not support including min temp, modes, etc. I got it to work and show the entities by quickly hacking up climate.py to ignore those errors, and adding some support for 'on' (via modes). I'd like to have a go and implement this properly - however, I'm not sure how you'd like to go about it. I was thinking of creating a heater.py, but it sounds like there are qn heaters with fans etc, and if so perhaps tweaking climate.py is better? Here is what my qn heater does support: Function set:
State set:
|
I am very new to HA in general but also very keen to learn and decent at picking up things with good examples. To clarify, mine may not have a fan necessarily. It just has two modes high and low in the kogan/tuya app. high mode heats up faster is all i can really tell you. The Kogan website describes it as two heat settings. |
As i've found out, i have a air conditioner with type kt. { 2021-07-20 14:03:39 DEBUG (SyncWorker_2) [tuya iot] Request: method = GET, url = https://openapi.tuyaeu.com/v1.0/devices/bfb91179c47704014ajuni/specifications, params = None, body = None, headers = {'client_id': 'pj453rjxao4cymwnpruq', >2021-07-20 14:03:39 DEBUG (SyncWorker_2) [tuya iot] Response: { |
Also using a kt air conditioner, following error in logs using v1.4.0: Logger: homeassistant.components.climate Error adding entities for domain climate with platform tuya_v2 Device details from log: { |
Yes, it's the same issue. No modes are submitted from API for your device. Therefore Tuya_V2 rises the TypeError. |
I get the same with a different 'qn' category panel heater (Arlec heater from Australia) |
I am using the tuya v1 integration for my panel heater and have set up a scene for high and low power modes. Seems to work for my use case except that the scene indicator is only one-way communication so if it gets changed on the device or using the tuya app, HA doesn't know. Will be great once this is properly integrated in v2 |
Now that tuya v2 is the official integration this issue is more significant as i've lost the ability to turn the heater on and off which i had in v1 Any solutions @tsutsuku ? |
In the interim, have you tried tuya-local?
…On Mon, 11 Oct 2021, 10:38 am SgtBatten, ***@***.***> wrote:
Now that tuya v2 is the official integration this issue is more
significant as i've lost the ability to turn the heater on and off.
Any solutions @tsutsuku <https://github.com/tsutsuku> ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#28 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB7I6UJI23PAWDUZATBM5VLUGIPW5ANCNFSM47KQDD2A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
I have not, though it doesn't look like it supports climates yet? |
I have three climate devices working off tuya-local: some heatstrips, and a
pool inverter. They don't show up for me on the v2 release without patching.
…On Tue, 12 Oct 2021, 11:07 am SgtBatten, ***@***.***> wrote:
you tried tuya-local?
I have not, though it doesn't look like it supports climates yet?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#28 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB7I6UJ2VSNYC3I5LXFS3NTUGN32TANCNFSM47KQDD2A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
As mentioned by others, your device isn't reporting what modes it supports which is causing that error. This is out of the control of the Tuya Devs. You could try using the patched version of climate to see if that helps. You're probably better off using the HACS version of Tuya V2 rather than the official as the HACS version will always be more recent. Take a copy of your existing climate.py in case you want to restore it! |
I also have a problem with a qn heater. Tuya v2 integration is useless in this case, since although the device is detected, it has no entities. The culprit is the Tuya cloud binding/detection. The device is seen as a simple switch wiht json instruction set
Another device but with a newer Tuya firmware is detected correctly and works fine with Tuya v2 api. The instruction set is:
The wired and ugly part is that I cannot perform a firmware update in the official tuya app, which I have no clue why... ==== Any ideas what I can try? Somebody else with the same problem? |
Yesterday, Home Assistant 2022.2 was released. If not, Home Assistant 2022.2 contains a new diagnostic tool. There is now a "Download Diagnostics" button on each Tuya device on the device page. Clicking that button will download diagnostics information for that specific device. Drag the downloaded file into this issue. It will help with finding out what the problem is. |
Hi @frenck , Any clue? Diagnostics below: { |
2021-06-25 20:11:08 ERROR (MainThread) [homeassistant.components.climate] Error while setting up tuya_v2 platform for climate
Traceback (most recent call last):
File "/usr/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 258, in _async_setup_platform
await asyncio.gather(*pending)
File "/usr/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 383, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 499, in _async_add_entity
capabilities=entity.capability_attributes,
File "/usr/lib/python3.9/site-packages/homeassistant/components/climate/init.py", line 190, in capability_attributes
ATTR_HVAC_MODES: self.hvac_modes,
File "/var/lib/hass/custom_components/tuya_v2/climate.py", line 261, in hvac_modes
modes = json.loads(self.tuya_device.function.get(DPCODE_MODE, {}).values).get(
File "/usr/lib/python3.9/json/init.py", line 339, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not builtin_function_or_method
The text was updated successfully, but these errors were encountered: