Comments (25)
Hi, thank you!
I think your issue contains all needed information, will try to add the device tomorrow.
from ha_tuya_ble.
@PlusPlus-ua Are there any updates on this? If you could give some general guidelines about how to add the support for this, I'd take a stab at it. Maybe this will serve as a general document for anyone willing to contribute to this project too.
from ha_tuya_ble.
Sorry, was quite busy on the work plus sleepless nights due to russian rocket strikes.
Your device needs new entity type - climate to be added to sources.
After that, adding new thermostat devices will be easy. I'll describe it in documentation later.
from ha_tuya_ble.
Could you please describe min and max target temperature for the device, it is absent from the original issue.
from ha_tuya_ble.
I'm sorry to hear that. I hope you and your family are in a safe place.
I don't find any configuration in the UI for min and max temperatures. On the TRV itself, the min temp I can set is always 5 and the max is 30. I think this setting is read only anyway and it is not very important.
from ha_tuya_ble.
I've added climate support, it's just first version, so I expect some errors.
from ha_tuya_ble.
Hi @PlusPlus-ua thank you very much for your work.
After adding the devices I have this error in the logs:
`Logger: homeassistant.components.climate
Source: custom_components/tuya_ble/climate.py:133
Integration: Klimat (documentation, issues)
First occurred: 20:38:38 (2 occurrences)
Last logged: 20:38:56
Error while setting up tuya_ble platform for climate
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/tuya_ble/climate.py", line 292, in async_setup_entry
entities.append(TuyaBLEClimate(
File "/config/custom_components/tuya_ble/climate.py", line 133, in init
self._attr_preset_modes = list(mapping.preset_mode_dp_ids.keys())
AttributeError: 'set' object has no attribute 'keys'`
from ha_tuya_ble.
Im getting a different error:
Logger: homeassistant.config_entries
Source: components/bluetooth/wrappers.py:272
First occurred: 1:14:45 AM (3 occurrences)
Last logged: 2:33:20 AM
Error setting up entry Thermostatic Radiator Valve 3498DE for tuya_ble
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/tuya_ble/__init__.py", line 45, in async_setup_entry
await device.initialize()
File "/config/custom_components/tuya_ble/tuya_ble/tuya_ble.py", line 280, in initialize
await self.update()
File "/config/custom_components/tuya_ble/tuya_ble/tuya_ble.py", line 320, in update
await self._send_packet(TuyaBLECode.FUN_SENDER_DEVICE_STATUS, bytes())
File "/config/custom_components/tuya_ble/tuya_ble/tuya_ble.py", line 851, in _send_packet
await self._ensure_connected()
File "/config/custom_components/tuya_ble/tuya_ble/tuya_ble.py", line 601, in _ensure_connected
client = await establish_connection(
File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 344, in establish_connection
await client.connect(
File "/usr/src/homeassistant/homeassistant/components/bluetooth/wrappers.py", line 272, in connect
connected = await super().connect(**kwargs)
File "/usr/local/lib/python3.10/site-packages/bleak/__init__.py", line 531, in connect
return await self._backend.connect(**kwargs)
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 204, in connect
reply = await self._bus.call(
File "/usr/local/lib/python3.10/site-packages/dbus_fast/aio/message_bus.py", line 371, in call
await future
asyncio.exceptions.CancelledError
from ha_tuya_ble.
Also:
This error originated from a custom integration.
Logger: custom_components.tuya_ble.tuya_ble.tuya_ble
Source: custom_components/tuya_ble/tuya_ble/tuya_ble.py:601
Integration: Tuya BLE
First occurred: 1:07:36 AM (21 occurrences)
Last logged: 2:33:05 AM
DC:23:4D:34:98:DE: device not found, not in range, or poor RSSI: None
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 204, in connect
reply = await self._bus.call(
File "/usr/local/lib/python3.10/site-packages/dbus_fast/aio/message_bus.py", line 371, in call
await future
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 344, in establish_connection
await client.connect(
File "/usr/src/homeassistant/homeassistant/components/bluetooth/wrappers.py", line 272, in connect
connected = await super().connect(**kwargs)
File "/usr/local/lib/python3.10/site-packages/bleak/__init__.py", line 531, in connect
return await self._backend.connect(**kwargs)
File "/usr/local/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 141, in connect
async with async_timeout(timeout):
File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 129, in __aexit__
self._do_exit(exc_type)
File "/usr/local/lib/python3.10/site-packages/async_timeout/__init__.py", line 212, in _do_exit
raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/config/custom_components/tuya_ble/tuya_ble/tuya_ble.py", line 601, in _ensure_connected
client = await establish_connection(
File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 361, in establish_connection
_raise_if_needed(name, device.address, exc)
File "/usr/local/lib/python3.10/site-packages/bleak_retry_connector/__init__.py", line 310, in _raise_if_needed
raise BleakNotFoundError(msg) from exc
bleak_retry_connector.BleakNotFoundError: DC:23:4D:34:98:DE - DC:23:4D:34:98:DE: Failed to connect:
from ha_tuya_ble.
Stupid error in climate entity, exactly as I've expected :)
I've committed changes, but haven't created a new version. Update please sources on your HA server from GitHub and restart HA.
from ha_tuya_ble.
The device is now detected and shows up immediately. However, the controls and entities do not seem to appear. Whatever shows is disabled and does not have a name. I'm not sure what degree control (-6 in the screenshot) refers to
from ha_tuya_ble.
Any errors in the log?
from ha_tuya_ble.
Logger: homeassistant.components.climate
Source: custom_components/tuya_ble/climate.py:277
Integration: Climate (documentation, issues)
First occurred: 10:09:22 AM (2 occurrences)
Last logged: 10:09:22 AM
Error adding entities for domain climate with platform tuya_ble
Error while setting up tuya_ble platform for climate
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 455, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 731, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 845, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 585, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 648, in _async_write_ha_state
available = self.available # only call self.available once per update cycle
File "/config/custom_components/tuya_ble/climate.py", line 277, in available
if result and self._mapping.is_available:
AttributeError: 'TuyaBLEClimateMapping' object has no attribute 'is_available'
from ha_tuya_ble.
Fixed, try again
from ha_tuya_ble.
It's the same result. I've tried re-adding the device.
But there seems to be a new error:
Logger: homeassistant.components.climate
Source: custom_components/tuya_ble/climate.py:133
Integration: Climate (documentation, issues)
First occurred: 11:28:10 AM (1 occurrences)
Last logged: 11:28:10 AM
Error while setting up tuya_ble platform for climate
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_setup_platform
await asyncio.shield(task)
File "/config/custom_components/tuya_ble/climate.py", line 292, in async_setup_entry
entities.append(TuyaBLEClimate(
File "/config/custom_components/tuya_ble/climate.py", line 133, in __init__
self._attr_preset_modes = list(mapping.preset_mode_dp_ids.keys())
AttributeError: 'set' object has no attribute 'keys'
from ha_tuya_ble.
That's strange, it looks like you have returned a previous version of code.
Ok, I've excluded away mode for now. Let's try to debug all another.
from ha_tuya_ble.
I've made sure I'm on the latest commit by comparing the contents of the climate.py
file between main
and my local copy. Unfortunately, nothing has changed in regard to the UI, but if I enable some of the disabled entities they do show icons (like antifrost, child lock...). The names are still not showing (they all have the name "Thermostatic Radiator Valve" but nothing specific like child lock or antifrost).
The latest error is:
Logger: homeassistant.components.climate
Source: components/climate/__init__.py:366
Integration: Climate (documentation, issues)
First occurred: 12:14:19 PM (4 occurrences)
Last logged: 12:15:50 PM
Error adding entities for domain climate with platform tuya_ble
Error while setting up tuya_ble platform for climate
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 455, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 731, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 845, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 585, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 649, in _async_write_ha_state
state = self._stringify_state(available)
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 591, in _stringify_state
if (state := self.state) is None:
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 242, in state
if self.hvac_mode is None:
File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 366, in hvac_mode
return self._attr_hvac_mode
AttributeError: 'TuyaBLEClimate' object has no attribute '_attr_hvac_mode'
from ha_tuya_ble.
![Screenshot 2023-06-04 at 12 30 27 PM](https://private-user-images.githubusercontent.com/1012761/243170783-12738407-224a-46ba-ac30-4cc4a7f426b7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTE2NDE2NzcsIm5iZiI6MTcxMTY0MTM3NywicGF0aCI6Ii8xMDEyNzYxLzI0MzE3MDc4My0xMjczODQwNy0yMjRhLTQ2YmEtYWMzMC00Y2M0YTdmNDI2YjcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDMyOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDAzMjhUMTU1NjE3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZWM3ODk3MzdlMDk3NzEyYjAxYjQ3MzYzZWZhMTg2M2M4YWFiZTlkZDM1MTgzM2JmZTFiOTczM2RlMGJiNzE4MSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.zekwbkH7rkqyQEdVrIjueglKtQ5Y4_bJxJJ3xhknMGA)
![Screenshot 2023-06-04 at 12 30 25 PM](https://private-user-images.githubusercontent.com/1012761/243170791-12926305-9454-411c-b340-e44ae461b382.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTE2NDE2NzcsIm5iZiI6MTcxMTY0MTM3NywicGF0aCI6Ii8xMDEyNzYxLzI0MzE3MDc5MS0xMjkyNjMwNS05NDU0LTQxMWMtYjM0MC1lNDRhZTQ2MWIzODIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDMyOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDAzMjhUMTU1NjE3WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTU2OWY3ZGZjMGJjOTYwMzM0MDM3NDE0YjQwODZlZGE3ZTE4NzI3YzhkOTJlM2RlYjYyMTk4NjJmMTQ3ZDE5MiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ._5j-lerqFJGcHohrUDAVIKxILKOngCmo_KUVlRtFVjs)
from ha_tuya_ble.
Actually something has changed in the UI, the main temperature control has showed up, but it's unavailable
from ha_tuya_ble.
Have no idea what is the error, but possible fixed
from ha_tuya_ble.
Seems to work now! Thanks!
One issue though: the current temp needs to be divided by 10
Do you know why the other switches do not show specific names? The entities IDs also lack suffixes like _antifreeze and _child_lock. Instead, they just use a number. Can I help with that?
from ha_tuya_ble.
I've adjusted the coefficient value for target temp, which fixed the issue. But actually setting the temperature to a new value does not seem to be working.
from ha_tuya_ble.
It turns out there's an issue in async_set_temperature
where the temp is mistakenly being multiplied by the humidity coefficient instead of the target temperature coefficient.
from ha_tuya_ble.
I'll contribute my fixes as soon as I've tested them all
from ha_tuya_ble.
Update here: #28
from ha_tuya_ble.
Related Issues (20)
- [New Device] Parkside X20V Team 4Ah and 8Ah battery Lidl HOT 13
- [New Device] revolt Radiator thermostat
- MOES Fingerbot Plus product id 6jcvqwh0 not working HOT 2
- Error when adding integration HOT 7
- Error on install: {"message":"Invalid handler specified"} HOT 9
- Integration missing after installation
- Support for Plantation Shutter motor requested
- Ceiling lights RGB +CCT smart bluetooth lights HOT 1
- Enable Smart grow light (zwd)
- Support for BLE Temperature and Humidity Sensor PT216 & PT19DB-2
- Error after updating to Home Assistant 2024.2.0 update HOT 40
- Is there anybody who can merge the Pull requests?? HOT 5
- Will This work with a ESPHome Bluetooth Proxy, or does it need to connect to the Bluetooth radio on my device running home assistant? HOT 1
- How to setup this integration? HOT 3
- installation issue HOT 1
- Possible error in _handle_command_or_response()
- Device is not registered in Tuya cloud HOT 9
- Tuya BLE integration import error after HA update 2024.1.0 HOT 1
- Error after HA update to: 2024.1.0 HOT 3
- [New Device] BLE Tuya e27 "Beacon RGBCW bulb" HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ha_tuya_ble.