MQTT Audo-discovery

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

Moderator: leecollings

rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: MQTT Audo-discovery

Post by rron »

jvdz wrote: Monday 20 December 2021 17:35 You need to set the prefix the same at both sides, so change the domoticz prefix in ZWAVEJS2MQTT to homeassistant as well when that is what you have defined in domoticz/mqtt.
That topic prefix is used to exchange the device CONFIG topics & payload for auto discovery!
Still the same error
Schermafdruk van 2021-12-20 17-48-00.png
Schermafdruk van 2021-12-20 17-48-00.png (128.4 KiB) Viewed 3222 times
Schermafdruk van 2021-12-20 17-48-26.png
Schermafdruk van 2021-12-20 17-48-26.png (202.74 KiB) Viewed 3222 times

Code: Select all

 2021-12-20 17:47:14.732 Error: MQTT: MQTT_Discovery: Something other then 'config' received on discovery topic! (18/38/0/currentValue/{"time":1640003037730,"value":99,"nodeName":"Wasmachine","nodeLocation":"Zolder"})!
2021-12-20 17:47:14.732 Error: MQTT: MQTT_Discovery: Invalid/Unhandled data received! (Topic: 18/38/0/currentValue, Message: {"time":1640003037730,"value":99,"nodeName":"Wasmachine","nodeLocation":"Zolder"})
2021-12-20 17:47:14.732 Error: MQTT: MQTT_Discovery: Something other then 'config' received on discovery topic! (23/38/1/currentValue/{"time":1639954365610,"value":0,"nodeName":"Kamer dimmer","nodeLocation":"Huiskamer"})!
2021-12-20 17:47:14.732 Error: MQTT: MQTT_Discovery: Invalid/Unhandled data received! (Topic: 23/38/1/currentValue, Message: {"time":1639954365610,"value":0,"nodeName":"Kamer dimmer","nodeLocation":"Huiskamer"})
2021-12-20 17:47:14.732 Error: MQTT: MQTT_Discovery: Something other then 'config' received on discovery topic! (23/38/2/currentValue/{"time":1639821438142,"value":99,"nodeName":"Kamer dimmer","nodeLocation":"Huiskamer"})!
2021-12-20 17:47:14.732 Error: MQTT: MQTT_Discovery: Invalid/Unhandled data received! (Topic: 23/38/2/currentValue, Message: {"time":1639821438142,"value":99,"nodeName":"Kamer dimmer","nodeLocation":"Huiskamer"}) 
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: MQTT Audo-discovery

Post by jvdz »

OK... now check mqtt for the config messages send.
They should be in topic homeassistant and clean out all retained message in the wrong place topic domoticz.
See https://www.domoticz.com/wiki/MQTT#Debugging_MQTT
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: MQTT Audo-discovery

Post by rron »

jvdz wrote: Monday 20 December 2021 18:01 OK... now check mqtt for the config messages send.
They should be in topic homeassistant and clean out all retained message in the wrong place topic domoticz.
See https://www.domoticz.com/wiki/MQTT#Debugging_MQTT
I cannot see any config message in MQTT explorer.
Attachments
Schermafdruk van 2021-12-20 19-43-24.png
Schermafdruk van 2021-12-20 19-43-24.png (277.43 KiB) Viewed 3206 times
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: MQTT Audo-discovery

Post by heggink »

rron wrote: Monday 20 December 2021 17:50
jvdz wrote: Monday 20 December 2021 17:35 You need to set the prefix the same at both sides, so change the domoticz prefix in ZWAVEJS2MQTT to homeassistant as well when that is what you have defined in domoticz/mqtt.
That topic prefix is used to exchange the device CONFIG topics & payload for auto discovery!
Still the same errorSchermafdruk van 2021-12-20 17-48-00.pngSchermafdruk van 2021-12-20 17-48-26.png

Code: Select all

 2021-12-20 17:47:14.732 Error: MQTT: MQTT_Discovery: Something other then 'config' received on discovery topic! (18/38/0/currentValue/{"time":1640003037730,"value":99,"nodeName":"Wasmachine","nodeLocation":"Zolder"})!
2021-12-20 17:47:14.732 Error: MQTT: MQTT_Discovery: Invalid/Unhandled data received! (Topic: 18/38/0/currentValue, Message: {"time":1640003037730,"value":99,"nodeName":"Wasmachine","nodeLocation":"Zolder"})
2021-12-20 17:47:14.732 Error: MQTT: MQTT_Discovery: Something other then 'config' received on discovery topic! (23/38/1/currentValue/{"time":1639954365610,"value":0,"nodeName":"Kamer dimmer","nodeLocation":"Huiskamer"})!
2021-12-20 17:47:14.732 Error: MQTT: MQTT_Discovery: Invalid/Unhandled data received! (Topic: 23/38/1/currentValue, Message: {"time":1639954365610,"value":0,"nodeName":"Kamer dimmer","nodeLocation":"Huiskamer"})
2021-12-20 17:47:14.732 Error: MQTT: MQTT_Discovery: Something other then 'config' received on discovery topic! (23/38/2/currentValue/{"time":1639821438142,"value":99,"nodeName":"Kamer dimmer","nodeLocation":"Huiskamer"})!
2021-12-20 17:47:14.732 Error: MQTT: MQTT_Discovery: Invalid/Unhandled data received! (Topic: 23/38/2/currentValue, Message: {"time":1639821438142,"value":99,"nodeName":"Kamer dimmer","nodeLocation":"Huiskamer"}) 
If this is your zwavejs config then that still uses domoticz as the prefix instead of homeassistant. Looks like you changed the name, not the prefix (on the second line).
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: MQTT Audo-discovery

Post by jvdz »

You really need to get rid of all those homeassistant topic message as they all seem to be status update messages which should not be the case. They should be standard in the ZWAVE topic. Did you change that default too?
Also check your domoticz topic for any retained messages from the ZWAVEJS2MQTT gateway and get rid of those too.
Review your ZWAVEJS2MQTT and set the discovery topic to homeassistant and set the status update topic to zwave and ensure this config becomes active.
After that you should see the config payload in MQTTExplorer.

EDIT: Just checked the ZWAVEJS2MQTT settings and these need to be checked (these are the defaults as far as I remember):
MQTT
Name: A unique name that identifies the Gateway.
Host url: The url of the broker. Insert the protocol if present, example: tls://localhost. Mqtt supports these protocols: mqtt, mqtts, tcp, tls, ws and wss
Port: Broker port
Reconnect period: Milliseconds between two reconnection tries
Prefix: zwave

Home Assistant
WS Server: Enable Z-Wave JS websocket server. This can be used by the official Home Assistant Z-Wave integration to automatically create entities
MQTT discovery: Enable this to use MQTT discovery. This is an alternative to the official integration. (more about this here)
Discovery Prefix: homeassistant
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: MQTT Audo-discovery

Post by rron »

jvdz wrote: Monday 20 December 2021 22:49 You really need to get rid of all those homeassistant topic message as they all seem to be status update messages which should not be the case. They should be standard in the ZWAVE topic. Did you change that default too?
Also check your domoticz topic for any retained messages from the ZWAVEJS2MQTT gateway and get rid of those too.
Review your ZWAVEJS2MQTT and set the discovery topic to homeassistant and set the status update topic to zwave and ensure this config becomes active.
After that you should see the config payload in MQTTExplorer.

EDIT: Just checked the ZWAVEJS2MQTT settings and these need to be checked (these are the defaults as far as I remember):
MQTT
Name: A unique name that identifies the Gateway.
Host url: The url of the broker. Insert the protocol if present, example: tls://localhost. Mqtt supports these protocols: mqtt, mqtts, tcp, tls, ws and wss
Port: Broker port
Reconnect period: Milliseconds between two reconnection tries
Prefix: zwave

Home Assistant
WS Server: Enable Z-Wave JS websocket server. This can be used by the official Home Assistant Z-Wave integration to automatically create entities
MQTT discovery: Enable this to use MQTT discovery. This is an alternative to the official integration. (more about this here)
Discovery Prefix: homeassistant
Still the same errors. I red different topics and combined the setting mentioned. This is what I have now:
Schermafdruk van 2021-12-21 21-46-45.png
Schermafdruk van 2021-12-21 21-46-45.png (252.47 KiB) Viewed 3149 times
Schermafdruk van 2021-12-21 21-47-06.png
Schermafdruk van 2021-12-21 21-47-06.png (231.68 KiB) Viewed 3149 times
Schermafdruk van 2021-12-21 21-47-33.png
Schermafdruk van 2021-12-21 21-47-33.png (236.5 KiB) Viewed 3149 times
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: MQTT Audo-discovery

