rtl_433 icon indicating copy to clipboard operation
rtl_433 copied to clipboard

Fix duplicate device trigger error in HA 2024.2

Open mill1000 opened this issue 5 months ago • 3 comments

Change the subtype of the BTN device trigger to avoid creating a duplicate trigger.

In HA 2024.2, device triggers are now identified as f"{device_id}_{trigger_type}_{trigger_subtype}", so each trigger must have a unique type/subtype combination per device.

Also note that the combination of type and subtype should be unique for a device. Per https://www.home-assistant.io/integrations/device_trigger.mqtt/

https://github.com/home-assistant/core/issues/110072#issuecomment-1935432495

mill1000 avatar Feb 09 '24 16:02 mill1000

Can some regular HA users check this? Do we need to change other keys? @kcpants @unverbraucht @deviantintegral

zuckschwerdt avatar Feb 10 '24 22:02 zuckschwerdt

My doorbell uses the secret knock field, so it's not affected by this: https://github.com/merbanan/rtl_433/blob/1e7e56ec1dfd000ef50b74fa6db65903e4fc43b4/examples/rtl_433_mqtt_hass.py#L767-L794

But from a static read, this change should be OK. Am I reading it right that this broke in HA without a deprecation period? Or did we miss a notice from before?

deviantintegral avatar Feb 17 '24 21:02 deviantintegral

I haven't seen any depreciation notices and it seems it was just a side effect of this bigger change https://github.com/home-assistant/core/pull/108309

mill1000 avatar Feb 21 '24 01:02 mill1000

Hello, what is the status to fix this error or how can it be fixed manually? I am constantly getting errors like this

`Config for device trigger Thermopro-TX2-9-3-74 Thermopro-TX2-9-3-74-BTN conflicts with existing device trigger, cannot set up trigger, got: {'automation_type': 'trigger', 'type': 'button_short_release', 'subtype': 'button_1', 'topic': 'rtl_433/9b13b3f4-rtl433/devices/Thermopro-TX2/9/3/74/button', 'device': {'identifiers': ['Thermopro-TX2-9-3-74'], 'name': 'Thermopro-TX2-9-3-74', 'model': 'Thermopro-TX2', 'manufacturer': 'rtl_433', 'connections': []}, 'encoding': 'utf-8', 'qos': 0, 'payload': None, 'value_template': None}

Config for device trigger Thermopro-TX2-9-1-129 Thermopro-TX2-9-1-129-BTN conflicts with existing device trigger, cannot set up trigger, got: {'automation_type': 'trigger', 'type': 'button_short_release', 'subtype': 'button_1', 'topic': 'rtl_433/9b13b3f4-rtl433/devices/Thermopro-TX2/9/1/129/button', 'device': {'identifiers': ['Thermopro-TX2-9-1-129'], 'name': 'Thermopro-TX2-9-1-129', 'model': 'Thermopro-TX2', 'manufacturer': 'rtl_433', 'connections': []}, 'encoding': 'utf-8', 'qos': 0, 'payload': None, 'value_template': None}

Config for device trigger Thermopro-TX2C-1-8 Thermopro-TX2C-1-8-BTN conflicts with existing device trigger, cannot set up trigger, got: {'automation_type': 'trigger', 'type': 'button_short_release', 'subtype': 'button_1', 'topic': 'rtl_433/9b13b3f4-rtl433/devices/Thermopro-TX2C/1/8/button', 'device': {'identifiers': ['Thermopro-TX2C-1-8'], 'name': 'Thermopro-TX2C-1-8', 'model': 'Thermopro-TX2C', 'manufacturer': 'rtl_433', 'connections': []}, 'encoding': 'utf-8', 'qos': 0, 'payload': None, 'value_template': None}`

invisible999 avatar Apr 09 '24 03:04 invisible999

The change slipped through. Thanks for the reminder.

zuckschwerdt avatar Apr 09 '24 10:04 zuckschwerdt

The change slipped through. Thanks for the reminder.

Sorry for clarifying question - to fix this, one needs to update HA to the newer version, RTL433 or both?

invisible999 avatar Apr 09 '24 15:04 invisible999

You just need the new rtl_433_mqtt_hass.py script, which might be the docker container you use, but it's not HA or rtl_433.

zuckschwerdt avatar Apr 09 '24 16:04 zuckschwerdt