Page 1 of 1

MQTT help

Posted: Sunday 22 December 2024 23:48
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
}

Re: MQTT help

Posted: Monday 23 December 2024 18:50
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.

Re: MQTT help

Posted: Wednesday 25 December 2024 15:10
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

Re: MQTT help

Posted: Wednesday 25 December 2024 21:16
by FireWizard