Page 1 of 1

MQTT RPI commandline OK, no autodiscovery

Posted: Friday 02 February 2024 14:46
by HvdW
I have setup the client gateway on 192.168.2.100 and it works like expected.
In domoticz log:

Code: Select all

2024-02-02 14:42:47.887 Status: MQTT: Worker stopped...
2024-02-02 14:42:47.888 Debug: : MQTT PublishSchema 1 (1), Retain 0
2024-02-02 14:42:48.890 Status: MQTT: Connecting to 192.168.2.100:1883
2024-02-02 14:42:49.094 Status: MQTT: connected to: 192.168.2.100:1883
On the other RPI 192.168.2.104 I have setup MQTT autodiscovery but nothing happens.
On the command line mosquitto_sub -t domoticz/# -v -h 192.168.2.100 shows results like:

Code: Select all

domoticz/out {
        "Battery" : 100,
        "EnergyMeterMode" : "0",
        "LastUpdate" : "2024-02-02 14:45:34",
        "RSSI" : 12,
        "description" : "",
        "dtype" : "General",
        "hwid" : "19",
        "id" : "00000001",
        "idx" : 2456,
        "name" : "Airco",
        "nvalue" : 0,
        "org_hwid" : "19",
        "stype" : "kWh",
        "svalue1" : "17.000",
        "svalue2" : "554434.938",
        "unit" : 1
}

domoticz/out {
        "Battery" : 100,
        "EnergyMeterMode" : "0",
        "LastUpdate" : "2024-02-02 14:45:34",
        "RSSI" : 12,
        "description" : "",
        "dtype" : "General",
        "hwid" : "19",
        "id" : "00000002",
        "idx" : 2457,
        "name" : "Laadpaal",
        "nvalue" : 0,
        "org_hwid" : "19",
        "stype" : "kWh",
        "svalue1" : "0.000",
        "svalue2" : "937314.938",
        "unit" : 1
}
domoticz/out {
        "Battery" : 255,
        "LastUpdate" : "2024-02-02 14:48:10",
        "RSSI" : 12,
        "description" : "",
        "dtype" : "P1 Smart Meter",
        "hwid" : "4",
        "id" : "0001",
        "idx" : 15,
        "name" : "Power",
        "nvalue" : 0,
        "org_hwid" : "4",
        "stype" : "Energy",
        "svalue1" : "31650676",
        "svalue2" : "17531198",
        "svalue3" : "11238463",
        "svalue4" : "26960900",
        "svalue5" : "170",
        "svalue6" : "0",
        "unit" : 1
}
The result of mosquitto_sub is like expected, the display in domoticz is not.
What am I missing here.

Re: MQTT RPI commandline OK, no autodiscovery

Posted: Friday 02 February 2024 14:51
by waltervl
There is a MQTT Gateway and MQTT Autodiscovery Gateway . It seems you have configured the normal MQTT gateway (using domoticz/in /out topics)

Re: MQTT RPI commandline OK, no autodiscovery

Posted: Friday 02 February 2024 15:41
by HvdW
Should I use MQTT Autodiscovery Gateway on both ends?
Here's some log output of 192.168.2.100

Code: Select all

2024-02-02 15:42:41.338 P1 smart meter: Usage (Actual Usage (L1 + L2 + L3))
2024-02-02 15:42:41.438 Status: Warning: Expecting svalue with at least 5 elements separated by semicolon, 0 elements received (""), notification not sent (Hardware: 4 - P1 smart meter, ID: 1, Unit: 1, Type: FA - P1 Smart Meter, SubType: 1 - Energy)
2024-02-02 15:42:41.435 Debug: MQTT: Topic: domoticz, Message: {
2024-02-02 15:42:41.435 "Battery" : 255,
2024-02-02 15:42:41.435 "LastUpdate" : "2024-02-02 15:42:41",
2024-02-02 15:42:41.435 "RSSI" : 12,
2024-02-02 15:42:41.435 "description" : "",
2024-02-02 15:42:41.435 "dtype" : "P1 Smart Meter",
2024-02-02 15:42:41.435 "hwid" : "4",
2024-02-02 15:42:41.435 "id" : "0001",
2024-02-02 15:42:41.435 "idx" : 15,
2024-02-02 15:42:41.435 "name" : "Power",
2024-02-02 15:42:41.435 "nvalue" : 0,
2024-02-02 15:42:41.435 "org_hwid" : "4",
2024-02-02 15:42:41.435 "stype" : "Energy",
2024-02-02 15:42:41.435 "svalue1" : "31650676",
2024-02-02 15:42:41.435 "svalue2" : "17531480",
2024-02-02 15:42:41.435 "svalue3" : "11238463",
2024-02-02 15:42:41.435 "svalue4" : "26960900",
2024-02-02 15:42:41.435 "svalue5" : "180",
2024-02-02 15:42:41.435 "svalue6" : "0",
2024-02-02 15:42:41.435 "unit" : 1
Remark.
I found out that MQTT is terribly interfering with remote server.
As soon as MQTT comes in on an existing remote server connection the data get mixed up.

Re: MQTT RPI commandline OK, no autodiscovery

Posted: Friday 02 February 2024 17:14
by waltervl
I have no idea what you want to do.
MQTT Auto discover gateway can communicate over MQTT with other platforms like Zwave-JS-UI or Zigbee2MQTT that can use the same protocol.
Just switching on an MQTT gateway in Domoticz is useless.

Re: MQTT RPI commandline OK, no autodiscovery

Posted: Friday 02 February 2024 17:19
by HvdW
I wanted to transfer data from one domoticz to another domoticz on another rpi.
Now I'm using remote server, I have been trying to collect data in the second Domotic using MQTT and create a few devices displaying the data of the first device.

Re: MQTT RPI commandline OK, no autodiscovery

Posted: Friday 02 February 2024 17:42
by waltervl
Then you cannot use mqtt Auto discover.

Re: MQTT RPI commandline OK, no autodiscovery

Posted: Saturday 03 February 2024 8:25
by gizmocuz
And you should use the "domoticz remote hardware" for this. You can create a user and also specify which devices the other RPI should receive