MQTT Auto Discovery on Synology NAS

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

Moderator: leecollings

Post Reply
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

MQTT Auto Discovery on Synology NAS

Post by mvveelen »

Hi,

I'm a bit lost. I think.

I have Domoticz running in Docker on a Synology NAS and MQTT installed as a package. I got it working with this combination, not with MQTT in Docker. But if it works, then it's OK.

There is only 1 thing I wonder. When removing one of the attached peripherals of the NAS (USB) and reattaching them, the Sonoff switches stop working and there are new Sonoff switches discovered with new ID's, all with the same name but double. I can keep doing this and every time new devices are discovered with new ID's.

Ofcourse I would like to stop this, but how?

Not sure if I have the setup correct, but I installed both MQTT hardware 'devices' I found (nothing else for MQTT) and this is the setup:

MQTT Client Gateway with LAN interface:
Remote Address: IP NAS
Port: 1883
Username: empty
Password: empty
Prevent Loop: True
Publish Topic: Flat
Topic in Prefix: domoticz/in
Topic Out Prefix: domoticz/out
CA Filename: empty
TLS Version: tlsv1.2

MQTT Auto Discovery Client Gateway with LAN interface
Remote Address: IP NAS
Port: 1883
Username: empty
Password: empty
Auto Discovery Prefix: homeassistant
CA Filename: empty
TLS Version: tlsv1.2

The Sonoff's have the following settings for MQTT:
Host: IP NAS
Port: 1883
Client: DVES_%06X
User: empty
Password: empty
Topic: sonofxx (I use different numbers for each Sonoff)
Full Topic: %topic%/%prefix%/

When I enter SetOption19 1 in the Sonoff console (one by one), the new devices are discovered when deleting all switches from Domoticz first.
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: MQTT Auto Discovery on Synology NAS

Post by mvveelen »

Suddenly, without restarting Domoticz or any of the MQTT hardware in Domoticz, all switches were 'doubled' and so there were 12. That kept working for a day, but yesterday none of them could be reached by switching on/off and I had to delete them and go to each Sonoff to enter SetOption19 1 to let them be discovered again.

This isn't the way it's supposed to work, what am I doing wrong?
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
arma_esiea
Posts: 16
Joined: Thursday 23 January 2014 21:21
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: MQTT Auto Discovery on Synology NAS

Post by arma_esiea »

I have the same config, do you stop one of the two MQTT Client Gateway ?
User avatar
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: MQTT Auto Discovery on Synology NAS

Post by mvveelen »

No I didn't. But when I restart the Syno I have to delete the discovered devices and run SetOption19 1 on every Sonoff to let them be rediscovered. Maybe I'm doing something wrong, but I don't know what.
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: MQTT Auto Discovery on Synology NAS

Post by waltervl »

Looks like a problem with Sonoff devices flashed with Tasmota. It seems that tasmota suddenly starts to send messages with new ID's. Or due to the resetsetoption 19?
Did you switch on retain MQTT message?
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
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: MQTT Auto Discovery on Synology NAS

Post by mvveelen »

I haven't changed anything on the Sonoff's and this is what I did when I flashed them with Tasmota:

SetOption19 1

It worked for years on a DS414 (Jadahl package) but on the DS920+ in Docker, after restarting the Syno, it shows me new devices. Sometimes even without restarting the Syno so it seems.

And, the other problem is that the USB devices (RFXcom and P1 cable) aren't recognised so I have to reinstall the drivers (Jadahl) after every reboot and change the settings in Domoticz.

Edit: the Sonoff's are running on Tasmota 6.3.0, is that the problem maybe?
If so, I can update them but the setup is at my in-laws house and I don't want to break things from here.

Edit 2: I broke one of the Sonoff's in the last step. Updated to the minimal versions of v7, v8, v9 and v12: success. Full version v12.2.0 : can't reach him anymore so I'll have to flash this one again :oops:
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: MQTT Auto Discovery on Synology NAS

Post by waltervl »

What version of Domoticz are you running in your docker? As mqtt Autodiscover is not that old in Domoticz I suspect you switched from a plugin to Mqtt Autodiscover.

There is still some plugins available for tasmota as MQTT Autodiscover is removed from the latest Tasmota firmwares. So for newer tasmotas you need the plugin. See the tasmota documentation: https://tasmota.github.io/docs/Domoticz/
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
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: MQTT Auto Discovery on Synology NAS

Post by mvveelen »

2022.1 (build 14438)

I'll have to find out how it works with plugins in Docker. I'm already familiar with this new plugin for my own setup (Rpi).
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: MQTT Auto Discovery on Synology NAS

Post by waltervl »

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
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: MQTT Auto Discovery on Synology NAS

Post by mvveelen »

As my father in law only uses 5 Sonoff's, I decided to make 5 Dummy switches and switch the Sonoff's with the On/Off URL in the On/Off actions of the switches. Works fine.

Now I only would like to see a solution for the USB devices, like the RFXcom and the P1 cable to be working after restarting the Synology. Now I have to reinstall the drivers and select the right port for the 2 devices. If anyone knows a solution for this, I'd be happy to try it.
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: MQTT Auto Discovery on Synology NAS

Post by waltervl »

Did you check the synology page on the wiki https://www.domoticz.com/wiki/Synology
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
mvveelen
Posts: 678
Joined: Friday 31 October 2014 10:22
Target OS: NAS (Synology & others)
Domoticz version: Beta
Location: Hoorn, The Netherlands
Contact:

Re: MQTT Auto Discovery on Synology NAS

Post by mvveelen »

Yes, and I managed to get it working but with another code which is ran after a reboot. So all's well atm.
RPi3b+/RFXCOM rfxtrx433E/Shelly/Xiaomi Gateway/Philips HUE Lights/Atag Zone One/2 SunnyBoy inverters/AirconWithMe/P1 smartmeter/Domoticz latest Beta
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest