dolezsa / thermal_comfort

Thermal Comfort sensor for HA (absolute humidity, heat index, dew point, thermal perception)
Other
580 stars 109 forks source link

"This combination of temperature and humidity sensors is already configured" #152

Open THX2112 opened 2 years ago

THX2112 commented 2 years ago

Getting the error message "This combination of temperature and humidity sensors is already configured" when trying to add an additional room sensor.

There are no other Thermal Comfort instances using these sensors. I renamed those room sensors just to make sure (they were showing up as the default sensors when configuring Thermal Comfort.)

No error messages in the logs. Updated everything to the latest versions.

THX2112 commented 2 years ago

Anyone?

Added a few more sensors and was able to use Thermal Comfort with them successfully. That one room is still giving the same error message though. Could there be a temporary cache or config file that isn't being deleted or something? I can't find anything.

rautesamtr commented 2 years ago

Do you have any info on the input sensors? Do they have a unique_id? The unique id generated is normaly temperature_sensor_unique_id-humidity_sensor_unique_id. The error sounds like theres already something configured with the same unique_id.

THX2112 commented 2 years ago

Where would I find this? The info page for the sensors just show the assigned name and entity ID. Nothing comes up at all when I search for "unique_id".

SergioRius commented 1 year ago

Do you have any info on the input sensors? Do they have a unique_id? The unique id generated is normaly temperature_sensor_unique_id-humidity_sensor_unique_id. The error sounds like theres already something configured with the same unique_id.

Nope. I've realized that the identifier is generated with the friendly name. I have a ble integration that creates all the sensors with unique unique_ids, but uses simply temperature/hummidity for the friendly names. Those throw the error just at the 2nd added.

But using other sensors that had unique ids and friendly names, eventually also gave me that error.

rautesamtr commented 1 year ago

I wasn't able to reproduce this yet. Any simple setup of sensors to reproduce it?

ovizii commented 1 year ago

I got the same error:

This combination of temperature and humidity sensors is already configured.

image

image

I already added the first one as a TC integration.

image

Trying to set up the second TC integration: image

image

CEllwart commented 1 year ago

I have the same error/problem here too.

rautesamtr commented 1 year ago

I added a debug message in regards of this error message in the latest release.

Don't forget to add debug output to your configuration:

logger:
  default: info
  logs:
…
    custom_components.thermal_comfort: debug
…

and look for the log message e.g.:

2023-02-07 12:43:09.204 DEBUG (MainThread) [custom_components.thermal_comfort.config_flow] An entry with the unique_id sensor_1-sensor_2 already exists: {'name': 'Outside', 'temperature_sensor': 'sensor.outside_temperature', 'humidity_sensor': 'sensor.outside_humidity', 'poll': False, 'scan_interval': 30, 'custom_icons': False}

So we can check if and which config entry already uses the unique_id.

CEllwart commented 1 year ago

2023-02-07 17:46:22.534 DEBUG (MainThread) [custom_components.thermal_comfort.config_flow] An entry with the unique_id 0xa4c1384f2926c9f1_temperature_zigbee2mqtt-0xa4c1384f2926c9f1_humidity_zigbee2mqtt already exists: {'name': 'Küche - Comfort', 'temperature_sensor': 'sensor.0xa4c1384f2926c9f1_temperature', 'humidity_sensor': 'sensor.0xa4c1384f2926c9f1_humidity', 'poll': False, 'scan_interval': 240, 'custom_icons': False}

The problem with this is: that sensor i want to add was configured within "Küche - Comfort" in the past. But it was deconfigured and is no longer in use there (and not shown).

grafik grafik

rautesamtr commented 1 year ago

I am unsure why home assistant keeps those old config entries. Could you check config/.storage/core.config_entries. You could try to delete the entry there, but make sure to stop home assistant before doing that and make a backup of the file.

djwafelap commented 3 months ago

I had the same message because I had reused two devices and solved it as follows:

A few months ago, I thought two of my thermometers were faulty, and replaced them with two new devices that were given the device name of the faulty thermometers. Later it turned out that the old thermometers were not defective, and I re-integrated them via zigbee2mqtt, but with a new device name (different room). These device were rejected by thermal comfort.

I played for a while with the unique_id's in the files /config/.storage/core.device_registry and /config/.storage/core.config_entries, but HA reversed my changes every time.

In the end, however, the solution was much simpler. I noticed that the entries under the old integration names had 2 devices.

image

So I simply deleted these integration entries from thermal comfort and reinstalled them with the same name. The problem was gone. After that I was able to install both of the integrations which had caused the error message before.

So if you have entries with two devices after the mentioned error message, this could be your solution!

2fst4u commented 2 months ago

I'm also getting this after I originally made the integration with two sensors (that I now want to use again) but I changed it to another pairing of sensors after creating. I now don't want to remove the working pair I have in case recreating both of them causes them both to give this error.

Topherfx commented 1 month ago

I'm getting the same message. I accidently deleted an integration entry und wanted to create it again with the same sensor. Something seems to be saved even though the Entry was deleted. Restarting HA a few times made no difference

Topherfx commented 1 month ago

Would be helpful to have a button "Forget old Configuration" or "create anyway" which deletes the old one. I don't feel competent enough to manually delete something from some config