diff --git a/src/simclient.py b/src/simclient.py index 7c8a411..577d796 100644 --- a/src/simclient.py +++ b/src/simclient.py @@ -919,8 +919,12 @@ def main(): logging.info(f"Subscribed to: {group_id_topic}") # Wenn beim Start eine group_id vorhanden ist, sofort Event-Topic abonnieren + # Reset event_topic so subscribe_event_topic always re-registers with the broker + # (broker loses all subscriptions on reconnect, even if our local state still has it) if current_group_id: logging.info(f"Subscribing to event topic for saved group_id: {current_group_id}") + nonlocal event_topic + event_topic = None # force re-subscribe regardless of previous state subscribe_event_topic(current_group_id) # Send discovery message after reconnection to re-register with server