Skip to content
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

[mqtt.homeassistant] ESPHome "Duplicate channels" warning in log #9711

Closed
TheNetStriker opened this issue Jan 6, 2021 · 3 comments · Fixed by #13518
Closed

[mqtt.homeassistant] ESPHome "Duplicate channels" warning in log #9711

TheNetStriker opened this issue Jan 6, 2021 · 3 comments · Fixed by #13518
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@TheNetStriker
Copy link

TheNetStriker commented Jan 6, 2021

I've implemented an ESPHome Thing in Openhab via the Homeassistant discovery. Now I'm getting a warning in the log every time OpenHab is starting up. I'm running OpenHab 3.0, but I also had this problem with 2.5. As far as I can tell the device works as expected, but maybe this error could have some side effects. The MQTT binding also sometimes have problems subscribing to some topics after startup on my system. I've reported that in this issue. I've also reported this in the community forum: https://community.openhab.org/t/oh3-mqtt-somtimes-issues-after-starting/113104

OpenHab Log

2021-01-05 23:35:02.848 [WARN ] [org.openhab.core.internal.common.WrappedScheduledExecutorService                                    ] - Scheduled runnable ended with an exception:
java.lang.IllegalArgumentException: Duplicate channels mqtt:homeassistant_500291e9f78b:4ce1d806:500291e9f78b:ESPsensorccs811_5Ftotal_5Fvolatile_5Forganic_5Fcompound#sensor
        at org.openhab.core.thing.util.ThingHelper.ensureUniqueChannels(ThingHelper.java:152) ~[?:?]
        at org.openhab.core.thing.util.ThingHelper.ensureUniqueChannels(ThingHelper.java:144) ~[?:?]
        at org.openhab.core.thing.util.ThingHelper.addChannelsToThing(ThingHelper.java:105) ~[?:?]
        at org.openhab.binding.mqtt.homeassistant.internal.handler.HomeAssistantThingHandler.accept(HomeAssistantThingHandler.java:292) ~[?:?]
        at org.openhab.binding.mqtt.homeassistant.internal.handler.HomeAssistantThingHandler.accept(HomeAssistantThingHandler.java:1) ~[?:?]
        at org.openhab.binding.mqtt.generic.tools.DelayedBatchProcessing.run(DelayedBatchProcessing.java:110) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]

Thing config

UID: mqtt:homeassistant_500291e9f78b:4ce1d806:500291e9f78b
label: AirQualityCellar75
thingTypeUID: mqtt:homeassistant_500291e9f78b
configuration:
  topics:
    - sensor/airqualitycellar75/bme280_pressure
    - sensor/airqualitycellar75/ccs811_total_volatile_organic_compound
    - sensor/airqualitycellar75/wifi_signal_sensor
    - sensor/airqualitycellar75/bme280_temperature
    - sensor/airqualitycellar75/ccs811_eco2_value
    - sensor/airqualitycellar75/bme280_humidity
  basetopic: homeassistant
bridgeUID: mqtt:broker:4ce1d806
location: Keller

MQTT topics

homeassistant/sensor/airqualitycellar75/wifi_signal_sensor/config {"unit_of_measurement":"dB","icon":"mdi:wifi","name":"WiFi Signal Sensor","state_topic":"airqualitycellar75/sensor/wifi_signal_sensor/state","availability_topic":"airqualitycellar75/availability","unique_id":"500291e9f78b-wifisignal","device":{"identifiers":"500291e9f78b","name":"airqualitycellar75","sw_version":"esphome v1.15.2 Dec  2 2020, 11:31:04","model":"PLATFORMIO_D1_MINI_PRO","manufacturer":"espressif"}}
homeassistant/sensor/airqualitycellar75/bme280_temperature/config {"unit_of_measurement":"°C","icon":"mdi:thermometer","name":"BME280 Temperature","state_topic":"airqualitycellar75/sensor/bme280_temperature/state","availability_topic":"airqualitycellar75/availability","unique_id":"ESPsensorbme280_temperature","device":{"identifiers":"500291e9f78b","name":"airqualitycellar75","sw_version":"esphome v1.15.2 Dec  2 2020, 11:31:04","model":"PLATFORMIO_D1_MINI_PRO","manufacturer":"espressif"}}
homeassistant/sensor/airqualitycellar75/bme280_pressure/config {"unit_of_measurement":"hPa","icon":"mdi:gauge","name":"BME280 Pressure","state_topic":"airqualitycellar75/sensor/bme280_pressure/state","availability_topic":"airqualitycellar75/availability","unique_id":"ESPsensorbme280_pressure","device":{"identifiers":"500291e9f78b","name":"airqualitycellar75","sw_version":"esphome v1.15.2 Dec  2 2020, 11:31:04","model":"PLATFORMIO_D1_MINI_PRO","manufacturer":"espressif"}}
homeassistant/sensor/airqualitycellar75/bme280_humidity/config {"unit_of_measurement":"%","icon":"mdi:water-percent","name":"BME280 Humidity","state_topic":"airqualitycellar75/sensor/bme280_humidity/state","availability_topic":"airqualitycellar75/availability","unique_id":"ESPsensorbme280_humidity","device":{"identifiers":"500291e9f78b","name":"airqualitycellar75","sw_version":"esphome v1.15.2 Dec  2 2020, 11:31:04","model":"PLATFORMIO_D1_MINI_PRO","manufacturer":"espressif"}}
homeassistant/sensor/airqualitycellar75/ccs811_eco2_value/config {"unit_of_measurement":"ppm","icon":"mdi:molecule-co2","name":"CCS811 eCO2 Value","state_topic":"airqualitycellar75/sensor/ccs811_eco2_value/state","availability_topic":"airqualitycellar75/availability","unique_id":"ESPsensorccs811_eco2_value","device":{"identifiers":"500291e9f78b","name":"airqualitycellar75","sw_version":"esphome v1.15.2 Dec  2 2020, 11:31:04","model":"PLATFORMIO_D1_MINI_PRO","manufacturer":"espressif"}}
homeassistant/sensor/airqualitycellar75/ccs811_total_volatile_organic_compound/config {"unit_of_measurement":"ppb","icon":"mdi:radiator","name":"CCS811 Total Volatile Organic Compound","state_topic":"airqualitycellar75/sensor/ccs811_total_volatile_organic_compound/state","availability_topic":"airqualitycellar75/availability","unique_id":"ESPsensorccs811_total_volatile_organic_compound","device":{"identifiers":"500291e9f78b","name":"airqualitycellar75","sw_version":"esphome v1.15.2 Dec  2 2020, 11:31:04","model":"PLATFORMIO_D1_MINI_PRO","manufacturer":"espressif"}}

