Topics MQTT Client

On various Hardware and OS systems: pi / windows / routers / nas, etc

Moderator: leecollings

Post Reply
nachorc32
Posts: 3
Joined: Wednesday 27 February 2019 18:18
Target OS: Linux
Domoticz version:
Contact:

Topics MQTT Client

Post 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!!
devros
Posts: 183
Joined: Saturday 29 October 2016 20:55
Target OS: -
Domoticz version:
Contact:

Re: Topics MQTT Client

Post by devros »

AFAIK You cant...
You have to use Nodered or something similar to resend topics to domoticz/in
nachorc32
Posts: 3
Joined: Wednesday 27 February 2019 18:18
Target OS: Linux
Domoticz version:
Contact:

Re: Topics MQTT Client

Post 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...
User avatar
FireWizard
Posts: 1889
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: Topics MQTT Client

Post 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
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest