MQTT RPI commandline OK, no autodiscovery

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

Moderator: leecollings

Post Reply
HvdW
Posts: 617
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

MQTT RPI commandline OK, no autodiscovery

Post 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.
Bugs bug me.
User avatar
waltervl
Posts: 5902
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: MQTT RPI commandline OK, no autodiscovery

Post 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)
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
HvdW
Posts: 617
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: MQTT RPI commandline OK, no autodiscovery

Post 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.
Bugs bug me.
User avatar
waltervl
Posts: 5902
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: MQTT RPI commandline OK, no autodiscovery

Post 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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
HvdW
Posts: 617
Joined: Sunday 01 November 2015 22:45
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Twente
Contact:

Re: MQTT RPI commandline OK, no autodiscovery

Post 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.
Bugs bug me.
User avatar
waltervl
Posts: 5902
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: MQTT RPI commandline OK, no autodiscovery

Post by waltervl »

Then you cannot use mqtt Auto discover.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
gizmocuz
Posts: 2552
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: MQTT RPI commandline OK, no autodiscovery

Post 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
Quality outlives Quantity!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest