MQTT Audo-discovery
Moderator: leecollings
- 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
Plugin? No idea what the relation is with a Plugin here.
You are using the Beta AutoDiscovery, this is an integration without the Plugin!
All CONFIG messages are send from your hardware gateway (ZIGBEE2MQTT/ZWAVEJS2MQTT...etc) to Mosquitto, the MQTT message daemon, and they are likely send with RETAINED=true. This means after they are send to the MQTT daemon, they will always be there and containing the latest information.
So in this case you have send the CONFIG messages to the wrong MQTT TOPIC previously, but they will be there until you manually remove them.
Just use the MQTT Explorer in windows to have a look at all message in the HOMEASSISTANT topic and delete all that aren't CONFIG messages:
This shows a correct message, where the last name in the TOPIC is CONFIG. Any other message should be deleted by clicking the BIN icon right-top or just hit the delete key when the topic is selected:
You are using the Beta AutoDiscovery, this is an integration without the Plugin!
All CONFIG messages are send from your hardware gateway (ZIGBEE2MQTT/ZWAVEJS2MQTT...etc) to Mosquitto, the MQTT message daemon, and they are likely send with RETAINED=true. This means after they are send to the MQTT daemon, they will always be there and containing the latest information.
So in this case you have send the CONFIG messages to the wrong MQTT TOPIC previously, but they will be there until you manually remove them.
Just use the MQTT Explorer in windows to have a look at all message in the HOMEASSISTANT topic and delete all that aren't CONFIG messages:
This shows a correct message, where the last name in the TOPIC is CONFIG. Any other message should be deleted by clicking the BIN icon right-top or just hit the delete key when the topic is selected:
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
-
- Posts: 223
- Joined: Sunday 30 March 2014 15:24
- Target OS: Linux
- Domoticz version: Beta
- Location: Waterland
- Contact:
Re: MQTT Audo-discovery
Ok thanks, I will try this and let you know. Thanks for your help.jvdz wrote: ↑Friday 24 December 2021 15:48 Plugin? No idea what the relation is with a Plugin here.
You are using the Beta AutoDiscovery, this is an integration without the Plugin!
All CONFIG messages are send from your hardware gateway (ZIGBEE2MQTT/ZWAVEJS2MQTT...etc) to Mosquitto, the MQTT message daemon, and they are likely send with RETAINED=true. This means after they are send to the MQTT daemon, they will always be there and containing the latest information.
So in this case you have send the CONFIG messages to the wrong MQTT TOPIC previously, but they will be there until you manually remove them.
Just use the MQTT Explorer in windows to have a look at all message in the HOMEASSISTANT topic and delete all that aren't CONFIG messages:
This shows a correct message, where the last name in the TOPIC is CONFIG. Any other message should be deleted by clicking the BIN icon right-top or just hit the delete key when the topic is selected:
mqtt-explorer.png
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
-
- Posts: 101
- Joined: Tuesday 04 March 2014 10:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Surrey, UK
- Contact:
Re: MQTT Audo-discovery
I've finally cracked it.
I had the MQTT Prefix & Home Assistant Discovery Prefix set the same, changing them to the following fixed it:-
MQTT Prefix - Zwave_Messages
Home Assistant Discovery Prefix - Zwave_Discovery
I had the MQTT Prefix & Home Assistant Discovery Prefix set the same, changing them to the following fixed it:-
MQTT Prefix - Zwave_Messages
Home Assistant Discovery Prefix - Zwave_Discovery
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.
- 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
What is the reason you all seem to have the desire to change the defaults set by all these components?
They all have "homeassistant" as the default discovery which is fine for starters, but indeed the essence is to use the same prefixes or else Domoticz won't listen to the correct topic for the Devices configs. .... and be especially careful not changing the STATE update topic to the TOPIC used for discovery because that gives all these error messages as we have seen in this thread!.
Maybe this is something that needs to be more explained in the Wiki?
Either way... Merry Christmas to all,
Jos
** moved to new sub forum **
They all have "homeassistant" as the default discovery which is fine for starters, but indeed the essence is to use the same prefixes or else Domoticz won't listen to the correct topic for the Devices configs. .... and be especially careful not changing the STATE update topic to the TOPIC used for discovery because that gives all these error messages as we have seen in this thread!.
Maybe this is something that needs to be more explained in the Wiki?
Either way... Merry Christmas to all,
Jos
** moved to new sub forum **
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: MQTT Audo-discovery
I updated the zigbee2mqtt page as much as possible https://www.domoticz.com/wiki/Zigbee2MQ ... todiscover
The Zwavejs2mqtt page I did not change yet due to a lack of a good examples and less documentation on the Zwavejs2mqtt website.
The Zwavejs2mqtt page I did not change yet due to a lack of a good examples and less documentation on the Zwavejs2mqtt website.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
- 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
Thanks, but why do we "strongly advice" to change the discovery topic in the wiki?
I would strongly advice to only change the defaults when one truly understands how things work.
Also would advice to only use multiple MQTT Hardware in Domoticz, when one understands the whole process, as that indeed will require different discovery TOPICS.
I would strongly advice to only change the defaults when one truly understands how things work.
Also would advice to only use multiple MQTT Hardware in Domoticz, when one understands the whole process, as that indeed will require different discovery TOPICS.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: MQTT Audo-discovery
The strong advice is only when you use multiple mqtt gateways (eg zigbee2mqtt and Zwavejs2mqtt) on the same time.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 101
- Joined: Tuesday 04 March 2014 10:33
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Surrey, UK
- Contact:
Re: MQTT Audo-discovery
I changed the discovery topic as I'm using both zigbee2mqtt and Zwavejs2mqtt
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.
- 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
I have used both testing with zwavejs2mqtt; zigbee2mqtt; tasmota; milight-espgateway; esphome...
1. just one domoticz mqtt hardware with discovery topic homeassistant for all gateways I
2. having separate mqtt hardware for each gateway in domoticz.
Agree that separating has its advantages, especially organizing the devices per gateway, but each needs a unique discovery topic which also needs to configured in the appropriate gateway. You also want to disable the domoticz in/out topics in the extra mqtt hardware by leaving those fields empty.
1. just one domoticz mqtt hardware with discovery topic homeassistant for all gateways I
2. having separate mqtt hardware for each gateway in domoticz.
Agree that separating has its advantages, especially organizing the devices per gateway, but each needs a unique discovery topic which also needs to configured in the appropriate gateway. You also want to disable the domoticz in/out topics in the extra mqtt hardware by leaving those fields empty.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: MQTT Audo-discovery
Yes, please have someone with a wiki account and Zwavejs2mqtt modify the Zwavejs2mqtt page if the information should be improved. I am happy to do so if someone delivers me the text and some good screenshots.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
- 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
Agree and we might even want to separate it from the zigbee2mqtt part as this is much more than just that gateway. I see AutoDiscovery is also partly described in the MQTT Hardware page: https://www.domoticz.com/wiki/MQTT#Add_ ... Gateway.22
Maybe that is a better place to go into the details of AutoDiscovery?
Maybe that is a better place to go into the details of AutoDiscovery?
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: MQTT Audo-discovery
My thoughts: There is a Zwavejs2mqtt and a zigbee2mqtt page on the wiki. So for people using that particular gateway should have a good description how to add the hardware gateway on Domoticz including some tips what should be the way if they have more Autodiscover gateways. The mqtt page should be as global as possible and should refer to the particular gateway if available.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
- 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
Makes thing more complicated. perhaps have it all on the MQTT hardware page and put links on all xxx2mqtt pages to the MQTT hardware page.waltervl wrote: ↑Sunday 26 December 2021 11:41 My thoughts: There is a Zwavejs2mqtt and a zigbee2mqtt page on the wiki. So for people using that particular gateway should have a good description how to add the hardware gateway on Domoticz including some tips what should be the way if they have more Autodiscover gateways. The mqtt page should be as global as possible and should refer to the particular gateway if available.
Greetings McMelloW
-
- Posts: 223
- Joined: Sunday 30 March 2014 15:24
- Target OS: Linux
- Domoticz version: Beta
- Location: Waterland
- Contact:
Re: MQTT Audo-discovery
Itś working without the errors now! I did a complete new installation on my test system and changed no settings, only the host url and that did the Job. Thanks for the help.jvdz wrote: ↑Friday 24 December 2021 22:30 What is the reason you all seem to have the desire to change the defaults set by all these components?
They all have "homeassistant" as the default discovery which is fine for starters, but indeed the essence is to use the same prefixes or else Domoticz won't listen to the correct topic for the Devices configs. .... and be especially careful not changing the STATE update topic to the TOPIC used for discovery because that gives all these error messages as we have seen in this thread!.
Maybe this is something that needs to be more explained in the Wiki?
Either way... Merry Christmas to all,
Jos
** moved to new sub forum **
Rpi, RFXcom, klikaan klikuit switch,thermosmart, z-wave, espeasy, smartevse
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: MQTT Audo-discovery
The thing is that every xx2mqtt implementation needs its own instructions to install. Better to have seperate pages as Domoticz mqtt autodiscover is only a small part of the total instruction set. Needed for the first time users. Also needed for users who want to step over from zigbee2mqtt plugin or native OZW integration.McMelloW wrote: ↑Sunday 26 December 2021 13:10Makes thing more complicated. perhaps have it all on the MQTT hardware page and put links on all xxx2mqtt pages to the MQTT hardware page.waltervl wrote: ↑Sunday 26 December 2021 11:41 My thoughts: There is a Zwavejs2mqtt and a zigbee2mqtt page on the wiki. So for people using that particular gateway should have a good description how to add the hardware gateway on Domoticz including some tips what should be the way if they have more Autodiscover gateways. The mqtt page should be as global as possible and should refer to the particular gateway if available.
There are already references from the mqtt wiki to the xx2mqtt gateways.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Re: MQTT Audo-discovery
Just my 2 cents. Less is more/better. A wiki is mostly not for advanced users. So keep it simple and very clear.
A link in the Domoticz Wiki to Home Assistant MQTT Discovery might be confusing.
Text like: should be:
because that is the exact text in Domoticz itself, and that is easier for the starting user.
A link in the Domoticz Wiki to Home Assistant MQTT Discovery might be confusing.
Text like:
Code: Select all
If enabled leave Prefex Topic in and Out empty.
Code: Select all
If enabled leave Topic In Prefix: and Topic Out Prefix: empty.
-
- Posts: 99
- Joined: Friday 25 January 2019 11:33
- Target OS: Linux
- Domoticz version: beta
- Location: Poland
- Contact:
Re: MQTT Audo-discovery
Hello, adding devices works perfectly for me domoticz ver beta (build 14112). I have a question where the plug stores information about the device? I want to remove the sonoff r3 module from tasmota, after disconnecting the module and removing all devices, for this sonoff after updating the autodiscovery hardware everything comes back and the module is without power.
Below is a log with a disconnected module, it cannot send the status
Below is a log with a disconnected module, it cannot send the status
Code: Select all
2022-01-27 15:04:55.916 Status: AUTO MQTT: discovered: C896C0/Ogród ENERGY TotalStartTime (unique_id: C896C0_ENERGY_TotalStartTime)
2022-01-27 15:04:56.019 Status: AUTO MQTT: discovered: C896C0/Ogród ENERGY Total 1 (unique_id: C896C0_ENERGY_Total_1)
2022-01-27 15:04:56.120 Status: AUTO MQTT: discovered: C896C0/Ogród ENERGY Total 2 (unique_id: C896C0_ENERGY_Total_2)
2022-01-27 15:04:56.222 Status: AUTO MQTT: discovered: C896C0/Ogród ENERGY Yesterday 1 (unique_id: C896C0_ENERGY_Yesterday_1)
2022-01-27 15:04:56.323 Status: AUTO MQTT: discovered: C896C0/Ogród ENERGY Yesterday 2 (unique_id: C896C0_ENERGY_Yesterday_2)
2022-01-27 15:04:56.425 Status: AUTO MQTT: discovered: C896C0/Ogród ENERGY Today 1 (unique_id: C896C0_ENERGY_Today_1)
2022-01-27 15:04:56.526 Status: AUTO MQTT: discovered: C896C0/Ogród ENERGY Today 2 (unique_id: C896C0_ENERGY_Today_2)
2022-01-27 15:04:56.627 Status: AUTO MQTT: discovered: C896C0/Ogród ENERGY Power 1 (unique_id: C896C0_ENERGY_Power_1)
2022-01-27 15:04:56.729 Status: AUTO MQTT: discovered: C896C0/Ogród ENERGY Power 2 (unique_id: C896C0_ENERGY_Power_2)
2022-01-27 15:04:56.830 Status: AUTO MQTT: discovered: C896C0/Ogród ENERGY ApparentPower 1 (unique_id: C896C0_ENERGY_ApparentPower_1)
2022-01-27 15:04:56.932 Status: AUTO MQTT: discovered: C896C0/Ogród ENERGY ApparentPower 2 (unique_id: C896C0_ENERGY_ApparentPower_2)
2022-01-27 15:04:57.033 Status: AUTO MQTT: discovered: C896C0/Ogród ENERGY ReactivePower 1 (unique_id: C896C0_ENERGY_ReactivePower_1)
2022-01-27 15:04:57.135 Status: AUTO MQTT: discovered: C896C0/Ogród ENERGY ReactivePower 2 (unique_id: C896C0_ENERGY_ReactivePower_2)
2022-01-27 15:04:57.236 Status: AUTO MQTT: discovered: C896C0/Ogród ENERGY Factor 1 (unique_id: C896C0_ENERGY_Factor_1)
2022-01-27 15:04:57.338 Status: AUTO MQTT: discovered: C896C0/Ogród ENERGY Factor 2 (unique_id: C896C0_ENERGY_Factor_2)
2022-01-27 15:04:57.439 Status: AUTO MQTT: discovered: C896C0/Ogród ENERGY Voltage (unique_id: C896C0_ENERGY_Voltage)
2022-01-27 15:04:57.541 Status: AUTO MQTT: discovered: C896C0/Ogród ENERGY Current 1 (unique_id: C896C0_ENERGY_Current_1)
2022-01-27 15:04:57.642 Status: AUTO MQTT: discovered: C896C0/Ogród ENERGY Current 2 (unique_id: C896C0_ENERGY_Current_2)
2022-01-27 15:04:57.744 Status: AUTO MQTT: discovered: C896C0/Ogród ENERGY BL09XX Temperature (unique_id: C896C0_ENERGY_BL09XX_Temperat)
2022-01-27 15:04:57.845 Status: AUTO MQTT: discovered: C896C0/Ogród ESP32 Temperature (unique_id: C896C0_ESP32_Temperature)
2022-01-27 15:04:57.946 Status: AUTO MQTT: discovered: Ogród/Ogród status (unique_id: C896C0_status)
- waltervl
- Posts: 5148
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: MQTT Audo-discovery
The MQTT broker (eg Mosquitto) stores these devices if you had retained messages switched on in Tasmota.
To get rid of those retained messages in MQTT broker see https://www.domoticz.com/wiki/MQTT#Dele ... ined_topic
To get rid of those retained messages in MQTT broker see https://www.domoticz.com/wiki/MQTT#Dele ... ined_topic
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
-
- Posts: 99
- Joined: Friday 25 January 2019 11:33
- Target OS: Linux
- Domoticz version: beta
- Location: Poland
- Contact:
Re: MQTT Audo-discovery
Thank you, it was a good direction.
Additionally, restart mosqutto after removing retained messages
Additionally, restart mosqutto after removing retained messages
- 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
You also need to restart Domoticz to clear its INTERNAL HA AD devices table, as that is build when the config MQTT message are received and not clear until a restart of Domoticz.
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Who is online
Users browsing this forum: No registered users and 0 guests