Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Adding Unique ID to config #61

Open
controlcde opened this issue Apr 15, 2023 · 4 comments
Open

Adding Unique ID to config #61

controlcde opened this issue Apr 15, 2023 · 4 comments

Comments

@controlcde
Copy link

I want to add a unique id to my configuration to customize friendly name in HA UI after I read #52. My configuration is simple:

- platform: climate_group
  name: 'Heizung | Kinderzimmer Thermostate'
  temperature_unit: 'C'
  entities:
  - climate.thermostat_kinderzimmer_l
  - climate.thermostat_kinderzimmer_r

How could I enter unique id in configuration or will it build automatically? And whats the nomenclature for a unique id?

@snigehere
Copy link

I would support this - in order to share the defined climate group with Alexa (via HA Voice assistant configuration), and set up an alias for the entity, I need to have a unique ID

Snap10

@t-animal
Copy link

You need to install a beta version from hacs (I use 1.0.0-rc6), then change the config as following:

climate:
  - platform: climate_group
    name: 'Some Name'
    unique_id: some-uuid
    entities:
    - climate.yourtemp1
    - climate.yourtemp2

Instead of some-uuid you can put any uuid value from https://www.uuidgenerator.net/version4 . Just make sure you never re-use that value for another entity.

@magiva
Copy link

magiva commented Sep 14, 2023

why isnt this part of home assistant arghhh. glad someone made this

@snigehere
Copy link

snigehere commented Sep 16, 2023

Great - thanks for the update
I have installed the beta 1.0.0-rc6 and have added the ID which means I can share the entity with alexa however Its not working as expected.

I have two TRV's in my group - this is the configuration:
#group living room rad trv's - hacs integration

  • platform: climate_group
    name: "Living room radiator"
    unique_id: 664a190f-cf35-4347-aa52-b4657b05f36f
    temperature_unit: C # default to celsius, 'C' or 'F'
    entities:
    • climate.living_room_main_radiator
    • climate.living_room_side_radiator

The entity state of the group is not correct - it shows "Heat" even though both entities in the group show off... this is the developer tools view of the two entities and the group. The hvac_action attribute shows "Off" in all cases but the entity state does not match

Snap3

I have used the entity to try and set heat mode to off but that fails - the log shows:
Logger: homeassistant.components.websocket_api.http.connection
Source: components/shelly/climate.py:282
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 20:55:48 (2 occurrences)
Last logged: 21:16:52

[140433290673216] Setting state for entity living-room-main-radiator failed, state: {'target_t_enabled': 1, 'target_t': 4.0}, error: DeviceConnectionError()
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aioshelly/block_device/device.py", line 286, in http_request
resp: ClientResponse = await self.aiohttp_session.request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 467, in _request
with timer:
File "/usr/local/lib/python3.11/site-packages/aiohttp/helpers.py", line 721, in exit
raise asyncio.TimeoutError from None
TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/shelly/climate.py", line 277, in set_state_full_path
return await self.coordinator.device.http_request(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aioshelly/block_device/device.py", line 303, in http_request
raise DeviceConnectionError from err
aioshelly.exceptions.DeviceConnectionError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 227, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1969, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2006, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 235, in handle_service
return await service.entity_service_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 870, in entity_service_call
response_data = await _handle_entity_call(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 942, in _handle_entity_call
result = await task
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/shelly/climate.py", line 304, in async_set_hvac_mode
await self.set_state_full_path(
File "/usr/src/homeassistant/homeassistant/components/shelly/climate.py", line 282, in set_state_full_path
raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Setting state for entity living-room-main-radiator failed, state: {'target_t_enabled': 1, 'target_t': 4.0}, error: DeviceConnectionError()

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants