In the UI, to create a macro that turns my office’s lights on when an activity is started on the Sofabaton hub, I do:
Go to: Settings -> Automations & Scenes
Click: Create automation
Select: Create new automation
Click: Add trigger
Select: Entity -> State
In the menu on the right, under Select an entity, find the remote entity that the X2 integration added to HA for your hub.
In From, select Off
In To, select On
So this is my automation’s trigger, it’s going to fire every time the X2 hub changes from “off” (no current Activity) to “on”.
Now, to have it perform an “Action”, click Add action.
Select: Light -> Turn on
Click: Add target
Find and select: light.office
You’re done
Click Save
Now, you’re going to want to do something different then turn on office lights. You’ll have to figure out what Action to perform to get the Lutron thing to happen.
m3ta, thank you so so much! I got this working, well close, because couple of times it didn’t turn on/off the lights. It’s not as smooth as I think it should be , but that would be sofabaton software glitches. I will play around with this some more as the next step is to being able to turn on/off lights with pressing a pause button. Actually what i did is I chose the state of my tv to activate the Lutron lights scene. Don’t know if that’s the correct way but for today will have to suffice.
Please let me know what I owe you for your precious time and help.
Hahaha, I’m far from it. Most likely that’s where I stop , I mean I have some simple automations set up but the main reason I got into the HA because of the sofabaton remote integration. Previously I had a Harmony remote which was compatible with Lutron but couple of years ago it all ended. Anyway ,but how can I compensate you for your time?
So this is an interesting one, because the X2 integration’s docs clearly state that keypresses on the physical remote are not relayed to the integration. So you can’t make a trigger that says: “whenever someone click the pause button”.
To still get what you’re looking for, this would be the procedure (and all of this requires that the X2’s MQTT implementation is functioning properly, which as you indicate it may currently not):
Use the Sofabaton app to configure a virtual device on the X2 hub.
Give that virtual device a button/command, and name it something like “light-for-pause”.
If everything is working as expected, the X2 hub is now pushing this over MQTT, and in the MQTT broker this device should now be present. Every time you press that “light-for-pause” button, it should reflect that instantly in the MQTT broker.
Now we make our own sensor, which is easy to do in AH’s config. This sensor will update whenever the “light-for-pause” value in the MQTT broker updates.
We make a macro that triggers whenever that sensor updates.
Now for the trick to this:
use the app to configure all activities where you want the pause button to trigger the lights so that your virtual device is includes in the activity
in each activity, make a macro (i’m talking a Sofabaton hub macro now, not an HA macro). This macro has 2 steps without (or very low) delay. Step 1 is what you want the normal pause button to do, the actual pause command. Step 2 is the “light-for-pause” command on your virtual device.
Now map this macro to your physical pause button, for each activity where you need this.
So now every time you press pause, the actual pause happens and if everything is working as it should, your sensor in HA will update to indicate the button was pressed.
Oh man! That is a lot of info to digest for me but will try.
Actually speaking of the activity I was telling you about, so what i did I set the trigger ( MQTT message has been received) to turn main Lutron lights on/off and scones on/off and that I have implemented to the start/end movie activity.
Hi m3ta, sorry for to bother you again, you’ve mentioned that
[quote=“m3tac0de, post:25, topic:951654”]
If everything is working as expected, the X2 hub is now pushing this over MQTT, and in the MQTT broker this device should now be present.
Is that what I should see?
Hey again. I just watched this great video of a review of the X2. It’s really thorough and shows configuration for both HA → X2 and X2 → HA.
It’s different from what I said before (same principle but it’s better integrated than I anticipated). It’s a worthwhile watch, the HA stuff is towards the end.
The only thing the reviewer could have done better (I’m pretty sure) is to add all commands to a single virtual device, versus the one command per device that he’s doing now. That would solve the issue he runs into towards the end I think.
He also mentions in the video that he concluded that HA support of the hub wasn’t quite there yet, but he doesn’t elaborate.
Hello mt3a, yes I did watch that video on Sunday and I was able to do that but at the same time I didn’t know how to connect the activity on my remote with Lutron lighting and when you explained to me how to step by step in your post that’s when I was able to make it happen and I’m very grateful for that.
I just wanted to say thank you! This back/forth has been very useful in getting my new X2 integrated in HA! Just scratching the surface between the integration and virtual devices on the remote but working!
Hi kwstump, at least one of us is getting the hang out of this lol.
Note to mt3a, happy for you , and when you get it and decipher it all around please share some points with much lesser talented IT people.
Thanks a lot
hello m3ta, have you received your x2 yet? I’m still trying to decipher some other activities without luck. I probably that mentioned it before that I’d like to set up the x2 so when I press a pause button on the remote the lights switch from on to off ( scones turn off and main lights turn on ) and when pressed again scones go on and main lights go off. Hoping you will crack the system and share it.
Cheers and Merry Christmas.
I installed it and restarted but it doesn’t recognize my hub. When I go to the integration manually, it gives an error that says “config flow could not be loaded, invalid handler specified”