Skip to content

(feat adapter): Sonoff - External MQTT broker and alternative Topic#517

Open
patricknitsch wants to merge 5 commits intoioBroker:masterfrom
patricknitsch:claude/sonoff-external-mqtt-F2iBP
Open

(feat adapter): Sonoff - External MQTT broker and alternative Topic#517
patricknitsch wants to merge 5 commits intoioBroker:masterfrom
patricknitsch:claude/sonoff-external-mqtt-F2iBP

Conversation

@patricknitsch
Copy link

  • Use an External MQTT Broker to work with a centralized broker and reduce own brokers.( self Broker works as normal)
  • Use an alternative Topic instead of the standard
  • Update Readme
  • Add translation script and update translations

Actually running on my system with centralized broker and alternative topic. Runs smoothly. Please have a look.

patricknitsch and others added 5 commits February 14, 2026 14:37
- Add client mode to connect to external MQTT brokers (Mosquitto, EMQX, etc.)
- Support username/password authentication for external broker connections
- Support MQTTS (TLS/SSL) with certificate configuration
- Add topic prefix support for multi-gateway setups
- Add advanced connection settings (keepalive, reconnect, clean session)
- Create src/lib/client.ts as TypeScript MQTT client wrapper
- Update src/main.ts with mode switching (server/client)
- Update src/types.d.ts with new configuration fields
- Add translations for ru, fr, it, es, pt, nl, pl, uk, zh-cn
- Add npm translate script via @iobroker/adapter-dev
- Update README with German and English documentation
- Update comparison table to reflect external broker support

https://claude.ai/code/session_01XjQhfAfCJkrpMwS65eaE9Y
Support Tasmota FullTopic configurations like %topic%/%prefix%/ or
tasmota/%topic%/%prefix%/ where the device name comes before
tele/stat/cmnd (e.g. tasmota/myDevice/tele/STATE).

- Add brokerTopicStructure config option (standard vs device-first)
- Update client.ts subscriptions for device-first pattern (+/tele/+)
- Normalize incoming messages to standard format for processing
- Convert outgoing commands to device-first format when configured
- Add topic structure select to admin UI (jsonConfig.json)
- Add translations for all 11 languages
- Update README with Tasmota FullTopic examples (DE + EN)

https://claude.ai/code/session_01XjQhfAfCJkrpMwS65eaE9Y
The adapter was trying to setState('info.connection') without first
creating the state object, causing "has no existing object" error.

https://claude.ai/code/session_01XjQhfAfCJkrpMwS65eaE9Y
@patricknitsch patricknitsch changed the title Sonoff - External MQTT broker and alternative Topic (feat) Sonoff - External MQTT broker and alternative Topic Feb 14, 2026
@patricknitsch patricknitsch changed the title (feat) Sonoff - External MQTT broker and alternative Topic (feat adapter): Sonoff - External MQTT broker and alternative Topic Feb 14, 2026
@patricknitsch
Copy link
Author

@GermanBluefox friendly reminder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants