Using Node Red to control lights with MQTT. Currently I have one esp8266 running espeasy and 4 inputs with pushbuttons each with its own topic. So far it works great!
Now I'm thinking I could use maybe 3 more of these esp8266s with pushbuttons in various parts of my house.
Instead of having 4 individual mqtt subscribe nodes for each of 3 Node Red inputs for light control, can I duplicate the Unit Name of the 3 additional esp8266s with different Unit Numbers?
This way all of the published topics are the same but coming from 4 different sources. The esp8266s only publish and are not subscribed to any topic.
How To? Multiple Source MQTT Publishing
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 31
- Joined: 20 Oct 2017, 23:47
Re: How To? Multiple Source MQTT Publishing
I am not sure if I understand your suggestion.
A lot of nodes may subscribe or publish to the same topic.
But on the receiving end you must make sure you can differentiate.
The publish topic can be configured containing system variables.
A client can subscribe to match several topics by placing a # in strategic place.
So you can also publish to separate topics and read them all via a single subscription string.
Is that what you need?
A lot of nodes may subscribe or publish to the same topic.
But on the receiving end you must make sure you can differentiate.
The publish topic can be configured containing system variables.
A client can subscribe to match several topics by placing a # in strategic place.
So you can also publish to separate topics and read them all via a single subscription string.
Is that what you need?
Re: How To? Multiple Source MQTT Publishing
I propose a different solution. Go to ESPEasy Controller's setup page and edit the MQTT Controller Publish entry. It defaults to this:... can I duplicate the Unit Name of the 3 additional esp8266s with different Unit Numbers?
Code: Select all
%sysname%/%tskname%/%valname%
Code: Select all
COMMON_HARD_CODED_NAME/%tskname%/%valname%
Now the published messages from the four switch controller devices will appear as if they came from the same source.
- Thomas
-
- Normal user
- Posts: 31
- Joined: 20 Oct 2017, 23:47
Re: How To? Multiple Source MQTT Publishing
Thanks! That was the information I was looking for. I didn't see any reason why naming the 4 espeasy devices with the same name would cause any conflict within themselves. I'll move forward with building additional button panels.
Espeasy has really made it possible for non-coders like myself to accomplish some otherwise complicated processes.
Espeasy has really made it possible for non-coders like myself to accomplish some otherwise complicated processes.
Who is online
Users browsing this forum: No registered users and 106 guests