Your Environment

OpenHab 3.0 running on Rasperry Pi 4 (OpenHabian)
Things are configured via the UI and Items with files.

I hope those infos are sufficient to analyze the problem.

@TheNetStriker TheNetStriker added the bug An unexpected problem or unintended behavior of an add-on label Jan 6, 2021
@leoguiders
Copy link
Contributor

leoguiders commented Jan 9, 2021

I also get these 'duplicate channels' Exceptions on startup for my ESPHome devices:

2021-01-09 10:30:04.023 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception:
java.lang.IllegalArgumentException: Duplicate channels mqtt:homeassistant_dc4f221d9653:d1e851a070:dc4f221d9653:dallas_2D753C01D607596328#sensor
        at org.openhab.core.thing.util.ThingHelper.ensureUniqueChannels(ThingHelper.java:152) ~[?:?]
        at org.openhab.core.thing.util.ThingHelper.ensureUniqueChannels(ThingHelper.java:144) ~[?:?]
        at org.openhab.core.thing.util.ThingHelper.addChannelsToThing(ThingHelper.java:105) ~[?:?]
        at org.openhab.binding.mqtt.homeassistant.internal.handler.HomeAssistantThingHandler.accept(HomeAssistantThingHandler.java:292) ~[?:?]
        at org.openhab.binding.mqtt.homeassistant.internal.handler.HomeAssistantThingHandler.accept(HomeAssistantThingHandler.java:1) ~[?:?]
        at org.openhab.binding.mqtt.generic.tools.DelayedBatchProcessing.run(DelayedBatchProcessing.java:110) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]

The channels contain the unique id of the dallas sensor so it is very unlikely that there are duplicates.

I also see that the MQTT broker is receiving 10 messages every minute (10 new temperature values) but the event log shows only few entries, e.g.:

2021-01-09 10:55:50.869 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SMAEnergyMeter_GridFeedinPower' changed from 1409.5999755859375 to 1486.0999755859375
2021-01-09 10:55:50.880 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SMAEnergyMeter_GridFeedinEnergy' changed from 7733.86181640625 to 7733.87451171875
2021-01-09 10:56:00.369 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'heatingeg_Temperature7' changed from 26.0625 to 26.1250
2021-01-09 10:56:00.452 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'heatingeg_Temperature8' changed from 26.6250 to 26.6875
2021-01-09 10:56:00.494 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'heatingeg_Temperature4' changed from 27.1250 to 27.1875
2021-01-09 10:56:00.503 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'heatingeg_Temperature5' changed from 26.8750 to 26.9375
2021-01-09 10:56:21.870 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SMAEnergyMeter_GridFeedinPower' changed from 1486.0999755859375 to 1514.0
2021-01-09 10:56:21.873 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SMAEnergyMeter_GridFeedinEnergy' changed from 7733.87451171875 to 7733.88671875

There should be 10 Events, one for each temperature sensor.

@TheNetStriker
Copy link
Author

Update: This problem still exists in OpenHab 3.1.

@fotoklaasje
Copy link

I have a similar problem with my open therm gateway. one of the sensor values gives this error every 4 seconds.

