MQTT Autodiscovery - need to force rediscovery after restart only for 1 device : Fibaro FGS211

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

Moderator: leecollings

Post Reply
rezzalex
Posts: 49
Joined: Thursday 24 September 2020 14:30
Target OS: NAS (Synology & others)
Domoticz version: Beta
Contact:

MQTT Autodiscovery - need to force rediscovery after restart only for 1 device : Fibaro FGS211

Post by rezzalex »

Hello,

I am using Domoticz Version: 2022.1 (build 14311), Zwavejs2Mqtt 6.7 (embedded Z-Wave JS 9.0.1), plus Mosquitto, all that as containers.
I am stopping my NAS (HOST) every night and restarting it every morning.

Probably since my latest ZwaveJstoMQTT upgrade, as well as Domoticz upgrade, I have always the same unique Zwave Device that is not working after the restart. Using the action button in Domoticz simply does nothing. It is working again after forcing the discovery in Zwavejs2Mqtt, for this precise Zwave node.
This zwave Device is a Fibaro FGS211.


From Domoticz perspective, after my daily start, I have those logs every 2 min for ... quite a long time, it may be until I force either the full ZwaveJstoMqtt container restart or just the Rediscovery of problematic node (from ZwavejstoMqtt UI / console) :

Code: Select all

Error: Zwave: disconnected, restarting (rc=19/Unknown error.)
in the meanwhile, only 1 node is not working... the rest is correctly discovered...
User avatar
waltervl
Posts: 5851
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: MQTT Autodiscovery - need to force rediscovery after restart only for 1 device : Fibaro FGS211

Post by waltervl »

Did you try to force a startup sequence eg Domoticz, Mosquitto, ZwaveJS2MQTT?
I will not ask why you decided to restart your Domoticz environment every night..... It would help if you skipped that.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
rezzalex
Posts: 49
Joined: Thursday 24 September 2020 14:30
Target OS: NAS (Synology & others)
Domoticz version: Beta
Contact:

Re: MQTT Autodiscovery - need to force rediscovery after restart only for 1 device : Fibaro FGS211

Post by rezzalex »

Hello,

Stopping my NAS every night to save energy...

I still don t know how to set up a container stat order and dependencies...
I know there is some ways to do that, but
I would prefer looking at my zwavejs2mqtt setting first and possible domoticz auto discovery issue... Unless my issue is common to all users using container that are regularly restarted... But I don't think so, because when first migrating to Zwavejs2mqtt, this issue was not there...
User avatar
gizmocuz
Posts: 2546
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: MQTT Autodiscovery - need to force rediscovery after restart only for 1 device : Fibaro FGS211

Post by gizmocuz »

the error 'disconnected, restarting' you see is because you get disconnected from your MQTT broker.
Could you enable logging in your MQTT broker and see if this logs any suspicious messages ?

I have will send you a email message for a debug request
Quality outlives Quantity!
rezzalex
Posts: 49
Joined: Thursday 24 September 2020 14:30
Target OS: NAS (Synology & others)
Domoticz version: Beta
Contact:

Re: MQTT Autodiscovery - need to force rediscovery after restart only for 1 device : Fibaro FGS211

Post by rezzalex »

I have removed the 2 "retained" options in ZwaveJS2MQTT.
Also, I have removed a "legacy setting" that remains in my DZ container: the binding to the physical USB port where the Zwave controller is plugged. Now, only Zwavejs2MQTT container access it.

And I saw that the 3 containers are started almost all at the same time, with just some seconds interval between each.
I have just restarted my NAS and relaunch ZwaveJs2MQTT container 4 minutes after DZ and Mosquitto, and.... all went well from the beginning...

to be monitored and confirmed
rezzalex
Posts: 49
Joined: Thursday 24 September 2020 14:30
Target OS: NAS (Synology & others)
Domoticz version: Beta
Contact:

Re: MQTT Autodiscovery - need to force rediscovery after restart only for 1 device : Fibaro FGS211

Post by rezzalex »

en redémarrant le plugin DZ mqtt auto discovery :

Code: Select all

2022-04-25 16:05:27.710 Error: Zwave: disconnected, restarting (rc=19/Unknown error.)
rezzalex
Posts: 49
Joined: Thursday 24 September 2020 14:30
Target OS: NAS (Synology & others)
Domoticz version: Beta
Contact:

Re: MQTT Autodiscovery - need to force rediscovery after restart only for 1 device : Fibaro FGS211

Post by rezzalex »

I have tried to add a DZ script that waits 3 minutes after DZ starts to launch the ZwaveJS2MQTT container.
I have discovered that the log message for discovering devices is working only with only Mosquitto running, not ZwaveJStoMQTT...
then I had again

Code: Select all

2022-04-25 16:30:35.723 Error: Zwave: disconnected, restarting (rc=19/Unknown error.)
rezzalex
Posts: 49
Joined: Thursday 24 September 2020 14:30
Target OS: NAS (Synology & others)
Domoticz version: Beta
Contact:

Re: MQTT Autodiscovery - need to force rediscovery after restart only for 1 device : Fibaro FGS211

Post by rezzalex »

Hello,

Here is my MQTT explorer at DZ, Mosquitto and ZwaveJsMQTT start
Sans titre.png
Sans titre.png (88.86 KiB) Viewed 2009 times
with the DZ previous error message still present every 2 minutes :

Code: Select all

Error: Zwave: disconnected, restarting (rc=19/Unknown error.)
In Mqtt explorer, seeing the Domoticz Topic, there is NO switch or lights, only sensors...

then If I force discovery from ZwavejsMQTT
Sans titre2.png
Sans titre2.png (95.2 KiB) Viewed 2009 times
I can then see it in MQTT explorer under Domoticz Topic :
Sans titre3.png
Sans titre3.png (87.47 KiB) Viewed 2009 times
Now this Switch is working from DZ (previously I had an error message while clicking on it) and I don't have anymore the DZ MQTTauto discovery error message... but the other switches are NOT working from DZ (working from ZwajsMQTT), only the one I have reforced the discovery is working...

than, clicking "SAVE" in zwavejs2MQTT config generated a rediscovery in DZ and.. here it is (se next Post :
Last edited by rezzalex on Wednesday 27 April 2022 13:48, edited 1 time in total.
rezzalex
Posts: 49
Joined: Thursday 24 September 2020 14:30
Target OS: NAS (Synology & others)
Domoticz version: Beta
Contact:

Re: MQTT Autodiscovery - need to force rediscovery after restart only for 1 device : Fibaro FGS211

Post by rezzalex »

Sans titre4.png
Sans titre4.png (58.38 KiB) Viewed 2008 times
and now ALL is working....

my ZwaveJs2MQTT conf is :
. MQTT section : All is OFF

. Gateway : all is OFF except
- "use node names instead of numeric..."
- " include node info"
- "publish node details"

.Home Assistant : All is off except
- "MQTT Discovery"

Would you have any idea ?
rezzalex
Posts: 49
Joined: Thursday 24 September 2020 14:30
Target OS: NAS (Synology & others)
Domoticz version: Beta
Contact:

Re: MQTT Autodiscovery - need to force rediscovery after restart only for 1 device : Fibaro FGS211

Post by rezzalex »

I did re enabled the retain option for discovery, wait for all to be rediscovered with the "retain" flag, restart my NAS and after some a couple of minutes to allow all discovery to finish... All went well.... To be monitored tomorrow morning...

Ah also, previously, i did removed all the wrong topics via MQTT explorer... : re enable topic to use names and delete all topic containing an ID number...
rezzalex
Posts: 49
Joined: Thursday 24 September 2020 14:30
Target OS: NAS (Synology & others)
Domoticz version: Beta
Contact:

Re: MQTT Autodiscovery - need to force rediscovery after restart only for 1 device : Fibaro FGS211

Post by rezzalex »

Hello,
No more issues at the latest reboot...
Here is what I did and what happened:

. DZvent script to Restart Zwavejs2MQTT 5 min after DZ starts

. Change of value for 2 options in Mosquitto conf :

- max_queued_messages: the limit of the delivery queue - default is 100 ==> setted it to 1000.
- max_inflight_messages: the number of QoS 1 and 2 messages which can be processed simultaneously (i.e. be in a pending state). The default is 20, ==> setted it to 1000.

the idea was to avoid DZ MQTT connection being dropped.

at DZ, Mosquitto and ZwaveJS2MQTT start, when 1st discovery seems to be finished (no more discover messages in logs), Pushing a switch button triggers an error message (switch IDX not available...). A few minutes later, the same action simply does nothing without any error message.
After the restart of ZwaveJS2MQTT, all went well immediately, except for one sensor that did not refresh its value...
rezzalex
Posts: 49
Joined: Thursday 24 September 2020 14:30
Target OS: NAS (Synology & others)
Domoticz version: Beta
Contact:

Re: MQTT Autodiscovery - need to force rediscovery after restart only for 1 device : Fibaro FGS211

Post by rezzalex »

Since My last message, it went wrong again...

now it's been 2 days since I have NO DZ MQTT AD error at start-up. Here is what I have changed :

- In ZwaveJS2MQTT : Revert to the default discovery prefix "homeassistant" (on both side). And remove old MQTT topics with MQTT explorer.
- in the MOSQUITTO : Change the parameter to have logs with real date and time rather than timestamp ==> I then discovered the Mosquitto container's time was 2 or 3 hours delayed... ==> so I bind the container's time to the host's time.

Discovered that some sensors did not have their value refreshed at discovery :
- it was some Philio PST02A with motion detection stuck on "ON" state ==> did some manip in ZwaveJS2MQTT : re interrogate node, re update topic, refresh value, rediscover topic ... now seems OK, except for one of this (only this morning), where the sensor did nothing until a did the previous manipulations...

- I have a Fibaro FGBS001 that gives me the status of my Portal Door. Previously, it was always set on "OPEN" at discovery and remained in this wrong state (in reality it is closed) until a real open and close... Now I can see in my logs that at discovery, it goes OPEN and CLOSED immediately...

Probably now I need to test removing ma script that restart ZwaveJS2MQTT 5 min after DZ starts... and monitor.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest