SofaBaton X2 now works with Homey - my app has just been approved ![]()
Hi everyone ![]()
I have spent the last couple of weeks building a Homey app for the SofaBaton X2
The universal remote passed Homey’s strict certification today!, and it is now live in the official Homey App Store.
Until now the X2 could not talk to Homey at all. Now it can, and it works in both directions:
Homey → SofaBaton
A Flow card, “On [device]: press [key]”, sends commands to everything you have set up in your X2 - TV, amplifier, aircon, projector, fan. Both IR, RF and Bluetooth. So Homey can turn on the TV.
SofaBaton → Homey
Press a button on the remote, and a Flow starts in Homey. One press from the couch can dim the lights, close the curtains and roll the film. Your devices and keys show up as ordinary dropdown menus in the Flow editor. No raw JSON or cryptic codes. And the hub is found automatically on the network,
So setup is just a few taps.
LINKS
The app in the Homey App Store: SofaBaton X2 | Homey
Illustrated step-by-step guide (I warmly recommend starting here): SofaBaton X2 · Homey Setup Guide
Source code on GitHub (the app is free and open source, MIT): GitHub - RepairGuyDK/com.repairguydk.sofabatonx2: SofaBaton X2 integration for Homey — control your remote's devices from Homey over MQTT and trigger Homey Flows from the remote. · GitHub
The MQTT Broker app you will need (free, by Menno van Grinsven): MQTT Broker | Homey
WHAT YOU NEED
* A Homey Pro (or Pro Mini) - the app runs locally (SHS NOT! testet!)
* A SofaBaton X2 with hub, with MQTT enabled in the SofaBaton app. An MQTT broker that both the hub and Homey can reach. Easiest is the “MQTT Broker” app above, installed on Homey itself. If you already have Mosquitto on a NAS or a Raspberry Pi, you can use that instead.
THREE PITFALLS THAT COST PEOPLE AN HOUR !!
1. In the MQTT Broker app you MUST create a username and a password, even if you have ticked “Disable user authentication”. The hub refuses to connect without one. Also tick “Also allow unsecure connections”, and remember to press “Start Broker” afterwards, so it says “Broker is Running”. That is the one people forget.
2. When Homey has found your hub automatically, BOTH the found hub AND “SofaBaton X2 (manual setup)” are ticked. Un-tick “manual setup”, otherwise you also get an empty extra device created.
3. If you already run MQTT for Home Assistant, give the broker on Homey a port other than 1883 (e.g. 1885), so the two don’t fight over it.
A FEW GOOD TRICKS
* If you need to fiddle with the remote itself in the SofaBaton app on your phone, tap “Pause hub connection” on the device in Homey first. The hub can only talk to one at a time, and otherwise it locks up. Tap it again afterwards, and you are back.
* A brand new MQTT button shows up in Homey’s dropdown the moment you have pressed it once. It learns it by itself, you don’t need to restart anything. * Does it say “Device 3 / Key 7” instead of the real names? Then the hub’s name list is asleep. Pull the plug for about 10 seconds, wait a minute, and tap “Refresh devicelist” again.
* Only buttons that are set up under SofaBaton’s “MQTT” device reach Homey. Ordinary presses on your normal devices are not passed on, that is simply how the hub itself is built.
The app is free, open source and made by me in my spare time. It is not official and has nothing to do with SofaBaton - I just own an X2 and a Homey and thought it was silly that they couldn’t talk to each other ![]()
A few people in Denmark are already running it on their own gear, and it has been tested with both the MQTT Broker app on Homey and Mosquitto in Docker on an unRaid.
Thx to Ib Thomsen & Michael Christensen for testing ![]()
![]()
Questions, bugs or wishes? Feel free to write in this thread, or send me a mail at repairguydk@gmail.com, I read every mail!
There is also an installation video coming to YouTube very soon, where I show the whole setup from end to end.
Enjoy! ![]()
Fille / RepairGuyDK
