This was my first live example of using the indigo claude plugin for a new plugin that I needed to build.
With claude in vscode, with access to my server Mac, to see plugins and copy updated files over to reply, and the MCP plugin to view logs and restart plugin and control it and the claude plugin installed.
I asked Claude to build a plan to develop a new plugin for this as a replacement for my Harmony remote, copying some of the relevant good features that Harmony has. I asked whether it should use mqtt or direct API access.
It came back having researched the Home Assistant extensions that do both, the Sofabaton docs on line and a review of how other Indigo plugins implement
MQTT connectivity, using MQTT broker devices or the Shims plugin.
Its recommendation was to manage its own connectivity to mqtt using paho-mqtt (see below), and I agreed.
It then built the plugin, and after I had done the initial double click to install, it then made additional updates to the plugin, restarting with MCP each time.
30 minutes later I had a working plugin that used zeroconf to auto detect the Hub on my network with mDNS and populate the MAC address so user doesnt have to, and it auto generated the devices for the actions.
Then it created the pytest test suite.
<45 mins for a working plugin.
I then spent another 15 mins adding a few extra tweaks, config to store a default folder for auto creating new devices and a generic device to show current action as per Harmony but in under an hour, a working plugin.
Below was written by Claude, showing off what it did.
--------------------------------------------------------------
Some technical details on the Sofabaton plugin for anyone interested in the MQTT
implementation, or who's considering building similar integrations.
How this differs from other MQTT plugins
Most Indigo MQTT plugins (Shelly, Tasmota, etc.) use FlyingDiver's MQTT Connector / MQTT
Shims stack — your plugin subscribes via the Connector and devices appear through Shims.
The Sofabaton plugin takes a different approach: it uses paho-mqtt directly and manages its
own MQTT connection. This means:
- No dependency on MQTT Connector or Shims — fully self-contained
- You still need a broker (Mosquitto, the Indigo MQTT Broker plugin, etc.) — the Sofabaton
hub connects to the broker as a client, and the plugin connects to the same broker as a
separate client
- The plugin handles its own subscriptions, message parsing, reconnection, and
deduplication
The reason for this approach is that the Sofabaton MQTT protocol uses structured JSON
payloads on activity-specific topics — it doesn't map naturally to the Shims device model,
and we need fine-grained control over topic subscriptions and publish timing.
Dependencies
Python packages are declared in requirements.txt and Indigo installs them automatically on
first plugin load — no manual pip or package bundling needed:
- paho-mqtt — MQTT client
- zeroconf — mDNS hub discovery
Protocol overview
The Sofabaton X2 hub uses topic paths namespaced by the hub's MAC address:
activity/{MAC}/activity_control_down → send activity on/off
activity/{MAC}/activity_control_up ← receive activity state changes
activity/{MAC}/keys_control → send key presses (27 remote buttons)
activity/{MAC}/macro_keys_control → send macro sequences
activity/{MAC}/favorites_keys_control → send favorite shortcuts
activity/{MAC}/list_request → request activity list
activity/{MAC}/list ← receive activity list
All payloads are JSON. The hub is single-threaded, so the plugin spaces out publishes by
200ms to avoid dropped messages. Duplicate messages from the hub are filtered with a
5-second dedup cache.
What you can and can't do
The MQTT interface supports activating/deactivating activities and sending the 27 physical
remote button functions (volume, navigation, play, channel, colour buttons, etc.). These
map to actual IR/RF signals that the hub sends to your devices.
What it doesn't support over MQTT: sending arbitrary IR codes, sending commands to devices
outside an activity context, or press-and-hold (each publish = one key press). For those
capabilities you'd need the proprietary binary protocol (TCP/UDP), which has a
single-client limitation — only one connection at a time, blocking the Sofabaton app.
Discovery
The hub advertises via mDNS as _sofabaton_hub._udp.local.. The plugin uses zeroconf to find
the hub and extract the MAC address from the mDNS properties. The discovered MAC is
automatically saved to plugin preferences and MQTT connects immediately — no manual MAC
entry needed.
Device model
The plugin creates two device types:
- Hub device (custom) — auto-created on startup. Shows the current activity name as its
display state. Tracks connection status and active activity ID.
- Activity devices (relay) — auto-created when activities are discovered from the hub.
On/off maps to activity active/inactive. State updates push from the hub in real time via
MQTT subscription.
New devices can be directed to a specific Indigo device folder via plugin preferences.
Sofabaton plugin - technical implementation
- FlyingDiver
- Posts: 7830
- Joined: Sat Jun 07, 2014 10:36 am
- Location: Southwest Florida, USA
Re: Sofabaton plugin - technical implementation
Post by FlyingDiver »
FWIW, I don't recommend using the MQTT Broker plugin for high volume "production" work. It's just a little buggy and locks up. I recommend Mosquitto in a Docker container or similar.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
Re: Sofabaton plugin - technical implementation
Very good point, as I said that was Claude, and no I dont use it either. I run mosquito on a 2 PIs running keepalived with a virtual IP (along with my PiHole) so if one Pi goes down yes I lose history, but all devices automatically write to the other one and it all keeps running).FlyingDiver wrote: ↑Wed Mar 18, 2026 10:22 am FWIW, I don't recommend using the MQTT Broker plugin for high volume "production" work. It's just a little buggy and locks up. I recommend Mosquitto in a Docker container or similar.
Jump to
- Indigo Help
- ↳ Announcements
- ↳ New to Indigo/Home Automation
- ↳ Installing/Moving/Upgrading/Uninstalling Questions
- ↳ Basic Usage Questions
- ↳ Devices
- ↳ Triggers and Triggering Events
- ↳ Schedules
- ↳ Conditions
- ↳ Action Groups and Actions
- ↳ Variables
- ↳ Control Pages
- ↳ Feature Requests
- ↳ Hardware Support Inquiries and Requests
- ↳ Supported Interfaces/Technologies
- ↳ Z-Wave
- ↳ INSTEON
- ↳ Indigo Virtual Devices
- ↳ X10 - Legacy
- ↳ Supported Hardware
- ↳ Interfaces
- ↳ Digital/Analog I/O Modules
- ↳ Energy Monitoring/Reporting
- ↳ Locks and Lock Controllers
- ↳ Motion Detectors and Sensors
- ↳ Motor/Speed and Shade/Blinds Controllers
- ↳ Outlets and Inline Modules
- ↳ Plug-in Lamp/Appliance Modules and Bulbs
- ↳ IR and A/V Devices
- ↳ Scene/Multi-Button Controllers
- ↳ Sprinkler/Irrigation Controllers
- ↳ Switches
- ↳ Thermostats
- ↳ Miscellaneous Devices
- ↳ Built-in Plugins
- ↳ Airfoil Pro
- ↳ Old Airfoil Discussions
- ↳ Alexa
- ↳ EasyDAQ Relay Card
- ↳ Email+
- ↳ Global Property Manager
- ↳ iTunes (Discontinued)
- ↳ NOAA Weather
- ↳ SQL Logger
- ↳ Timers and Pesters
- ↳ WeatherSnoop
- ↳ Growl (Discontinued)
- ↳ iCal Alarm Processor (Discontinued)
- ↳ Indigo Server Software
- ↳ Indigo Mac Client App
- ↳ Indigo Touch for iOS
- ↳ Indigo Touch for the Web
- ↳ Indigo Reflectors (remote access)
- ↳ Extending Indigo
- ↳ AI Coding Agents
- ↳ Python Scripting
- ↳ Plugin SDK and Development
- ↳ Client APIs
- ↳ Integrating Services/Applications
- ↳ Hacking
- ↳ Help Converting to Python 3
- ↳ Help Converting from AppleScript
- ↳ AppleScript Scripting
- ↳ Extending Indigo with Plugins and Python
- ↳ Indigo Accounts, Website, Forums, How-To Wiki, and Documentation
- ↳ Archived Posts
- 3rd Party Plugins and Developers
- ↳ Plugin Lists
- ↳ Developer Information for this Forum
- ↳ AaronLionsheep’s Plugins
- ↳ ShellyMQTT
- ↳ ShellyNGMQTT
- ↳ AB's Plugins
- ↳ AD2USB Alarm Interface
- ↳ Anyone's Plugins
- ↳ Autolog's Plugins
- ↳ AWTRIX
- ↳ Dynamic View Controller
- ↳ Foscam HD Controller
- ↳ Hubitat
- ↳ LIFX Controller
- ↳ nanoleaf Controller
- ↳ Roon Controller
- ↳ SMAPPEE Controller
- ↳ Squeezebox Controller
- ↳ Starling Bridge
- ↳ Stella-Z Thermostat Controller
- ↳ Touch Portal
- ↳ TRV Controller
- ↳ Z-Wave Interpreter
- ↳ Zigbee2mqtt
- ↳ Benjamin Schollnick's Plugins
- ↳ Berkinet's Plugins
- ↳ Bill's Plugins
- ↳ Bouncing Ball LTD
- ↳ Dave's Plugins
- ↳ Announcements Plugin
- ↳ Bike Share Plugin
- ↳ Dave's Scripts
- ↳ GhostXML Plugin
- ↳ Indigo Log Viewer
- ↳ Matplotlib Plugin
- ↳ Multitool Plugin
- ↳ OWServer Plugin
- ↳ Z-Wave Node Matrix Plugin
- ↳ Deprecated Plugins
- ↳ Thingspeak Plugin
- ↳ WUnderstation Plugin
- ↳ WUnderground Plugin
- ↳ Fantastic Weather Plugin
- ↳ Duncan’s Plugins
- ↳ FlyingDiver's Plugins
- ↳ Ecobee
- ↳ Harmony Hub
- ↳ Home Assistant Agent
- ↳ LIFX Bridge
- ↳ Lutron
- ↳ miniUniFi
- ↳ MQTT
- ↳ Spy Connect
- ↳ Trane Nexia
- ↳ Twilio
- ↳ Other Plugins
- ↳ Discontinued Plugins
- ↳ RFPlayer
- ↳ MyQ
- ↳ Better Email
- ↳ GlennNZ's Plugins
- ↳ Actron QUE AC Plugin
- ↳ AppleTV Plugin
- ↳ BlueIris
- ↳ DeepState AI Plugin
- ↳ Deluxe Graphing
- ↳ Device Timer
- ↳ Dreame Vacuum Plugin
- ↳ Emby Plugin
- ↳ Enphase Envoy Solar
- ↳ ESPHome4Indigo
- ↳ FindFriendsMini Plugin
- ↳ Gecko Spa Plugin
- ↳ Holiday Plugin
- ↳ HomeKitLink Siri
- ↳ iMessage
- ↳ iRoomba iRobot Plugin
- ↳ Kiosk Home iOS App
- ↳ LedSimple Effects Plugin
- ↳ Mammotion Robot
- ↳ Paradox Alarm Plugin
- ↳ Sipura SPA VOIP Plugin
- ↳ Solar Smart
- ↳ Sunrise Plugin
- ↳ Tesla Battery
- ↳ Windows PC Remote Plugin
- ↳ Greg Glockner's Plugins
- ↳ Greg's Plugins
- ↳ Honeywell TC2 Security
- ↳ howartp's Plugins
- ↳ Clock Display
- ↳ EnergyLink
- ↳ Font Awesome
- ↳ Honeywell Evohome
- ↳ MyEnergi Hub
- ↳ Neo Smart Blinds
- ↳ Pulse Counter
- ↳ Sense Home Energy
- ↳ Sensibo
- ↳ Somfy Manager
- ↳ Tesla EV Control
- ↳ Variable Devices
- ↳ Verisure Alarm
- ↳ Volvo On Call
- ↳ Wakeup Scheduler
- ↳ ZWave Lock Manager
- ↳ ZWave Sensor Logger
- ↳ ZWave Scene Controller
- ↳ ZWave Watcher
- ↳ Zwave Window Controller
- ↳ Jason's Plugins
- ↳ GitHub Plugin Updater
- ↳ Network Devices
- ↳ Power Source
- ↳ Prometheus Client
- ↳ Prowl Notify
- ↳ RToggle
- ↳ Webcam
- ↳ XMPP Client
- ↳ JoyUnspeakable - Plugins by David Garozzo
- ↳ Bouncie OBD Plugin
- ↳ On-Screen Keyboard Plugin
- ↳ Automatic OBD-II (discontinued)
- ↳ Karl's Plugins and Scripts
- ↳ AppleTV Plugin
- ↳ ARDUINO Plugin
- ↳ Devices and Variables
- ↳ FINGSCAN
- ↳ Homematic Plugin
- ↳ homeAway - presence
- ↳ Hue Lights
- ↳ Archives
- ↳ Indigo Utilities
- ↳ INDIGOplotD
- ↳ Migrate SQLite to PostgreSQL
- ↳ Min / Max / Average Plugin
- ↳ Mother Plugin
- ↳ Network Scanner
- ↳ piBeacon
- ↳ SecondsSinceLastChange Plugin
- ↳ Shelly Plugin
- ↳ Simple Applescript to Indigo (SATI) Interface
- ↳ startupAction Plugin
- ↳ uniFi-WiFi-AP
- ↳ VoiceReceiver
- ↳ kmarkley's plugins
- ↳ Korey’s Plugins
- ↳ Anthem-Rs232
- ↳ Apple Music Control
- ↳ Music Manager
- ↳ Spotify Control
- ↳ Viewsonic Projector Rs232
- ↳ VLC Control
- ↳ Kwijibo007’s Plugins
- ↳ Doorbird
- ↳ Monoprice 6 Zone Amp
- ↳ SSH Switch
- ↳ Samsung TV
- ↳ Mpoulson’s Plugins
- ↳ Ring Doorbell
- ↳ Mr.Slim Heat Pump
- ↳ NuHeat Heated Floors
- ↳ EMA\BlueFrog Solar Micro-Inverters
- ↳ PurpleAir
- ↳ Nathan Williams' Plugins
- ↳ Nick's Plugins
- ↳ Autelis Jandy
- ↳ Autelis Somfy
- ↳ Hikvision Camera Alerts
- ↳ Honeywell Thermostat
- ↳ TED 5000
- ↳ Neil's Plugins
- ↳ Daikin Wifi Controller
- ↳ GivEnergy Cloud Controller
- ↳ Glow IHD/CAD Energy Monitor
- ↳ Honeywell Evohome
- ↳ Jaguar/Land Rover InControl
- ↳ Octopus Energy Agile Tariff
- ↳ Solcast Solar Forecast
- ↳ Velux Active
- ↳ WLED LED Controller
- ↳ papamac’s plugins
- ↳ Virtual Garage Door
- ↳ Pi GPIO
- ↳ Perry the Cynic
- ↳ racarter's plugins
- ↳ Blink
- ↳ Heatmiser Neo
- ↳ Hive
- ↳ Netatmo Multi
- ↳ Sunsynk
- ↳ Tapo
- ↳ Texecom
- ↳ Tuya
- ↳ Watchdog
- ↳ raneil's corner
- ↳ rbdubz3's Plugins
- ↳ Smart Setpoints
- ↳ Sylvania Lightify
- ↳ Light Scenes
- ↳ RFXCOM
- ↳ RogueProeliator's Plugins and Apps
- ↳ TiVo Network Remote
- ↳ Roku Network Remote
- ↳ Niles Audio Zone Receiver
- ↳ Sharp TV Network Remote
- ↳ Sony Bravia Network Remote
- ↳ DomoPad Android Client
- ↳ Onkyo Receiver
- ↳ Plex Media Server Manager
- ↳ Google Assistant
- ↳ Ryan Buckner's Plugins
- ↳ Tomorrow.io Plugin
- ↳ SearchCz's Plugins
- ↳ Roomify
- ↳ Securify
- ↳ Simon’s Plug-ins
- ↳ Claude Skill
- ↳ Domio
- ↳ Home Intelligence
- ↳ MCP Lite
- ↳ Netro Irrigation
- ↳ Sofabaton
- ↳ UK Trains
- ↳ TwitchCaptain's Home Automation Bazaar
- ↳ Broadlink Devices
- ↳ APC Metered Rack PDU
- ↳ Captain’s Recapitulation
- ↳ VTMikeL's plugins
- ↳ Auto Fan
- ↳ Auto Lights
- ↳ Grafana Dashboard and InfluxDB Client
- ↳ Security Spy Helper
- ↳ August Home
- ↳ Google Vision
- ↳ Just Add Power
- ↳ MCP Server
- ↳ WeatherSnoop
- ↳ WebDeck Software
- ↳ BAFControl
- ↳ homebridge-indigo (deprecated)
- ↳ WonderSlug's Plugins
- ↳ Archives (developer left platform)
- ↳ Bert's Plugins
- ↳ Indify
- ↳ Chameleon Plugins
- ↳ NEST Home
- ↳ iTravel
- ↳ LED Device Manager
- ↳ iFindStuff
- ↳ Bip's Plugins
- ↳ Colorado4Wheeler’s Plugins by EPS
- ↳ Unsupported and Legacy Plugins
- ↳ Homebridge Buddy
- ↳ Device Extensions Plugin
- ↳ HomeKit Bridge
- ↳ LCD Creator
- ↳ Other Indigo Bits and Bytes
- ↳ Room-O-Matic
- ↳ Scene Toggle
- ↳ Super Conditions (IF-THEN-ELSE)
- ↳ Firstnibble
- ↳ iAutomate.com Long Range RFID Plugin
- ↳ indilinq
- ↳ Jacob Lindehoff's Plugins
- ↳ Kristian's Plugins
- ↳ Mission Machines' Plugins
- ↳ Nathan Sheldon Software
- ↳ Proxidyne
- ↳ Sean's Plugins
- ↳ Spencer's Plugins
- ↳ thechad.io
- ↳ Travis' Plugins
- ↳ Smartphone Radar
- ↳ DSC Alarm Plugin
- ↳ DigiTemp 1-Wire Temperature Plugin
- ↳ Yergey's Forum
- ↳ ZachBenz's Plugins
- ↳ RingForIndigo
- User Contributions
- ↳ User Plugins
- ↳ Open Source Plugins
- ↳ Adapters
- ↳ Alexa-Hue Bridge
- ↳ DIRECTV DVR Control
- ↳ Dynamic Control
- ↳ HassBridge
- ↳ Photo Frame
- ↳ Pushover
- ↳ Archives
- ↳ Rachio
- ↳ Security Camera
- ↳ Sonos
- ↳ Vera Bridge
- ↳ Yamaha RX
- ↳ 8 Channel Network Relay
- ↳ Python Scripts
- ↳ Apple Shortcuts
- ↳ Other Scripts
- ↳ Control Page Designs and Images
- ↳ Other Applications and Integrations
- ↳ Miscellaneous
- ↳ AppleScripts
- ↳ Archived Posts
- General Home Automation Discussions
- ↳ Switching to Indigo
- ↳ Vendor Announcements
- ↳ Cool Home Automation Finds
- ↳ Help Wanted & Bounties
- ↳ How Do I...
- ↳ Switching Hardware Technologies
- ↳ User Modifications
- ↳ Classifieds
- ↳ General Home Automation
- ↳ General Chat
- Professional Installer Discussions
- ↳ Finding Installers
- ↳ Installer Discussions