Page 1 of 1

Topics MQTT Client

Posted: Wednesday 31 July 2019 3:24
by nachorc32
Hi, i need to change a topic (domoticz/in). The MQTT Server works only a specific topic, for this cause, i cant run correctly the device: "MQTT Client Gateway with LAN interface". I need to change yes o yes, sorry. How i do to change the topics name?
Thanks!!

Re: Topics MQTT Client

Posted: Wednesday 31 July 2019 8:23
by devros
AFAIK You cant...
You have to use Nodered or something similar to resend topics to domoticz/in

Re: Topics MQTT Client

Posted: Wednesday 31 July 2019 15:43
by nachorc32
No, i cant use another app or system how Nodered or something similar. Only can continius with my task in my work, if change this topic :(
Sorry for the insistence...

Re: Topics MQTT Client

Posted: Wednesday 31 July 2019 16:47
by FireWizard
Hi,

Sorry to say you cannot and you should not change the topic.
The Domoticz interface subscribes to the topic domoticz/in and publishes to the topic domoticz/out.

Everything you want to send to Domoticz you should publish to domoticz/in in a format that domoticz understands.
See: https://www.domoticz.com/wiki/MQTT.

Domoticz publishes messages (payloads) to domoticz/out. By subscribing to domoticz/out (e.g. with a tool, like MQTTfx) you can read these payloads and sort them, do manipulations, and publish new payloads to the topics you want. You receive them in a specific format from Domoticz.
See the example below:

{
"Battery" : 255,
"RSSI" : 12,
"description" : "",
"dtype" : "General",
"id" : "0000044D",
"idx" : 153,
"name" : "Raspberry Pi 1 CPU_Usage",
"nvalue" : 0,
"stype" : "Percentage",
"svalue1" : "7.73",
"unit" : 1
}


The ideal tool to do this is Node-Red, as devros already mentioned.
So changing the topic name (as said: not possible) or even publishing directly to domoticz/in will not help you as the msg.payload requires a specific format.

Regards