8000 Fix duplicate device trigger error in HA 2024.2 by mill1000 · Pull Request #2829 · merbanan/rtl_433 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix duplicate device trigger error in HA 2024.2 #2829

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

Merged

Conversation

mill1000
Copy link
Contributor
@mill1000 mill1000 commented Feb 9, 2024

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/

home-assistant/core#110072 (comment)

…icate trigger.

In HA2024.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.
@zuckschwerdt
Copy link
Collaborator

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

@deviantintegral
Copy link
Contributor

My doorbell uses the secret knock field, so it's not affected by this:

# Use secret_knock to trigger device automations for Honeywell ActivLink
# doorbells. We have this outside of mappings as we need to configure two
# different configuration topics.
secret_knock_mappings = [
{
"device_type": "device_automation",
"object_suffix": "Knock",
"config": {
"automation_type": "trigger",
"type": "button_short_release",
"subtype": "button_1",
"payload": 0,
}
},
{
"device_type": "device_automation",
"object_suffix": "Secret-Knock",
"config": {
"automation_type": "trigger",
"type": "button_triple_press",
"subtype": "button_1",
"payload": 1,
}
},
]

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?

@mill1000
Copy link
Contributor Author

I haven't seen any depreciation notices and it seems it was just a side effect of this bigger change home-assistant/core#108309

@GCV-Sleeper-Service
Copy link

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}`

@zuckschwerdt zuckschwerdt merged commit 9064ccd into merbanan:master Apr 9, 2024
@zuckschwerdt
Copy link
Collaborator

The change slipped through. Thanks for the reminder.

@mill1000 mill1000 deleted the issue/ha_proxy_device_triggers branch April 9, 2024 13:14
@GCV-Sleeper-Service
Copy link

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?

@zuckschwerdt
Copy link
Collaborator

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.

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

Successfully merging this pull request may close these issues.

4 participants
0