MQTT help

For devices supporting the Auto Discovery feature. Like ZWaveJS2MQTT, Zigbee2MQTT.

Moderator: leecollings

Post Reply
dino
Posts: 9
Joined: Wednesday 14 April 2021 23:24
Target OS: Linux
Domoticz version:
Contact:

MQTT help

Post by dino »

Hello everyone!
I am new to MQTT protocol, have some questions, is it correct to set:
"Publish Topic:" to "Name"
"Topic In Prefix:" to "casa/+"
and
"Topic Out Prefix:" to "casa" ?

I have configured in that way to have, for example, the switch named "salotto" controllable writing

Code: Select all

mosquitto_pub -h $IP -m '{ "idx" : 1, "nvalue" : 1 }' -t 'casa/salotto'
and when I switch the switch in domoticz I have:

Code: Select all

casa/salotto {
        "Battery" : 255,
        "LastUpdate" : "2024-12-22 23:24:36",
        "RSSI" : 12,
        "description" : "",
        "dtype" : "Light/Switch",
        "hwid" : "3",
        "id" : "00014051",
        "idx" : 1,
        "name" : "salotto",
        "nvalue" : 0,
        "org_hwid" : "3",
        "stype" : "Switch",
        "svalue1" : "0",
        "switchType" : "On/Off",
        "unit" : 1
}
User avatar
waltervl
Posts: 5397
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: MQTT help

Post by waltervl »

Topic In Prefix should also be "casa"

What is the issue you have? Does it not work?
Also better to check with an application like MQTT Explorer what is going on on the MQTT server/broker.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
dino
Posts: 9
Joined: Wednesday 14 April 2021 23:24
Target OS: Linux
Domoticz version:
Contact:

Re: MQTT help

Post by dino »

If I set

Code: Select all

"Topic In Prefix:" to "casa"
domoticz do not receive the messages sended to casa/salotto
but if i add the "/+" the message will received.

Please can someone explain to me the MQTT protocol? or indicate where I can found the infos

The devices need always tho threads? one for read and one for write? Is incorrect use the same thread to read and write values?

Thank you
User avatar
FireWizard
Posts: 1771
Joined: Tuesday 25 December 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Voorthuizen (NL)
Contact:

Re: MQTT help

Post by FireWizard »

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests