MQTT_GENERIC_BRIDGE issue

Begonnen von bend94, 20 Juni 2019, 15:50:33

Vorheriges Thema - Nächstes Thema

bend94

hi,

i would like to be able to receive info from FHEM to nodered through MQTT
and be able to send order from nodered to FHEM through MQTT

i already define a MQTT2 like this(on port 1884)

fhem> list MQTT2
Internals:
   CONNECTS   31
   DEF        1884  192.168.0.6
   FD         29
   FUUID      5d0a827e-f33f-0be6-cfaa-92a90d9958947742
   NAME       MQTT2
   NR         84
   PORT       1884
   STATE      Initialized
   TYPE       MQTT2_SERVER
   READINGS:
     2019-06-20 15:35:53   nrclients       1
     2019-06-20 10:55:02   state           Initialized
   clients:
     MQTT2_192.168.0.4_42108 1
   retain:
Attributes:
   mqttForward all
   verbose    5


i created a generic bridge like this :

fhem> list mqttGeneric
Internals:
   CFGFN
   FUUID      5d0b7f88-f33f-0be6-6c2b-efb7b66eed73a43d
   IODev      MQTT2
   NAME       mqttGeneric
   NR         216
   NTFY_ORDER 50-mqttGeneric
   STATE      dev: 2 in: 45 out: 0
   TYPE       MQTT_GENERIC_BRIDGE
   devspec    .*
   prefix     mqtt
   CHANGED:
     incoming-count: 21
  ...
     incoming-count: 45
   READINGS:
     2019-06-20 15:16:31   device-count    2
     2019-06-20 15:35:47   incoming-count  45
     2019-06-20 14:43:52   outgoing-count  0
     2019-06-20 15:10:09   transmission-state IO device initialized (mqtt2)
     2019-06-20 14:43:52   updated-reading-count 0
     2019-06-20 14:43:52   updated-set-count 0
   devices:
     Prise:
       :publish:
       :subscribe:
         HASH(0x2c46928)
     TCM_ESP3_1:
       :publish:
       :subscribe:
   globalDeviceExcludes:
   globalReadingExcludes:
   globalTypeExcludes:
     pub:
       FHEMWEB    *
       Global     *
       MQTT       transmission-state
       MQTT_BRIDGE transmission-state
       MQTT_DEVICE transmission-state
       MQTT_GENERIC_BRIDGE *
       telnet     *
     sub:
       FHEMWEB    *
       Global     *
       MQTT       transmission-state
       MQTT_BRIDGE transmission-state
       MQTT_DEVICE transmission-state
       MQTT_GENERIC_BRIDGE *
       telnet     *
   subscribe:
Attributes:
   IODev      MQTT2
   stateFormat dev: device-count in: incoming-count out: outgoing-count


i did a notify like this

define f2m notify .* set MQTT2 publish fhem/fhem $NAME $EVENT

now i received all messages coming from FHEM in nodered

for the reverse (nodered to FHEM)
i see that the counter incoming-count of my generic bridge increasing each time i send a message from nodered
and i see that in the FHEM log :
MQTT2_SERVER MQTT2 publish fhem/fhem MQTT2_mqtt_aabf8336.af9f2 _: set Prise on
MQTT2_DEVICE MQTT2_mqtt_aabf8336.af9f2 _: set Prise on

but my sensor doesnt move , no activation and desactivation ?
please help
regards


hexenmeister

Zitati would like to be able to receive info from FHEM to nodered through MQTT
yes, possible. use globalPublish with GenericBridge. see https://fhem.de/commandref.html#MQTT_GENERIC_BRIDGEattr
or define the desired readings on the devices. see https://fhem.de/commandref.html#MQTT_GENERIC_BRIDGEmqttPublish


Zitatand be able to send order from nodered to FHEM through MQTT
yes, no problem. define mqttSubscribe on desired devices. see https://fhem.de/commandref.html#MQTT_GENERIC_BRIDGEmqttSubscribe

you do not need 'notify' definition in any case
Maintainer: MQTT_GENERIC_BRIDGE, SYSMON, SMARTMON, systemd_watchdog, MQTT, MQTT_DEVICE, MQTT_BRIDGE
Contrib: dev_proxy