Post by jvdz »

MQTT PREFIX in ZWAVEJS2MQTT is still wrong! That sends the status updates and they should not go into the same topic as the autodiscovery (homeassistant)!
As stated in my previous post: That should be ZWAVE which it is by default. ;)
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: MQTT Audo-discovery

Post by rron »

jvdz wrote: Tuesday 21 December 2021 22:19 MQTT PREFIX in ZWAVEJS2MQTT is still wrong! That sends the status updates and they should not go into the same topic as the autodiscovery (homeassistant)!
As stated in my previous post: That should be ZWAVE which it is by default. ;)
I wiiltry again and let you know. Thanks for your help.
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: MQTT Audo-discovery

Post by rron »

jvdz wrote: Tuesday 21 December 2021 22:19 MQTT PREFIX in ZWAVEJS2MQTT is still wrong! That sends the status updates and they should not go into the same topic as the autodiscovery (homeassistant)!
As stated in my previous post: That should be ZWAVE which it is by default. ;)
Still errors :shock: I think I changed everything you said.But the mqtt devices are in domoticz and working.When I restart the messages appear again.
Schermafdruk van 2021-12-24 13-47-54.png
Schermafdruk van 2021-12-24 13-47-54.png (161.71 KiB) Viewed 3081 times
Schermafdruk van 2021-12-24 13-48-25.png
Schermafdruk van 2021-12-24 13-48-25.png (199.37 KiB) Viewed 3081 times

Code: Select all

 2021-12-24 13:45:00.003 Error: MQTT: MQTT_Discovery: Something other then 'config' received on discovery topic! (23/38/1/currentValue/{"time":1640349720033,"value":61,"nodeName":"Kamer dimmer","nodeLocation":"Huiskamer"})!
2021-12-24 13:45:00.003 Error: MQTT: MQTT_Discovery: Invalid/Unhandled data received! (Topic: 23/38/1/currentValue, Message: {"time":1640349720033,"value":61,"nodeName":"Kamer dimmer","nodeLocation":"Huiskamer"})
2021-12-24 13:45:00.203 Error: MQTT: MQTT_Discovery: Something other then 'config' received on discovery topic! (23/38/2/currentValue/{"time":1640349720096,"value":99,"nodeName":"Kamer dimmer","nodeLocation":"Huiskamer"})!
2021-12-24 13:45:00.203 Error: MQTT: MQTT_Discovery: Invalid/Unhandled data received! (Topic: 23/38/2/currentValue, Message: {"time":1640349720096,"value":99,"nodeName":"Kamer dimmer","nodeLocation":"Huiskamer"})
2021-12-24 13:45:07.985 MQTT: General/Current (Magnetron_electric_a_value) 
Last edited by rron on Friday 24 December 2021 13:56, edited 1 time in total.
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
mark.sellwood
Posts: 101
Joined: Tuesday 04 March 2014 10:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Surrey, UK
Contact:

Re: MQTT Audo-discovery

Post by mark.sellwood »

I'm following this too as I'm trying with no luck to get Auto Discovery working with both Z-Wave & Zigbee.
3 x Pi, 1 Master, 2 Slaves, 1x Aeotec Z-Stick S2, 4xSP103 PIR, 5xPowerNode 1, 1xSmart Energy Switch Gen5, 4xFGSS101 Smoke Sensor, 2xFGD212, 9xFGS212 , 7xFGS221/2, 1xAD142 , 1xTKB TZ68E , 2xAeotec Multi Sensor, 3 x NodOn CRC-3-1-00.
rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: MQTT Audo-discovery

Post by rron »

mark.sellwood wrote: Friday 24 December 2021 13:55 I'm following this too as I'm trying with no luck to get Auto Discovery working with both Z-Wave & Zigbee.
Well itś working only with a lot off error messages in the logfile. I cann't see what is wrong.
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
mark.sellwood
Posts: 101
Joined: Tuesday 04 March 2014 10:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Surrey, UK
Contact:

