[Release] Sofabaton Integration

Release: Sofabaton Integration v1.0.0

Local control and activity sync for Sofabaton X2 and X1S hubs, set up from one app.

Problem:
Using a Sofabaton hub with Hubitat meant matching button slots and activity names by hand, and there was no local way for Hubitat to both follow and control activities. The X2 had no local Hubitat support at all.

The Fix:

  • X2: fully local, two-way over MQTT using Hubitat's built-in broker. Hubitat knows which activity is running and can start and stop activities. Activities are added automatically from the hub and stay in sync with the Sofabaton app.
  • X1S: local activity reporting, with optional start/stop control through Sofabaton's cloud webhook. Each activity uses a single "Body Value" to match, with no button slots to line up.
  • Guided setup, a status banner at a glance, one log level control for everything, and built-in Tips & Troubleshooting with step-by-step guides for each hub.

Requirements:

Install with HPM:

  1. Hubitat Package Manager โ†’ Install โ†’ Search by Keywords, search Sofabaton Integration
  2. Apps โ†’ Add User App โ†’ Sofabaton Integration
  3. Open Tips & Troubleshooting in the app and follow the setup for your hub

Already installed?

  • From a URL in HPM: nothing to do. Updates already come through HPM.
  • Pasted the code by hand: run HPM โ†’ Match Up once so HPM can track it, then Update.
Manual Install CLICK

Manual install method:

  1. Drivers Code โ†’ New Driver โ†’ Import each, then Save:

  2. Apps Code โ†’ New App โ†’ Import, then Save:

  3. Apps โ†’ Add User App โ†’ Sofabaton Integration, then follow Tips & Troubleshooting for your hub.

Source: Hubitat-Apps-Drivers/SofaBaton Integration at main ยท jdthomas24/Hubitat-Apps-Drivers ยท GitHub

Testers wanted:

  • X1S owners: I don't own an X1S, so real-hardware feedback on reporting and webhook control would be a big help.
  • X1 owners: does your Sofabaton app show Turn on API on activities? If so, X1 control-only support may be possible.
  • Anyone running two X2 hubs or an external MQTT broker

Thanks:

  • @dJOS for the original Sofabaton driver this builds on, and @mike.maxwell for the building blocks it started from
  • @gopher.ny for the MQTT platform fixes in 2.5.2.126 that made local X2 support possible
  • @m3tac0de Home Assistant integration and the official Sofabaton Hub integration, whose protocol research helped confirm the X2 message format

Roadmap:
Macros and favorites: run a Sofabaton macro, or jump to a favorite channel or app, >from a Hubitat rule
Hands-free hub discovery: Find My X2 already locates the hub, but it needs one activity press. The goal is to drop that step.

Have an idea or a use case? Share it in the thread. Real-world setups help decide what comes next.

Sofabaton has offered coupon codes for Hubitat users:
15% off Coupon Code: GITHUBX2

Sofabaton Official Store (No Expiry for Code)

Amazon US (Expires March 2027)

Release: Sofabaton Integration v1.1.0

Your X2 remote can now control Hubitat directly, set up entirely inside the app.

Problem:

  • There was no way to use spare keys on the Sofabaton remote (A, B, C, color keys) to control lights or scenes in Hubitat.
  • Activity devices were named just by activity ("Watch Apple TV"), so they were scattered through device pickers and easy to mix up with other hubs' activities.
  • Refreshing an X2 hub could occasionally miss its activity list, because the hub drops requests that arrive back to back.
  • After a Hubitat reboot, the MQTT connection didn't come back until you ran Force Reconnect on the Bridge.
  • Logs were spread across the app, the Bridge, each hub, and each activity, which made troubleshooting a hunt.

The Fix:

  • Remote buttons (X2): create a "Home Assistant Remote" in the Sofabaton app (e.g. "Hubitat Control"), add commands, and assign them to keys. The integration learns the remote from the first press and imports your command names automatically.
  • Button Actions: a new page under each X2 hub where you pick what each button controls, with Toggle, Turn on, or Turn off. Pick several lights for one button and Toggle works as a group. For dimmed levels or colors, point a button at a Room Lighting scene's activator. Button events still fire on the hub device, so Rule Machine and Button Controller work too.
  • Cleaner names: activities are now named Hub-Activity (e.g. Living Room-Watch Apple TV), so they group together in Room Lighting and other pickers. Custom names you've set are never touched, and renaming a hub updates its activities.
  • Reliable refreshes: requests to the hub go out one at a time, with an automatic retry.
  • Reconnects after reboot: the MQTT connection comes back on its own.
  • One place for logs: every Sofabaton log line now appears under the app, labeled by source. View logs in the app's banner shows everything.
  • Tips & Troubleshooting: new X2 setup step 4 walks through remote buttons end to end.

