Verbindung zu HomeAssistant mit MQTT_GENERIC_BRIDGE

Begonnen von edy_80, 25 Oktober 2020, 19:06:36

Vorheriges Thema - Nächstes Thema

Beta-User

Zitat von: thgorjup am 14 März 2025, 13:53:48Oh, ich habe gerade chatgpt gefragt und habe daraufhin folgendes am demoswitch dummy geändert:

attr demoswitch mqttSubscribe state:stopic={"fhem/demoswitch/set"}

Jetzt funktioniert es. Warum wird denn das vorherige "$base/set" falsch umgesetzt?
Naja, jetzt funtkioniert es aber...
Vielleicht weil da nochmal "fhem" steht?

Kann nicht recht nachvollziehen, warum der Vorschlag nicht übernommen wird, $base für sub und pub unterschiedlich zu setzen...
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: ZigBee2mqtt, MiLight@ESP-GW, BT@OpenMQTTGw | ZWave | SIGNALduino | MapleCUN | RHASSPY
svn: u.a Weekday-&RandomTimer, Twilight,  div. attrTemplate-files, MySensors

Rainer82

#271
Hallo, ich habe heute ein Update durchgeführt, danach erscheint ein neues Device, was ist das?

Internals:
   CFGFN     
   CID        0j5eH4le9RPjdts1bLOYse
   DEF        0j5eH4le9RPjdts1bLOYse
   FUUID      68cfabd7-f33f-9f73-d3df-6eb460dec67c3296
   IODev      MQTT2_FHEM_Server
   NAME       0j5eH4le9RPjdts1bLOYse
   NR         776
   STATE      ???
   TYPE       MQTT2_DEVICE
   eventCount 1
   READINGS:
     2025-09-21 09:40:07   IODev           MQTT2_FHEM_Server
     2025-09-21 09:40:07   status          online
     2025-09-21 09:40:27   subscriptions   cloudapp/QBUSMQTTGW/+/state cloudapp/QBUSMQTTGW/config cloudapp/QBUSMQTTGW/state drop_connect/discovery/# dsmr/# fully/deviceInfo/+ homeassistant/alarm_control_panel/+/+/config homeassistant/alarm_control_panel/+/config homeassistant/binary_sensor/+/+/config homeassistant/binary_sensor/+/config homeassistant/button/+/+/config homeassistant/button/+/config homeassistant/camera/+/+/config homeassistant/camera/+/config homeassistant/climate/+/+/config homeassistant/climate/+/config homeassistant/cover/+/+/config homeassistant/cover/+/config homeassistant/device/+/+/config homeassistant/device/+/config homeassistant/device_automation/+/+/config homeassistant/device_automation/+/config homeassistant/device_tracker/+/+/config homeassistant/device_tracker/+/config homeassistant/event/+/+/config homeassistant/event/+/config homeassistant/fan/+/+/config homeassistant/fan/+/config homeassistant/humidifier/+/+/config homeassistant/humidifier/+/config homeassistant/image/+/+/config homeassistant/image/+/config homeassistant/lawn_mower/+/+/config homeassistant/lawn_mower/+/config homeassistant/light/+/+/config homeassistant/light/+/config homeassistant/lock/+/+/config homeassistant/lock/+/config homeassistant/notify/+/+/config homeassistant/notify/+/config homeassistant/number/+/+/config homeassistant/number/+/config homeassistant/scene/+/+/config homeassistant/scene/+/config homeassistant/select/+/+/config homeassistant/select/+/config homeassistant/sensor/+/+/config homeassistant/sensor/+/config homeassistant/siren/+/+/config homeassistant/siren/+/config homeassistant/switch/+/+/config homeassistant/switch/+/config homeassistant/tag/+/+/config homeassistant/tag/+/config homeassistant/text/+/+/config homeassistant/text/+/config homeassistant/update/+/+/config homeassistant/update/+/config homeassistant/vacuum/+/+/config homeassistant/vacuum/+/config homeassistant/valve/+/+/config homeassistant/valve/+/config homeassistant/water_heater/+/+/config homeassistant/water_heater/+/config pglab/discovery/# tasmota/discovery/#
Attributes:
   readingList 0j5eH4le9RPjdts1bLOYse:homeassistant/status:.* status
   room       MQTT2_DEVICE

Rainer82


Beta-User

Da scheint es so etwas wie eine App zu geben, die da automatisch als neuer Client am Server angemeldet wird.

Siehe die subscriptions.
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: ZigBee2mqtt, MiLight@ESP-GW, BT@OpenMQTTGw | ZWave | SIGNALduino | MapleCUN | RHASSPY
svn: u.a Weekday-&RandomTimer, Twilight,  div. attrTemplate-files, MySensors

passibe

#274
Home Assistant sendet standardmäßig jedes Mal beim Start/Stop eine Nachricht mit online oder offline an das topic homeassistant/status (birth/last will message).
FHEM hat das gemerkt und dafür mittels autocreate ein Device angelegt.

Die komische client ID 0j5eH4le9RPjdts1bLOYse kommt daher, weil du in den erweiterten MQTT Einstellungen in Home Assistant keine client ID vergeben hast und deshalb die zufallsgenerierte ID genutzt wird. Das kannst du auch ändern (würde ich aber lassen, wenn die client ID sonst noch in irgendwelchen setLists rumschwirrt, nicht, dass es dir da was zerschießt).

Wenn du den Home-Assistant-Status nicht in FHEM haben willst, kannst du das Device also einfach löschen. Damit es nicht wieder auftaucht kannst du entweder
attr MQTT2_FHEM_Server ignoreRegexp homeassistant/statusverwenden (anpassen, falls du aktuell schon ignoreRegexp nutzt!) oder du deaktivierst in Home Assistant die birth/last will messages. Das geht in den MQTT-Einstellungen (Link zur Doku):
ZitatMQTT Birth and Last Will messages can be customized or disabled from the UI. To do this, click on "Configure" in the integration page in the UI, then "Re-configure MQTT" and then "Next".