I have two sonoff switches. When I set one switch, I have no problem to control it with node-red through mosquitto broker.
But when I add another identical switch, I have mqtt connection lost and re connect alternatively between the two switches and lost control on GPIO 12 of one switch.
In the log, the connection failure count also increase alternatively two at a time.
I name the switches differently also the names in the device definition differently.
What am I missing?
How to set Espeasy when 2 switches are using the same broker
Moderators: grovkillen, Stuntteam, TD-er
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: How to set Espeasy when 2 switches are using the same broker
Tried giving them different Unit number?
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: How to set Espeasy when 2 switches are using the same broker
Thank you
Where can I give them a unique unit number? The name of each unit is different, i.e. Sonoff1/# and sonoff2/#
Where can I give them a unique unit number? The name of each unit is different, i.e. Sonoff1/# and sonoff2/#
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: How to set Espeasy when 2 switches are using the same broker
Under the config tab.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: How to set Espeasy when 2 switches are using the same broker
Nvm
I saw the unit number entry in the config menu. Never thought it is significant
Thank you
I saw the unit number entry in the config menu. Never thought it is significant
Thank you
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: How to set Espeasy when 2 switches are using the same broker
A piece of advice: include the unit number in the device name. I.e. nodename_001, nodename_002 etc. It may be hard to find what next number is available.
PS. this should be implemented in the FW (to be able to publish the %unitnr% as the same manner as %ip%, %sysname% and %systime%). Just my opinion..
PS. this should be implemented in the FW (to be able to publish the %unitnr% as the same manner as %ip%, %sysname% and %systime%). Just my opinion..
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: How to set Espeasy when 2 switches are using the same broker
actually I found out if you put a / in the espeasy name, you can subscribe and publish with a /# qualifier
For example, I name each sonoff switch as sonoff/1.....x instead of sonoff1....x
The benefit of that is in subscribe, I only need to subscribe: sonoff/# and one MQTT client will receive the information from all switches.
and when I publish, I can publish to "sonoff" and each sonoff unit will receive the same command. In my case, I only need one big timer in node red to control all my switches.
That is if you want to treat the series of switches in a "scene" like in IFTTT. You can also easily control each unit separately by using the full name convention.
For example, I name each sonoff switch as sonoff/1.....x instead of sonoff1....x
The benefit of that is in subscribe, I only need to subscribe: sonoff/# and one MQTT client will receive the information from all switches.
and when I publish, I can publish to "sonoff" and each sonoff unit will receive the same command. In my case, I only need one big timer in node red to control all my switches.
That is if you want to treat the series of switches in a "scene" like in IFTTT. You can also easily control each unit separately by using the full name convention.
Who is online
Users browsing this forum: No registered users and 23 guests