Page 1 of 1

MQTT: transmit several sensor values

Posted: 09 May 2021, 15:45
by jbaben
Hello,

how can I transfer multiple sensor values (Temperature1, Temperatur2, Humidity, Pressure) ?
For one sensor value:
MQTT:
Controller Subscribe: %sysname%/#
Controller Publish: %sysname%/Temperature1

Kind Regards

Juergen B.

Re: MQTT: transmit several sensor values

Posted: 09 May 2021, 17:12
by Ath
I would expect that the MQTT server can only receive 1 value per topic, unless you use the publish command to send a combined message, instead of the more regular way of letting a controller handle it. Via the controller all values of the sensor will be sent to their respective topic one after the other.

Re: MQTT: transmit several sensor values

Posted: 09 May 2021, 21:04
by TD-er
The default topic for OpenHAB to publish is like this:

Code: Select all

%sysname%/%tskname%/%valname%
I guess that's what you need?

Re: MQTT: transmit several sensor values

Posted: 10 May 2021, 15:05
by jbaben
Hello,

Many thanks for your help.
With the topic publish:

Code: Select all

%sysname%/%tskname%/%valname%
all sensor values are transmitted.

Kind Regards
Juergen B.