Re: MQTT Audo-discovery

Post by mark.sellwood »

I haven't got that far, all I get is errors, I think I haven t configured ZWaveJS2MQTT correctly, so looking to see what others have done so I can follow.
3 x Pi, 1 Master, 2 Slaves, 1x Aeotec Z-Stick S2, 4xSP103 PIR, 5xPowerNode 1, 1xSmart Energy Switch Gen5, 4xFGSS101 Smoke Sensor, 2xFGD212, 9xFGS212 , 7xFGS221/2, 1xAD142 , 1xTKB TZ68E , 2xAeotec Multi Sensor, 3 x NodOn CRC-3-1-00.
User avatar
McMelloW
Posts: 427
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Re: MQTT Audo-discovery

Post by McMelloW »

rron wrote: Friday 24 December 2021 13:58 Well itś working only with a lot off error messages in the logfile. I cann't see what is wrong.
I left the fields Topic In Prefix: & Topic Out Prefix: empty and only Auto Discovery Prefix: contains text. It works OK for me.
Greetings McMelloW
rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: MQTT Audo-discovery

Post by rron »

McMelloW wrote: Friday 24 December 2021 14:51
rron wrote: Friday 24 December 2021 13:58 Well itś working only with a lot off error messages in the logfile. I cann't see what is wrong.
I left the fields Topic In Prefix: & Topic Out Prefix: empty and only Auto Discovery Prefix: contains text. It works OK for me.
I also tried that but that doesn't change the error messages. The message are only in the startup cyclus and after some time the are gone. If you change something the error is visible again. :?:
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
User avatar
McMelloW
Posts: 427
Joined: Monday 20 November 2017 17:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V2024.1
Location: Harderwijk, NL
Contact:

Re: MQTT Audo-discovery

Post by McMelloW »

Restart of Domoticz
Greetings McMelloW
rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: MQTT Audo-discovery

Post by rron »

McMelloW wrote: Friday 24 December 2021 15:12 Restart of Domoticz
Done several times, no luck. Is it possible to post your settings? Perhaps I have overlocked something.
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: MQTT Audo-discovery

Post by jvdz »

Did you remove all retained OLD wrong Messages from topic "HOMEASSISTANT" or else you will still be getting these errors each time you start Domoticz?
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: MQTT Audo-discovery

Post by rron »

jvdz wrote: Friday 24 December 2021 15:25 Did you remove all retained OLD wrong Messages from topic "HOMEASSISTANT" or else you will still be getting these errors each time you start Domoticz?
Where can I find this?
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
User avatar
jvdz
Posts: 2189
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: MQTT Audo-discovery

Post by jvdz »

rron wrote: Friday 24 December 2021 15:28
jvdz wrote: Friday 24 December 2021 15:25 Did you remove all retained OLD wrong Messages from topic "HOMEASSISTANT" or else you will still be getting these errors each time you start Domoticz?
Where can I find this?
jvdz wrote: Monday 20 December 2021 18:01 OK... now check mqtt for the config messages send.
They should be in topic homeassistant and clean out all retained message in the wrong place topic domoticz.
See https://www.domoticz.com/wiki/MQTT#Debugging_MQTT
So, Just clean out TOPIC HOMEASSISTANT and probably also DOMOTICZ, as you had them initially in the wrong places. ;)
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
rron
Posts: 223
Joined: Sunday 30 March 2014 15:24
Target OS: Linux
Domoticz version: Beta
Location: Waterland
Contact:

Re: MQTT Audo-discovery

Post by rron »

jvdz wrote: Friday 24 December 2021 15:31
rron wrote: Friday 24 December 2021 15:28
jvdz wrote: Friday 24 December 2021 15:25 Did you remove all retained OLD wrong Messages from topic "HOMEASSISTANT" or else you will still be getting these errors each time you start Domoticz?
Where can I find this?
jvdz wrote: Monday 20 December 2021 18:01 OK... now check mqtt for the config messages send.
They should be in topic homeassistant and clean out all retained message in the wrong place topic domoticz.
See https://www.domoticz.com/wiki/MQTT#Debugging_MQTT
So, Just clean out TOPIC HOMEASSISTANT and probably also DOMOTICZ, as you had them initially in the wrong places. ;)
In the plugin?
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests