Failure using templates

Begonnen von tomaszG, 20 Dezember 2018, 11:48:28

Vorheriges Thema - Nächstes Thema



Great job on FHEM it's great to use
I am experiencing a small problem on the template object

I create the following template

define %mqtt_name% MQTT_BRIDGE %device_name%
attr %mqtt_name% publishReading_setpointTempSet enocean/%topic_name%/setpointTempSet

when I type in the command in the web interface

template mqtt_bridge_simple.templ mqtt_name=mq_EnO_01A60F81 device_name=EnO_01A60F81 topic_name=EnO_01A60F81

it successfully create the object without error, but then the object never publishes on MQTT. If i look at the object page (attached as pic) I see that it looks almost fine except that the device does seem to be linked in the NOTIFYDEV field.

If i creat the same object by typing directly

define mqt004 MQTT_BRIDGE EnO_01A60F81
attr mqt004 publishReading_setpointTempSet enocean/EnO_01A60F81/setpointTempSet

It works. thats exactly the commands the template is supposed to produce. this time,(see attached), it is correctly linked and dooes publish on MQTT.

Please let me know a solution or pleasant workaround (already found a heavy workaround that I would like to avoid)



Hi tomaszG,

sorry for the troubles you ran into.

Rather than using multiple MQTT_BRIDGE devices, I'd suggest to use just one MQTT_GERNERIC_BRIDGE.

Then all mqtt specific configuration off your %device_name% devices  can be done without any additional definition (just attributes to the %device_name%). See examples section of MQTT_GENERIC_BRIDGE in commandref.
Note: MQTT2_CLIENT and MQTT2_SERVER are now also valid IO devices for Gen. Bridge.

Kind regards
Server: HP-T620@Debian 11, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files