From 59414799499ce18ec79bdf73043848897f5dea35 Mon Sep 17 00:00:00 2001 From: Maciej Majewski Date: Thu, 7 Apr 2022 14:00:11 +0200 Subject: [PATCH] Fix device triggers when using custom MQTT topic (#60) --- python_scripts/shellies_discovery_gen2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_scripts/shellies_discovery_gen2.py b/python_scripts/shellies_discovery_gen2.py index ab74a4c..39de98c 100644 --- a/python_scripts/shellies_discovery_gen2.py +++ b/python_scripts/shellies_discovery_gen2.py @@ -978,7 +978,7 @@ def get_input(input_id, input_type, event): payload = { KEY_AUTOMATION_TYPE: VALUE_TRIGGER, - KEY_TOPIC: f"{device_id}/events/rpc", + KEY_TOPIC: f"{default_topic}events/rpc", KEY_PAYLOAD: f"{input_id}_{event}", KEY_VALUE_TEMPLATE: "{{value_json.params.events.0.id}}_{{value_json.params.events.0.event}}", KEY_QOS: qos,