Action needed:

  • Requires Hubitat 2.5.2.126 or newer, for everyone, including X1S-only setups.
  • Update all four files (the app and the three drivers) through HPM, or manually.
  • Open the app once. Your existing activities are renamed to the new Hub-Activity format. Rules and dashboards keep working, since the devices themselves don't change, but you'll see the new names.
  • Tap Refresh Activities once on each X2 hub.
  • To set up remote buttons, follow Tips & Troubleshooting โ†’ X2 setup, step 4.
  • X1S owners: the X1S path is unchanged, but I don't own one, so reports are very welcome.

HPM directory addition soon. Need more testing first.

In your HPM JSON, SofaBaton is Sofabaton with a lowercase โ€œbโ€.

This has been corrected- Thank you

1- sofabaton
2- SofaBaton
3- Sofabaton

I keep changing my mind on which one to use.... :frowning:

@JdThomas24

Liking your integration, thanks for your efforts.

Is there a way to send a webhook to the parent device "all off"? As I primarily am interested in shutting down the system "activity" using RM.

I see the parent device follows the hubs on/off state but I don't see a way to issue a command using webhook from the parent device.

I'm using an X1S btw

Thanks for the details, that helps!

You're right, on the X1S the hub device's switch currently only follows the system state. It doesn't send anything. In the next update (v1.1.1), I'm planning to make the hub device's Off shut down whatever activity is running, so in Rule Machine you can just turn off the hub device.

On the X1S, that works by calling the running activity's Stop Webhook URL, so it'll need one set for each activity. Two quick questions:

  1. When you turn on API for an activity in the Sofabaton app, do you get separate start and stop URLs, or just one?
  2. Does the Sofabaton app offer anything like a "power off" or "all off" webhook for the whole hub?

In the meantime, if your activities have Stop URLs set, turning off the running activity in Rule Machine will already shut the system down.

  1. Looks like there's a separate command for each activity

  2. I don't see a all off command or anything similar

  3. Further investigation reveals that sending the off webhook from any activity is effectively the same thing as an "all off" command. So having a seperate off webhook for each activity shouldn't be necessary from what I can see.

Sorry for the delayed response

Just to comment here. I use the API off/on commands for each activity. Never tried to see if any of them turn any activity off. X1S by the way.

In the activity startup sequence in Sofabaton I send a command to HE telling me which activity is on. In the activity shutdown sequence I send a command to HE telling me it is shutting off. I have a non TV activity that enables the buttons to use in HE when no TV is running. When HE sees the activity shutting off it sends a start command to the HE activity to enable all the buttons, or at least the ones I use. Obviously when a TV activity is running I have some of the buttons, those not used by the TV, enabled for HE control. I also have commands in HE where if I do my bedtime routine it will stop the TV activity if I haven't already done so.

I use the driver that @djos setup to read the data from the X1S. Then just a simple app to do all the work.

Just my thoughts on mine. I realize the X2 probably has a lot more that can be done, but in my case I don't need any of that.

Release: Sofabaton Integration v1.1.1

X2 hubs now reconnect to MQTT on their own, and the integration is now available in Hubitat Package Manager.

Problem:
After a hub reboot or firmware update, the integration could get stuck showing MQTT broker is off and stop receiving activity changes from the X2. Hubitat's built-in MQTT broker sometimes starts a few seconds after the integration does. The integration tried to connect once, found the broker not ready yet, and never tried again. The only way back was running Force Reconnect MQTT on the Bridge device.

The Fix:

  • The Bridge now keeps retrying until it connects: after 30 seconds, then 1 minute, then every 5 minutes. No Force Reconnect needed.
  • This also covers a connection that drops later, for example if the broker restarts or the link is lost mid-day.
  • Logs stay quiet: one warning when the connection is lost and one line when it reconnects, not an entry for every attempt.
  • The MQTT card on the app's main page now shows the correct broker status after reconnecting.
  • Now listed in Hubitat Package Manager. Search for "Sofabaton Integration" to install.

Action needed:

  • Installed with HPM "From a URL" (the original instructions): just run Update.
  • Installed by pasting the code: run Match Up, select Sofabaton Integration, >then run Update.
  • If your X2 currently shows offline, run Force Reconnect MQTT on the Bridge device once after updating. From then on it recovers on its own.

@JdThomas24

Did this planned update make it into 1.1.1?

V1.1.1 turned into a MQTT hotfix for X2.
After looking at it, I don't think a separate All Off on the hub device would add much. To shut things down from Rule Machine, turn off the activity device that's running. On the X1S that needs the activity's webhook added, since that's the only way Hubitat can send commands to the hub. If you've got webhooks set up and turning off an activity doesn't shut everything down, let me know what happens and I'll take another look.

Understood, and yes, sending an "off" webhook to any of the activities shuts down everything.