Ankündigung

Einklappen
Keine Ankündigung bisher.

mqtt - Anfängerfrage bzw. bitte um Hilfe

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    mqtt - Anfängerfrage bzw. bitte um Hilfe

    Hallo zusammen,

    nachdem ich nun einige Stunden mit Probieren und suchen zugebracht habe möchte ich mal die Schwarmintelligenz befragen.
    Ich versuche in SHNG zigbee2mqtt zum laufen zu bringen. Ich scheitere aber schon daran, das mqtt nicht richtig läuft.
    Anmerkung: ich kann das localhost:8080 zigbee interface aufrufen und erhalte dort auch Meldungen und mein Geräte.

    Wenn ich SHNG starte kann ich im LOG folgendes sehen:

    2025-01-22 14:45:09 NOTICE lib.smarthome -------------------- SmartHomeNG restarting, initiated by admin interface --------------------
    2025-01-22 14:45:23 NOTICE lib.smarthome -------------------- SmartHomeNG stopped --------------------
    2025-01-22 14:45:24 NOTICE lib.smarthome -------------------- Init SmartHomeNG v1.10.0-master (4b25822a0) --------------------
    2025-01-22 14:45:24 NOTICE lib.smarthome Running in Python interpreter 'v3.10.12 final', from directory /usr/local/smarthome
    2025-01-22 14:45:24 NOTICE lib.smarthome - operating system 'Linux Mint 21.3' (pid=282699)
    2025-01-22 14:45:25 NOTICE lib.smarthome - on 'Intel(R) Core(TM) i5-7400T CPU @ 2.40GHz'
    2025-01-22 14:45:26 NOTICE lib.smarthome - Nutze Feiertage für Land 'DE', Provinz 'BW', 1 benutzerdefinierte(r) Feiertag(e) definiert
    2025-01-22 14:45:26 ERROR lib.module Module mqtt exception: Client.__init__() missing 1 required positional argument: 'callback_api_version'
    Traceback (most recent call last):
    File "/usr/local/smarthome/lib/module.py", line 103, in __init__
    self._load_module(module, classname, classpath, args)
    File "/usr/local/smarthome/lib/module.py", line 277, in _load_module
    exec("self.loadedmodule.__init__(self._sh{0}{1})". format("," if len(arglist) else "", argstring))
    File "<string>", line 1, in <module>
    File "/usr/local/smarthome/modules/mqtt/__init__.py", line 169, in __init__
    if not self._connect_to_broker():
    File "/usr/local/smarthome/modules/mqtt/__init__.py", line 220, in _connect_to_broker
    self._client = mqtt.Client(client_id=clientname)
    TypeError: Client.__init__() missing 1 required positional argument: 'callback_api_version'
    2025-01-22 14:45:38 ERROR plugins.vacations An exception occurred when calling "all_vacations()" in ferien_api library: ferien-api.de failed with http code = '429'
    Error:
    2025-01-22 14:45:39 ERROR plugins.zigbee2mqtt Module 'mqtt' not loaded. The plugin is not starting
    2025-01-22 14:45:39 ERROR lib.plugin Plugin 'zigbee2mqtt' v2.0.0 from section 'zigbee2mqtt'
    Exception: 'Zigbee2Mqtt' object has no attribute '_subscribed_topics_lock'
    running SmartHomeNG v1.10.0-master (4b25822a0) / plugins v1.10.0-master (7e00e4ee)
    Traceback (most recent call last):
    File "/usr/local/smarthome/lib/plugin.py", line 173, in __init__
    plugin_thread = PluginWrapper(smarthome, plugin, classname, classpath, args, instance, self.meta, self._configfile)
    File "/usr/local/smarthome/lib/plugin.py", line 709, in __init__
    exec("self.plugin.__init__(smarthome{0}{1})".forma t("," if len(arglist) else "", argstring))
    File "<string>", line 1, in <module>
    File "/usr/local/smarthome/plugins/zigbee2mqtt/__init__.py", line 104, in __init__
    self.add_z2m_subscription('bridge', attr, '', '', dtype, callback=self.on_mqtt_msg)
    File "/usr/local/smarthome/plugins/zigbee2mqtt/__init__.py", line 330, in add_z2m_subscription
    self.add_subscription(tpc, payload_type, bool_values=bool_values, callback=callback)
    File "/usr/local/smarthome/lib/model/mqttplugin.py", line 150, in add_subscription
    with self._subscribed_topics_lock:
    AttributeError: 'Zigbee2Mqtt' object has no attribute '_subscribed_topics_lock'
    2025-01-22 14:45:39 ERROR plugins.mqtt Module 'mqtt' not loaded. The plugin is not starting
    2025-01-22 14:45:39 ERROR lib.plugin Plugin 'mqtt' initialization failed, plugin not loaded
    Allerdings sagt das WI, der Broker ist aktiv (was er zumindest außerhalb von SHNG auch ist):

    image.png

    Zur Ergänzung, in der Datei /etc/module.yaml

    Code:
    mqtt:
        module_name: mqtt
        enabled: True
        broker_host: 192.168.2.33
        broker_port: 1883
        # broker_client: MQTT-module
        # user: Benutzer
        # password: Geheim
        # broker_monitoring: False
        # qos: 1
        # bool_values: ['Falsch', 'Wahr']
        # last_will_topic: devices/shng-module/$online
        # last_will_payload: 'False'
        # birth_topic: devices/shng-module/$online
        # birth_payload: 'True'


    Gruß und Danke schon mal im Voraus für die Hilfe

    Gruß

    Michael
    Zuletzt geändert von MrSetup; 22.01.2025, 16:32.

    #2
    Dein paho-mqtt (Python MQTT-Modul) ist zu neu. Es mus Version 1.x.y sein, 2.0 ist inkompatibel.

    Kommentar


      #3
      Hallo Morg,

      Danke für die Rückmeldung. Dann schau ich mal wie ich eine ältere Version installiert bekomme.

      Gruß und Danke

      Michael

      Kommentar


        #4
        In den neueren Version vom Core sind die Requirements entsprechend angepasst. Die letzte v1 müsste 1.6.1 sein.

        Kommentar

        Lädt...
        X