How we can add custom message in mqtt bundle when mqtt broker subscribe any State


(Chandni Goyal) #1

Hello friends
I am new in this …
Please help me !
I want to add some custom string or date/time in mosquitto message which having status with it …
I am just using SmartMeter device . when device subscribe its state on mosquitto . i need to add some String and date/time with message payload .like if meter reading is 3.047 it must be like “HELLO,2017-6-22 20:02:32,3.047”
I dont know where i need to change .
Is I need to change in mqtt binding OR Zwave binding .
or some where else .
I dont know …
Thanks
Regads
Chandni


(Rich Koshak) #2

You need to write a rule that combines the information into a String and sends that as the MQTT message.

See:

http://docs.openhab.org/configuration/rules-dsl.html