2022-01-24 11:10:51.399 [WARN ] [mmon.WrappedScheduledExecutorService] - Scheduled runnable ended with an exception: java.lang.IllegalArgumentException: Duplicate channels mqtt:homeassistant_otgw:fa428d31:otgw:otgw_2Dch2_5Fpresent#sensor at org.openhab.core.thing.util.ThingHelper.ensureUniqueChannels(ThingHelper.java:152) ~[?:?] at org.openhab.core.thing.util.ThingHelper.ensureUniqueChannels(ThingHelper.java:144) ~[?:?] at org.openhab.core.thing.util.ThingHelper.addChannelsToThing(ThingHelper.java:105) ~[?:?] at org.openhab.binding.mqtt.homeassistant.internal.handler.HomeAssistantThingHandler.accept(HomeAssistantThingHandler.java:292) ~[?:?] at org.openhab.binding.mqtt.homeassistant.internal.handler.HomeAssistantThingHandler.accept(HomeAssistantThingHandler.java:1) ~[?:?] at org.openhab.binding.mqtt.generic.tools.DelayedBatchProcessing.run(DelayedBatchProcessing.java:110) ~[?:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?] at java.lang.Thread.run(Thread.java:829) [?:?]

ssalonen added a commit to ssalonen/openhab2-addons that referenced this issue Oct 8, 2022
Fixes openhab#13517
Possibly resolves openhab#9711 and openhab#12295 as well.

Signed-off-by: Sami Salonen <ssalonen@gmail.com>
@lolodomo lolodomo changed the title [mqtt][homeassistant] ESPHome "Duplicate channels" warning in log [mqtt.homeassistant] ESPHome "Duplicate channels" warning in log Nov 12, 2022
andrasU pushed a commit to andrasU/openhab-addons that referenced this issue Dec 24, 2022
…topics update with content (openhab#13518)

* [mqtt.homeassistant] Fix for discovery topics that update with content

Fixes openhab#13517
Possibly resolves openhab#9711 and openhab#12295 as well.

* [mqtt.homeassistant] Sort channels before changing thing
* [mqtt.homeassistant] logging + removed unnecessary synchronization
* Resolve bunch of warnings in homeassistant bundle
* [mqtt.homeassistant] Handling null warnings and unnecessary null checks
* [mqtt.homeassistant] Removing unnecessary null checks

Signed-off-by: Sami Salonen <ssalonen@gmail.com>
Co-Authored-by: @antroids github handle
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
borazslo pushed a commit to borazslo/openhab-mideaac-addon that referenced this issue Jan 8, 2023
…topics update with content (openhab#13518)

* [mqtt.homeassistant] Fix for discovery topics that update with content

Fixes openhab#13517
Possibly resolves openhab#9711 and openhab#12295 as well.

* [mqtt.homeassistant] Sort channels before changing thing
* [mqtt.homeassistant] logging + removed unnecessary synchronization
* Resolve bunch of warnings in homeassistant bundle
* [mqtt.homeassistant] Handling null warnings and unnecessary null checks
* [mqtt.homeassistant] Removing unnecessary null checks

Signed-off-by: Sami Salonen <ssalonen@gmail.com>
Co-Authored-by: @antroids github handle
psmedley pushed a commit to psmedley/openhab-addons that referenced this issue Feb 23, 2023
…topics update with content (openhab#13518)

* [mqtt.homeassistant] Fix for discovery topics that update with content

Fixes openhab#13517
Possibly resolves openhab#9711 and openhab#12295 as well.

* [mqtt.homeassistant] Sort channels before changing thing
* [mqtt.homeassistant] logging + removed unnecessary synchronization
* Resolve bunch of warnings in homeassistant bundle
* [mqtt.homeassistant] Handling null warnings and unnecessary null checks
* [mqtt.homeassistant] Removing unnecessary null checks

Signed-off-by: Sami Salonen <ssalonen@gmail.com>
Co-Authored-by: @antroids github handle
nemerdaud pushed a commit to nemerdaud/openhab-addons that referenced this issue Feb 28, 2023
…topics update with content (openhab#13518)

* [mqtt.homeassistant] Fix for discovery topics that update with content

Fixes openhab#13517
Possibly resolves openhab#9711 and openhab#12295 as well.

* [mqtt.homeassistant] Sort channels before changing thing
* [mqtt.homeassistant] logging + removed unnecessary synchronization
* Resolve bunch of warnings in homeassistant bundle
* [mqtt.homeassistant] Handling null warnings and unnecessary null checks
* [mqtt.homeassistant] Removing unnecessary null checks

Signed-off-by: Sami Salonen <ssalonen@gmail.com>
Co-Authored-by: @antroids github handle
andrasU pushed a commit to andrasU/openhab-addons that referenced this issue Jan 6, 2024
…topics update with content (openhab#13518)

* [mqtt.homeassistant] Fix for discovery topics that update with content

Fixes openhab#13517
Possibly resolves openhab#9711 and openhab#12295 as well.

* [mqtt.homeassistant] Sort channels before changing thing
* [mqtt.homeassistant] logging + removed unnecessary synchronization
* Resolve bunch of warnings in homeassistant bundle
* [mqtt.homeassistant] Handling null warnings and unnecessary null checks
* [mqtt.homeassistant] Removing unnecessary null checks

Signed-off-by: Sami Salonen <ssalonen@gmail.com>
Co-Authored-by: @antroids github handle
Signed-off-by: Andras Uhrin <andras.uhrin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
3 participants