Explainer
Why FUXA subscribe tags publish on a UI write
Short answer
MQTT has no read-only subscription, so FUXA's publish and subscribe tag modes are advisory: a UI write on a subscribe tag still reaches the broker, and the broker echoes it back. Deny publish on status topics in the broker ACL for the FUXA user, keep command topics write-only, and filter echoes in Node-RED.

On this page
Write a value into a FUXA tag configured as subscribe and the interface sends it to the broker, even though the tag's definition carries no pubs entry. That is not a misconfiguration. MQTT has no read-only subscription, a subscribe mode in any client is advisory, and in the current FUXA build the write path follows the tag address regardless of mode. The fix is not in the tag: enforce direction where it can actually be enforced — a broker ACL that gives the FUXA user read-only status topics and write-only command topics — and add an echo filter in the Node-RED gateway, because a subscribe tag that publishes to its own topic receives its own message back.
The two tags on the wire #
Both tags are MQTT tags of raw type with the topic stored in address, and both run with daq disabled. They differ in which option list they hold and in one extra field.
| Field | Subscribe tag | Publish tag |
|---|---|---|
address |
device/topic/status |
device/topic/command |
options |
subs: array of topic strings |
pubs: array of objects with type, key, value and name |
memaddress |
present, equal to address |
absent |
| Interface write | publishes (observed) | publishes (as designed) |
daq |
enabled false, interval 60 |
enabled false, interval 60 |
The asymmetry is the whole question: the subscribe tag registers its topic for inbound delivery in subs, the publish tag declares its outbound target in pubs, and yet both emit on an interface write.
Why MQTT has no read-only subscription #
A subscription in MQTT is a delivery filter, not a permission. A client that holds a session can publish to any topic its broker credentials allow; nothing in the subscribe packet says deliver-only. Direction is a property you build: either the client refuses to publish — FUXA currently does not — or the broker refuses to accept, which is an ACL. The broker mediates every message between publisher and subscriber, which is the model in how MQTT clients publish and subscribe through the broker, and it is why the broker is the right place to hold direction.
One protocol consequence matters here: an MQTT 3.1.1 broker delivers a publish to every client with a matching subscription, including the client that published it. A FUXA subscribe tag that publishes to its own topic therefore gets its own message back, and any gateway flow that republishes what it receives turns that echo into a loop.
Where memaddress fits and why the mode is advisory #
The publish happens with no pubs entry, so the write path cannot be reading that list — it keys on the tag's address, and the subscribe tag carries its topic in both address and memaddress. Treat memaddress as a field FUXA itself writes for subscribe tags: in the export it equals address and the subs entry, and only subscribe tags carry it. Nothing in the observed behavior depends on it beyond duplicating the topic, so do not use it as a switch — create and edit tags in the FUXA tag editor instead of hand-editing the JSON, so the fields stay consistent.
What the mode still decides is where data is expected to originate. Only a subscribe tag registers its topic in subs, so the broker delivers inbound values to FUXA; a publish tag expects the value to originate inside FUXA. That is the entire functional difference. The mode is advisory and the field contract is not enforced in the current build — an unimplemented restriction rather than an error on your side — so design the system so the broker, not the tag mode, holds the direction.
Counting the messages for one UI write on device/topic/status #
Inputs, each with its source:
- One UI write on the subscribe tag
device/topic/status— the case observed in the integration. - Two subscribers to that topic — the FUXA server, which lists it in
subs, and the Node-RED gateway'smqtt innode. - One gateway flow that republishes what it receives — the loop condition.
daqdisabled withinterval60 on both tags — from the tag definitions, so this traffic is change-driven and the interval never gates it.- The proposed ACL — the FUXA user denied write on status topics, granted write on command topics.
The rule: every publish the broker accepts is delivered once to each subscriber; a delivery that the gateway republishes becomes a new accepted publish; a publish the ACL denies reaches nobody.
- Neither control: 1 write → 1 publish → 1 × 2 = 2 deliveries → 1 republish → 1 × 2 = 2 deliveries → 1 republish → and so on, one new publish per broker round trip, with nothing in the path to stop it.
- Echo filter only: 1 write → 1 publish → 2 deliveries → the first copy is new, so it is forwarded and republished → 2 deliveries → the repeat payload is dropped → end. One operator action leaves 2 publishes and 4 deliveries on the wire.
- ACL in place: the broker denies the publish → 0 accepted publishes → 0 × 2 = 0 deliveries.
Result: with the ACL the status topic carries nothing for that write; the filter alone leaves 2 publishes and 4 deliveries and then stops; with neither control the count never stops. Decision: the acceptance threshold is zero — after the ACL, a UI write on device/topic/status must produce 0 messages at any subscriber, while a command write on device/topic/command must still produce its publish. Any message above zero on the status topic means the ACL is not in effect; check that the user line matches the FUXA server's login name and reload the broker.
Enforcing direction with a broker ACL #
Give every signal exactly one direction. Status topics carry device-to-FUXA data, command topics carry FUXA-to-device data, and no topic ever appears in both a subs and a pubs entry. Then create a dedicated broker user for the FUXA server — not the credentials Node-RED or the field device use — and grant it read on the status topics and write on the command topics. In a Mosquitto ACL file that is:
user fuxa
topic read device/topic/status
topic write device/topic/command
Here fuxa is the example name of the FUXA server's broker login; with many devices, use the broker's wildcard patterns in the ACL topics, for example device/+/status. Apply the equivalent rule in whatever ACL mechanism your broker provides, then reload the configuration and reconnect FUXA so the new permissions take effect. The walkthrough to run a secure Mosquitto MQTT lab broker with Node-RED builds exactly this ACL file together with TLS.
Expect one visible side effect: an MQTT 3.1.1 broker drops a denied publish without telling the client, so FUXA will display the operator's written value while the topic still carries the real one, until the next genuine status message overwrites it. Remove UI write access for subscribe tags in the view or user permissions so nobody acts on that false display.
Breaking echo loops in Node-RED #
Keep loop protection in the gateway even with the ACL, because other publishers can still echo. Place a function node directly after the mqtt in node on each status topic and drop any message whose payload equals the last one forwarded on that topic:
// 'lastStatus' is this example's own context key: { topic: lastForwardedPayload }.
// msg is the Node-RED message object; flow.get and flow.set are the documented context calls.
const key = msg.topic; // string: the incoming topic
const now = JSON.stringify(msg.payload); // string: the payload, serialized for comparison
const last = flow.get('lastStatus') || {}; // object: starts empty on the first deploy
if (last[key] === now) {
return null; // a repeat: stop it here
}
last[key] = now;
flow.set('lastStatus', last);
return msg;
key, now and last are variables this example declares; msg.topic, msg.payload, flow.get and flow.set are the documented Node-RED names. The test that proves it: publish the same payload to the status topic twice from the device side and watch a debug node after the function — exactly one message comes through.
The filter also swallows legitimate repeated values from the device. If a consumer needs every sample, compare on a device timestamp carried in the payload instead of the raw value. And keep the structural rule above all: a flow must never publish back to a topic that one of its own mqtt in nodes subscribes to. If both applications share one machine, the setup in connecting Node-RED and FUXA on one edge server is the arrangement this filter sits in.
Proving the result with a test subscriber #
Attach a monitoring subscriber whose credentials may read both topics and watch the whole device prefix:
mosquitto_sub -t "device/topic/#" -v
Then run the three checks:
- Write the subscribe tag
device/topic/statusfrom the FUXA interface. Nothing may appear on the status topic — before the ACL, one message appeared here, and that difference is the entire fix. - Write the publish tag
device/topic/commandfrom the interface. Exactly one message must appear on the command topic, proving the write grant survived the change. - Publish a test value to
device/topic/statusfrom the device side. The FUXA tag must update, and the debug node after the echo filter must show a single copy with no repeats.
If step 1 shows anything at all, the ACL is not in effect: confirm the user line matches the FUXA server's login name, reload the broker, and reconnect FUXA. If step 2 shows nothing, the write grant is missing or the ACL topic pattern does not match. When all three behave as written, direction is enforced at the only place that can enforce it — and a future FUXA release that finally honors the mode costs you nothing.
Questions asked
Is this behavior a mistake in my tag configuration?
No. Both tag definitions are well formed, and the write path follows the tag address rather than the pubs list, so a correct subscribe tag still publishes on an interface write in the current build. Rebuilding the tag or editing the exported JSON changes nothing; only the broker permission stops the message.
Does MQTT version 5 make subscriptions directional?
No. Version 5 adds publish reason codes, so a broker can report a denied publish instead of dropping it silently, plus a no-local option that stops the broker echoing your own messages back to you. A subscription still carries no direction, so the ACL remains the control; the new features help only if the client software uses them.
What if the device offers a single topic for both commands and status?
Split the direction at the gateway. Let Node-RED own the device topic and map it to two internal topics, one for status and one for commands, then apply the ACL to the internal topics. The gateway flow decides which payload travels in which direction, and the FUXA user never touches the device topic itself.
Can the ACL go once a FUXA release fixes the tag modes?
Keep it until you have retested the deployed build. A release note is not proof: write to a subscribe tag from the interface and watch your own test subscriber, and relax the read-only rule only when no message appears. Until then the ACL costs nothing and also covers any other client on the plant network.


